Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 843 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
No Error just a crash? #437564
02/19/14 16:43
02/19/14 16:43
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
If you assign a skin of a model to the target_map of a panel and then change the level then the engine will just crash instead of giving an error.
Put this code into the sample folder and try it:

Code:
#include <acknex.h>
#include <default.c>


PANEL* test =
{
	bmap = "banana.bmp";
	flags=SHOW;
}

void main()
{
	level_load("");
	ENTITY* testc=ent_create("basket_ball.mdl",nullvector,NULL);
	camera.x=-100;
	//test.target_map=bmap_for_entity(testc,0);
	while(!key_k)wait(1);
	wait(-1);
	level_load("small.hmp");	
}



Comment out that line and you´ll see what i mean.

It took me nearly a week to find that nasty bug!


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: No Error just a crash? [Re: alibaba] #437565
02/19/14 17:18
02/19/14 17:18
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
That's not a bug, and that's not something engine is supposed to tell you.

Because entities are destroyed your target_map pointer becomes NULL therefore you get a crash. They could have add check if target_map is NULL but then the people would try and wonder why their panels do not render at all etc..


3333333333
Re: No Error just a crash? [Re: Quad] #437568
02/19/14 18:04
02/19/14 18:04
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
But this way i have no lead what may cause the crash, as it was some days ago.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: No Error just a crash? [Re: alibaba] #437569
02/19/14 18:17
02/19/14 18:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The problem is that the engine has to know that the content of the pointer test.target_map is no longer valid to render into and I'm not sure how would one implement an error message for this efficiently.
However, it could be added to the manual as a note/ warning.


"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: No Error just a crash? [Re: Superku] #437573
02/19/14 20:21
02/19/14 20:21
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline OP
Expert
alibaba  Offline OP
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Originally Posted By: Superku

However, it could be added to the manual as a note/ warning.

This sounds fair enought.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: No Error just a crash? [Re: alibaba] #437577
02/19/14 21:48
02/19/14 21:48
Joined: Feb 2012
Posts: 371
Dico Offline
Senior Member
Dico  Offline
Senior Member

Joined: Feb 2012
Posts: 371
The code is work without crash for me , what is problem in it ?

Last edited by Dico; 02/19/14 21:50.
Re: No Error just a crash? [Re: Dico] #437578
02/19/14 21:52
02/19/14 21:52
Joined: Feb 2012
Posts: 371
Dico Offline
Senior Member
Dico  Offline
Senior Member

Joined: Feb 2012
Posts: 371
oh sorry i forget to push button k , yes the engine crash

Re: No Error just a crash? [Re: Superku] #437579
02/19/14 22:36
02/19/14 22:36
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Originally Posted By: Superku
The problem is that the engine has to know that the content of the pointer test.target_map is no longer valid to render into and I'm not sure how would one implement an error message for this efficiently.
Well, the only option is checking every pointer before using it by iterating over the whole c_list thing. Does not sound reasonable in any way to me.
Originally Posted By: Superku
However, it could be added to the manual as a note/ warning.
What would such a warning look like? "Beware of vagabonding pointers!"?

Last edited by Uhrwerk; 02/19/14 22:40. Reason: Sorry for the confusion, Superku!

Always learn from history, to be sure you make the same mistakes again...
Re: No Error just a crash? [Re: Uhrwerk] #437580
02/19/14 22:39
02/19/14 22:39
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: Uhrwerk
I don't get it. How is the engine supposed to detect vagabonding pointers? And what would such a warning look like? "Beware of vagabonding pointers!"?

That's exactly what I said/ meant?

EDIT:
Quote:
Well, the only option is checking every pointer before using it by iterating over the whole c_list thing. Does not sound reasonable in any way to me.

And that's what I was thinking, yes (on deletion of one object).

Last edited by Superku; 02/19/14 22:40.

"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: No Error just a crash? [Re: Superku] #437581
02/19/14 22:49
02/19/14 22:49
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
On deletion is not sufficient. You could store the pointer in any variable and assign it later to the render target / whatever code may use it and crash.


Always learn from history, to be sure you make the same mistakes again...
Page 1 of 2 1 2

Moderated by  jcl, Nems, Spirit, 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