6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible),
17,577
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Crash! With a view entity
[Re: jcl]
#438628
03/19/14 03:48
03/19/14 03:48
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
That's weird to say the least. I've reduced the code and the project now to an absolute minimum, please download it here (not only jcl but some other readers as well, please): http://www.superku.de/mdl_crash.zipIt crashes on both my desktop (newest A8 version) and my laptop computer (8.30.5), all files have been replaced by new ones (even the level which only consists of one "position"/ camera and one object) and the codes has been checked multiple times for mistakes. However, what makes the problem even weirder, the crash disappears as soon as you change literally anything in the main function code (that includes commenting "video_mode" or removing the lines after "return").
void main()
{
fps_max = 60;
video_mode = 9;
d3d_antialias = 9;
collision_mode = 0;
vec_set(sky_color,COLOR_BLACK);
level_load("test.wmb");
ent_highlight = ent_for_name("highlight2");
ent_highlight.emask |= ENABLE_PUSH;
camera.x = tiles_dim_x/2*64;
camera.y = tiles_dim_y/2*64;
camera.z = 1487;
camera.tilt = -90;
camera.arc = 40;
on_esc = exit_game;
temp.z = 2;
for(i = 0; i < tiles_dim_x; i++)
{
for(j = 0; j < tiles_dim_y; j++)
{
temp.x = 32+64*i;
temp.y = 32+64*j;
you = ent_create("tile3.mdl",temp,NULL);
your.skill10 = i;
your.skill11 = j;
ent_tiles[i*tiles_dim_y+j] = you;
}
}
for(i = 0; i < tiles_dim_x; i++)
{
for(j = 0; j < tiles_dim_y; j++)
{
if(j < tiles_dim_y-1)
{
k = floor(random(tile_max_colors));
you = ent_tiles[i*tiles_dim_y+j];
your.skill3 = k;
you = ent_tiles[i*tiles_dim_y+j+1];
your.skill1 = k;
}
if(i < tiles_dim_x-1)
{
k = floor(random(tile_max_colors));
you = ent_tiles[i*tiles_dim_y+j];
your.skill2 = k;
you = ent_tiles[(i+1)*tiles_dim_y+j];
//if(you == NULL) error("AAA"); // <- hier
your.skill4 = k;
}
}
}
return;
mouse_mode = 4;
mouse_range = 3000;
while(1)
{
for(i = 0; i < tiles_dim_x; i++)
{
for(j = 0; j < tiles_dim_y; j++)
{
you = ent_tiles[i*tiles_dim_y+j];
if(you == ent_tile_selected) your.z += (48-your.z)*0.25*time_step;
else your.z += (2-your.z)*0.5*time_step;
your.skill41 = floatv(your.skill1);
your.skill42 = floatv(your.skill2);
your.skill43 = floatv(your.skill3);
your.skill44 = floatv(your.skill4);
}
}
wait(1);
}
}
EDIT: Array dimension should not be a problem, too: ENTITY* ent_tiles[64]; var tiles_dim_x = 8; var tiles_dim_y = 8; Even when you change the dimensions to let's say 4 and keep the array dimension at 64 it still crashes.
Last edited by Superku; 03/19/14 03:51.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Crash! With a view entity
[Re: Dico]
#438644
03/19/14 12:27
03/19/14 12:27
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
you need to wait one frame after level loading which is an odd design
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Crash! With a view entity
[Re: Dico]
#438645
03/19/14 12:37
03/19/14 12:37
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
OP
Expert
|
OP
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
i think the problem is in (wait) when i add it befor the for loop evrything work great in this exemple . That's the thing, man. Remember what Superku said? the crash disappears as soon as you change literally anything in the main function code Almost any change stops the thing from crashing, it's a very erratic and random behaviour. So it's difficult to say that you found the cause when you find a change that stops this crash - as a completely different, unrelated change does so, too. jcl, thanks for investigating and all your help. I'm hopeful that we find out what causes these strange errors. Just an aside, would you still consider this? I think it'd be great if, at least in the development version, the point of loading and creating objects would be indicating somehow - maybe with a ; or a _ or whatever. This would have saved me some time.
It sounds as this would be something relatively easy to add, but it allow us to narrow things down if we get a crash at that point. Thank you!
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
Re: Crash! With a view entity
[Re: Error014]
#438646
03/19/14 12:55
03/19/14 12:55
|
Joined: Feb 2012
Posts: 371
Dico
Senior Member
|
Senior Member
Joined: Feb 2012
Posts: 371
|
ah yes you're right
Last edited by Dico; 03/19/14 13:02.
|
|
|
|