Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Script crashes, what happened internally #466160
05/28/17 03:42
05/28/17 03:42
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi friends! So before I start, i just have to say that I have fixed this script crash (as far as I know :D) but I wanted to know what could have happened internally when it was crashing.

Bascially, I was trying to do local avoidance of AIs while theyre running around. Using ent_next, each AI checks every entity, and if they can be shoved, they will do some stuff to find an angle to push away from. an extra single c_move was used for this (not for every entity that was in range)

The game ran correctly for some time, but then I would get a script crash in a totally different function, one that had nothing to do with the local avoidance snippet. I would try some fixes, but it would still script crash after some time.

After testing and testing and keeping track as many things as possible, I narrowed it down to this innocuous looking definition of variables that I didnt pay attention to:

VECTOR my_shove2;
VECTOR shove_temp2;
ANGLE my_shove2;

As you can see, my_shove2 was declared as both a VECTOR, and an ANGLE. Can lite-C handle this?

What I dont understand, was that with these declarations, the game worked for some time, then script crashed.

How was it able to work for some time then crash? Shouldnt it have crashed as soon as possible?

The script that was crashing was the pathfinding script. However, once I removed this shoving section from the AI, the game never crashed in the script! the AIs continued to pathfind the level, even when leaving the game running for a couple hours. BUt once I put the shoving snippet back(the double my_shove2), the pathfinding script would eventually crash.

Anyone have a high level or general Idea of what could have happened internally? The script didnt crash instantly, but after some time. It would happen , i think, when the ais were bunched up and triggering the shove.

Re: Script crashes, what happened internally [Re: jumpman] #466161
05/28/17 05:56
05/28/17 05:56
Joined: Aug 2003
Posts: 118
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 118
Deutschland
Lite-C can handle multiple declarations. But it is only using the last declaration and discarding the earlier one. So my_shove2 would always be an angle because this was the last declaration. Angles consists of three vars like vectors. They are internally the same. But maybe Acknex keeps the values of angles inside their ranges (I never tested this. So I don't know if this is correct) and there was a division by zero or something like that? Did you get a special error message?


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