0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: crash after level_load
[Re: pegamode]
#457662
01/26/16 10:01
01/26/16 10:01
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
The levels are very small (just rooms in a mansion).
I tried something like that (mini main function):
level_load([first_room]); wait(-5); level_load([second_room]); wait(-5);
In this case the crash didn't occur, but I'm not sure if this is a useful information. If it is an issue with a texture or model inside one of the levels, would this always lead into a crash? I guess that it might also depend on the total memory consumption, doesn't it? I'm pretty sure that you are trying to access something that wasn't just created yet, and that causes the crash. That can explain why in situation above everything works. You wait for 5 seconds, so it makes sure that everything get's created on the level. What do you have under that -5 seconds? Maybe that's the key to your crash? Greets
|
|
|
Re: crash after level_load
[Re: pegamode]
#457664
01/26/16 10:19
01/26/16 10:19
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
I would recommend you to 'disassemble' your level (don't forget to make a backup). Use 'default' texture instead of all textures that your second room has (if your levels are small, this won't be a problem I guess), use 'CUBE_MDL' for models that you create on fly via script, and use simple cube model (just create it in MED, simple cube) instead of all models that your second level has. If it won't crash, then start adding each model one by one. Still no crash? Same for textures. This will help to find out, if it's related to script of models/textures. If at the end, you will end up with getting your level back as it was originaly, then it's 100 % related to code. I'm pretty sure that there won't be easy way out of this.
Greets
|
|
|
Re: crash after level_load
[Re: pegamode]
#457666
01/26/16 10:34
01/26/16 10:34
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
I tried to delete the models in the level one by one, but it doesn't matter which model I delete the error doesn't occur anymore. Are they the same? Or all those models are different? I even changed the order of the models inside the level and the crash was gone. So maybe this causes the crash? Imagine having two entities (just a simple example I have in my head) one created after another. The first one tries to acces the second one, but it's not created yet. So you changed the order, and it worked? I'm pretty sure that your problem that causes a crash is complex than what I just said, but I wanted to explain how I see it as simple as possible. Just a thought. So I'm not sure if replacing the models by a dummy will help at all. Are there any models sharing same action/functions? Greets
|
|
|
Re: crash after level_load
[Re: 3run]
#457668
01/26/16 11:20
01/26/16 11:20
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
So you just have a level (testing one) which is fully made of models and without any actions assigned (just some models placed in WED). And after removing all actions from those models/sprites it still crashes, but when you change order of those models the crash is gone? If you wait for 5 seconds before and after loading level, crash is gone too, am I right? Do you have anykind of loop/looops where you controll entities? F.e. I had script where all door where controlled in one loop, do you have anything like that? Maybe that 'loop' is trying to access a pointer (pointers) that doesn't exist yet, so that's why 5 seconds delay helped. Changing the order could help, so you move model (models) that caused the crash up in the WED list. Anyway, if you have a crash on loading a level made of models without any actions assighed, this is strange.. A
Edit: it's really hard trying to 'guess' what causes the crash, without knowing how your setup of the game looks like.
|
|
|
Re: crash after level_load
[Re: 3run]
#457669
01/26/16 11:28
01/26/16 11:28
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
So you just have a level (testing one) which is fully made of models and without any actions assigned (just some models placed in WED). And after removing all actions from those models/sprites it still crashes, but when you change order of those models the crash is gone? yes. If you wait for 5 seconds before and after loading level, crash is gone too, am I right? no. The 5-seconds helped only when I load the levels "outside" of the game. I used a simple main function that does nothing but loading the levels one after the other. Even a wait(1) is ok in this case.
|
|
|
Re: crash after level_load
[Re: pegamode]
#457671
01/26/16 11:39
01/26/16 11:39
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
I use this function to print all running tasks:
void print_all_running_tasks() {
#define fctName _str("void print_all_running_tasks()")
ediag_entering(fctName);
char* funcname;
ENTITY* ent;
int i = 0;
for (i=0; i<num_actions; i++) {
engine_gettaskinfo(i,&funcname,&ent);
if (funcname != NULL) {
ediag(fctName, LEVEL_INFO, _str(funcname));
} else {
ediag(fctName, LEVEL_INFO, _str("funcname was NULL"));
}
}
ediag_exiting(fctName);
}
I receive this result right before the level_load: [21:39:52:083] INFO [void print_all_running_tasks()]: starting function [21:39:52:083] INFO [void print_all_running_tasks()]: calculateFreeGPUmemory [21:39:52:083] INFO [void print_all_running_tasks()]: mouse_key_observer [21:39:52:099] INFO [void print_all_running_tasks()]: garbageObserver [21:39:52:099] INFO [void print_all_running_tasks()]: fmod_eventUpdater [21:39:52:099] INFO [void print_all_running_tasks()]: fmod_trackMemoryUsage [21:39:52:099] INFO [void print_all_running_tasks()]: inv_arrows [21:39:52:099] INFO [void print_all_running_tasks()]: internalClock [21:39:52:099] INFO [void print_all_running_tasks()]: scheduleHandler [21:39:52:099] INFO [void print_all_running_tasks()]: player_movement [21:39:52:099] INFO [void print_all_running_tasks()]: player_movement [21:39:52:099] INFO [void print_all_running_tasks()]: load_new_room [21:39:52:099] INFO [void print_all_running_tasks()]: exiting function
And this is what I get right after the level_load (before the wait command): LevelInit at 46.934 14 entities 0 cameras 0 lights 0 sounds 2 paths 1 lmaps 1 textures 7 meshes 7 submeshes 104 faces...ok LevelReady at 47.692 [21:39:54:213] INFO [void load_new_room (STRING* lName, STRING* entPosName)]: level was loaded. [21:39:54:213] INFO [void print_all_running_tasks()]: starting function [21:39:54:228] INFO [void print_all_running_tasks()]: calculateFreeGPUmemory [21:39:54:228] INFO [void print_all_running_tasks()]: mouse_key_observer [21:39:54:228] INFO [void print_all_running_tasks()]: garbageObserver [21:39:54:228] INFO [void print_all_running_tasks()]: fmod_eventUpdater [21:39:54:244] INFO [void print_all_running_tasks()]: fmod_trackMemoryUsage [21:39:54:244] INFO [void print_all_running_tasks()]: inv_arrows [21:39:54:244] INFO [void print_all_running_tasks()]: internalClock [21:39:54:244] INFO [void print_all_running_tasks()]: scheduleHandler [21:39:54:244] INFO [void print_all_running_tasks()]: funcname was NULL [21:39:54:244] INFO [void print_all_running_tasks()]: funcname was NULL [21:39:54:244] INFO [void print_all_running_tasks()]: exiting function The two entries with "funcname was NULL" are the "player_movement" functions from above that are still in the list until the next wait(1). At first I thought that those cause the crash, but I also removed them completely already ... no change at all. I also checked all those function in the list, but couldn't find anything suspicious. As far as I know functions are only listed by engine_gettaskinfo after their first wait command, is this right? In this case the list might not be complete.
|
|
|
Re: crash after level_load
[Re: pegamode]
#457672
01/26/16 11:41
01/26/16 11:41
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
The 5-seconds helped only when I load the levels "outside" of the game. I used a simple main function that does nothing but loading the levels one after the other. Even a wait(1) is ok in this case. If using 'wait(1)' in a small main function that had nothing to do with your project and crash was gone, why you mentioned 5 seconds, it really disappointed me. If you loaded those models/levels aside from your project, and they didn't cause any crashes, isn't it obvious that crash caused by your script (this is at least what I think)? It will be hard to help fixing your crash without knowing how your code looks like and how you setup everything.. Maybe you could try to reproduce it in a small example to show us? Maybe you will even end up fixing it at the end. As I already said, I'm pretty sure there won't be an easy way out of this. Relying on debugging tools won't help in this situation, as you already found out by yourself. But anyway, trying to guess what might cause a crash in a complex project like yours is like trying to drive a car with a bandage on your eyes (or even more harder ). Edit: As far as I know functions are only listed by engine_gettaskinfo after their first wait command, is this right? In this case the list might not be complete. Here: - Waiting functions are stored on the Scheduler List in the order of their last wait() execution. This order can be modified by the proc_mode variable (lite-C) resp. the proc_late function (C-Script). The Scheduler List can be examined with the engine_gettaskinfo function. Greets
|
|
|
|