Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 8 1 2 3 4 5 6 7 8
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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: pegamode
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


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: crash after level_load [Re: 3run] #457663
01/26/16 10:12
01/26/16 10:12
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I also think that it's either a memory overflow or an invalid pointer.

My problem is that I've done the following things without success:

- listed all currently running functions (before and after the level_load) and checked them
- removed all actions from the models in the level where the error occurs

But I still believe that it's like you said ... unfortunately it seems not possible to list running functions before their first wait command. So their might run a function that I don't see at the time of the crash.

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 Offline
Senior Expert
3run  Offline
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


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: crash after level_load [Re: 3run] #457665
01/26/16 10:29
01/26/16 10:29
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
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.

I even changed the order of the models inside the level and the crash was gone.

So I'm not sure if replacing the models by a dummy will help at all.

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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: pegamode
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?
Originally Posted By: pegamode
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.

Originally Posted By: pegamode
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


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: crash after level_load [Re: 3run] #457667
01/26/16 10:50
01/26/16 10:50
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
All models are different.

Usually the rooms consist of:

- room model (walls, floor, ceiling)
- dummy light models (an invisible simple cube model)
- dummy character position models (an invisible cube positioned at doors)
- dummy cam models (an invisible cube model we use to place, move and switch the camera)
- environment models (doors, windows, flowers etc.)

I removed all actions from the models in the room that crashes, so there shouldn't be a dependency that can lead into the crash (at least I hope so).

Yes, a lot of models share the same action.

All models the player can interact with have an action called "useable_object". But this one was also removed in my tests.

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 Offline
Senior Expert
3run  Offline
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.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Originally Posted By: 3run
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.

Originally Posted By: 3run
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 Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I use this function to print all running tasks:

Code:
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:

Quote:
[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):

Quote:
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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: pegamode
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 grin ).


Edit:
Originally Posted By: pegamode
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:
Originally Posted By: MANUAL
- 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


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 4 of 8 1 2 3 4 5 6 7 8

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1