Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,426 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: ent_remove(my) crash? [Re: Germanunkol] #396254
03/04/12 19:47
03/04/12 19:47
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I'm remembering one thing now...
I had such a crash problem with decals and using level_free(). The terrain with decals attached was removed, but the decal function was still running and then crashed.
Adding a wait(1) before level_free() fixed the issue.

Are you doing anything like this somewhere?

Re: ent_remove(my) crash? [Re: FBL] #396274
03/05/12 08:57
03/05/12 08:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Simple errors, like freeing an already-freed entity, are normally caught by the engine and will not cause a crash. If the error is not obvious, it could be something more sinister, such as something overwriting some internal memory areas.

For finding the reason of such a problem, reduce your application step by step until the crash disappears. First remove all external plugins, then disable all functions that access internal memory structs, then remove all effects. If then the problem still is there, send me that project and I'll look into it. I'm meanwhile sort of an expert in finding hidden bugs in user projects.

Re: ent_remove(my) crash? [Re: FBL] #396279
03/05/12 09:45
03/05/12 09:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Originally Posted By: Firoball
Adding a wait(1) before level_free() fixed the issue.

Normally not, otherwise we'd named the function not "wait()", but "fixbug()". If a wait(1) changes the behavior of a bug and you don't know why, it can give a hint where to look for the bug. But it's normally not a fix.

Re: ent_remove(my) crash? [Re: jcl] #396329
03/05/12 18:58
03/05/12 18:58
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
problem was that the terrain was removed from memory (level_free!) and the decal routine seems to lag one frame behind. Of course it accessed the non existant terrain then.

That was the only plausible reason I found. it is directly related to a decal on a terrain.

Code:
ent_purge(map__sLevel.entTerrain); /* remove decals */
		ptr_remove(map__sLevel.entTerrain);

		wait (2); /* decals seem to need time... */
		level_free();



Last edited by Firoball; 03/05/12 19:07.
Re: ent_remove(my) crash? [Re: FBL] #396330
03/05/12 19:04
03/05/12 19:04
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
What is a decal routine?

Re: ent_remove(my) crash? [Re: jcl] #396331
03/05/12 19:09
03/05/12 19:09
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
whatever the decal does during its lifespan.

partCursor = ent_decal(NULL, bmapTemp, 40, vTemp + vAngle);
partCursor->lifespan = 0.001; /* only 1 frame */

I'm spamming the terrain with decals in a while loop.

Re: ent_remove(my) crash? [Re: FBL] #396371
03/06/12 09:23
03/06/12 09:23
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The lifespan only tells the renderer whether this decal must be rendered in the current frame. Unlike particles, decals are not doing something, they are just a passive list of objects.

If you had some function in your project that crashes when a new level is loaded, putting a wait(1) before level_load would obviously not help - it would then only crash 1 frame later. But if you have a while loop that is generating decals, stop that loop 1 frame before level change. Otherwise, placing a decal on an invalid terrain pointer can indeed cause a crash.

Re: ent_remove(my) crash? [Re: jcl] #396413
03/06/12 18:40
03/06/12 18:40
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
So stopping the function in the same frame before level_free() is not enough?
Well this tells then where the wait(1) comes from.

Without level_free() no wait(1) is needed.

Page 2 of 2 1 2

Moderated by  old_bill, Tobias 

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