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 (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
snd_playing Engine Crash #467244
07/22/17 01:12
07/22/17 01:12
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline OP
Expert
Error014  Offline OP
Expert

Joined: Jul 2002
Posts: 3,208
Germany
Hello, everyone.

In my game, I got an extremely rare crash. After playing for 15 (if I'm lucky), usually 30+ minutes, the game crashes:

Quote:
Error E1513: Script crash in pushblock@1: pba


I've placed "sys_marker" all over the place there, so we can tell exactly where the game crashes:

Code:
...
if(soundvol>0 && sndhandle!=0) {
sys_marker("pba"); //HERE IS WHERE IT CRASHED
if(snd_playing(sndhandle)>0) {
   sys_marker("psa");
...



I know that there's the engine parameter sound_vol, but I'm using soundvol - a variable I've defined - for this purpose.

Since "pba" fired, but "psa" did not, the line in question that crashes is therefore the "snd_playing" one.

Of course, this particular piece of code works almost everytime, with the same sound playing. Here's the sound playing code

Code:
sndhandle = ent_playloop2(whoToPush,snd_moveblock,20*soundvol/100,999999);



(sndhandle gets set to 0 on initialization, which also explains the other part of the if-condition)

The range parameter is very high, granted - and larger than the range given in the manual, but that shouldn't explain random crashes, right? In any case, I've strongly reduced the range.

What could cause this behaviour?


EDIT: Welp, apparently, there's a thread from 2013 about this, spawning a subsequent Bug Report - though I do not use PhysX. With no real fix...

Last edited by Error014; 07/22/17 01:57.

Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
Re: snd_playing Engine Crash [Re: Error014] #467245
07/22/17 04:54
07/22/17 04:54
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
sndhandle = ent_playloop2(...)

What happens to the sndhandle variable when this instruction happens? Does it store a numerical value? Is this variable a unique identifier of that played sound? Is sndhandle a global or local variable?

Monitor this value and see what it stores normally when its assigned to an ent_playloop, and then see if this value changes right before the crash?

Create a test level with the block being pushed infinitely by the player/ai and see if it crashes after a certain amount of time. Make sure no other entities are in this test level. Run the level over again and see if it crashes consistently past the 15 min mark.

Will it still crash if you used snd_play?, or regular ent_playloop?

Re: snd_playing Engine Crash [Re: jumpman] #467247
07/22/17 11:35
07/22/17 11:35
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline OP
Expert
Error014  Offline OP
Expert

Joined: Jul 2002
Posts: 3,208
Germany
sndhandle is a local variable, which is only used in the snd_-instructions you see here (and in the sndhandle!=0-check, also shown above).

I have for now replaced ent_playloop with snd_loop, because of the suggestion in the Bug Report thread I've linked above. I'll let you know if it crashes again!


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
Re: snd_playing Engine Crash [Re: Error014] #467249
07/22/17 16:03
07/22/17 16:03
Joined: Jul 2014
Posts: 72
D
DriftWood Offline
Junior Member
DriftWood  Offline
Junior Member
D

Joined: Jul 2014
Posts: 72
Here are some thoughts.
E1513 bad reference to pointer/handle. The handle is not a var alone its reference to an object. It must be valid. This error is almost always a bad pointer.

I'd use
if(ptr_for_handle(sndhandle) != null)
Stead of if(sndhandle != 0)

Not that there is much difference, but just because a Handle holds a
value, that doesn't mean it's a valid value.

Other manual quotes.
http://www.conitec.net/beta/aent_playsound.htm
Quote:
The entity must already be initialized at the time the sound is played. Thus the sound can be played 1 frame cycle after entity creation the earliest.


Of course you'd be safer to wait(1) after Entity creation and wait(1) after the _play instructions before testing for the snd_playing.


Moderated by  HeelX, Spirit 

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