PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

landscape prob in 9.6 and sound issue

directdance · 06 Mar 2006, 19:13 UTC
Hi,

an input problem is back in the new 0.9.6 version. You know my old code from the taxi game. The last build you sent to me worked fine but I tried the new beta a few minutes ago. When pressing the left key, nothing will happen anymore. When pressing the right key, the left key is triggered. I could not test more because of the key problem.

There seems to be another bug in the sound engine (was in older versions and in the new one). The Setvolume function is resetting other loaded sounds, too. I used sounds for diffrent things, liker moving the taxi, landing gear, etc. E.g. the moving sound is set to volume 5. When stopping this sound and playing it again, it will be set to volume 64. I do not have any routine in my program using a volume of 64. This will happen to a few diffrent sounds. After this, it is not possible to change the volume of this sample anymore.

Cheers,
Volker
Ok, looks like there really is a problem with the keys. Another user was reporting the same thing. I will get to it today or tomorrow and get back to you.

As for the sound issue, same thing I will look into it very shortly.
Here is how the sound engine works.

Code:
stopsound(s$);
playsound(s$);
setvolume(s$, random(64));


You have to play the sound first, then set the volume. The sound volume is always reset when the playsound() is used.

As for the lanscape problem I can't reproduce it here. It works correctly. Maybe it's the GameAPI.ppl file that is not up-to-date in the latest beta. Here try this GameAPI.ppl library file. Put it in \Program Files\PPL\Lib on your PocketPC or wherever PPL is installed.
Attachments:
GameAPI.ppl (7 KB)
directdance · 06 Mar 2006, 20:30 UTC
I tested it on my PC. Not on the PPC. Is there another GameAPI for the PC? Because when I copied it to my PC directory, nothing changed. Left is still not working, right is triggering left.

At the moment I am using your last buid wich is working.

Re the sound issue I will test it again ...

Thanks,
DirectDance
Oh, did I send you a newer release after 0.9.6? I don't remember.

I don't understand, it works on the PC and PPC. I will send you a new build, mind you I didn't change anything regarding keys, so we'll see if it works. Maybe I included an older .exe in the 0.9.6 release by mistake.
directdance · 06 Mar 2006, 21:15 UTC
Thanks Kornalius,

again re the sound issue.

This is how my program is working:

First, the main game engine is like this:

Code:

movement; // Move the taxi
keys_pressed; // Testing wich keys are pressed
barriers; // Activate barriers like magnets, wind, etc. depending on level
gear_deadlock; // if the taxi has stucked, free it
colission; // did anything collided with the taxi
col_gear_down; // like above but with landing gear enabled
volumesetting; // Set the volume of all sounds, generally
passvolsetting; // Set the Speach volume of the passenger, generally
level_a_end; // Here are only to-do´s if the first part of a level has finished


In those procedures are played some sounds like this (as an example):

Example of proc keys_pressed:

Code:

proc keys_pressed
.
.
.
stopsound(taxi_moving$);
playsound(taxi_moving$);
setloop(taxi_moving$, true);


As you can see, here is no volume command. A few ticks later, the engine loop as listed at the to will proceed the volumesetting procedure as this:

Code:

proc volumesetting
//Setting the sound volume

case (vol_fx$)
2:
setvolume(bum$, 5);
setvolume(taxi_still$, 5);
setvolume(taxi_moving$, 5);
setvolume(rocket1$, 5);
setvolume(rocket2$, 5);
setvolume(boing1$, 5);
setvolume(boing2$, 5);
setvolume(boing3$, 5);
setvolume(boing4$, 5);
setvolume(gear_up_sound$, 5);
setvolume(gear_down_sound$, 5);
setvolume(landed_sound$, 5);
3:
setvolume(bum$, 20);
setvolume(taxi_still$, 20);
setvolume(taxi_moving$, 20);
setvolume(rocket1$, 20);
setvolume(rocket2$, 20);
setvolume(boing1$, 20);
setvolume(boing2$, 20);
setvolume(boing3$, 20);
setvolume(boing4$, 20);
setvolume(gear_up_sound$, 20);
setvolume(gear_down_sound$, 20);
setvolume(landed_sound$, 20);
4:
setvolume(bum$, 50);
setvolume(taxi_still$, 50);
setvolume(taxi_moving$, 50);
setvolume(rocket1$, 50);
setvolume(rocket2$, 50);
setvolume(boing1$, 50);
setvolume(boing2$, 50);
setvolume(boing3$, 50);
setvolume(boing4$, 50);
setvolume(gear_up_sound$, 50);
setvolume(gear_down_sound$, 50);
setvolume(landed_sound$, 50);
end;

end;


This is workin great, as no other sound is played using a diffrent volume setting. But not all sound will be changed. Only some will set to a volume of 64. But the above listed proc is called on every cycle the game is proceeded. It seems like some samples are loosing their ID´s.

Thanks,
DirectDance
Are you sure that the global variables you are trying to use are not being reused inside your procedure as local variables? This is a very common mistake in PPL. That is why I have implemented a warning system in PPL. You should declare all your local variables in each proc/func with the Local() function first.

Send me the program if you want me to look into it more in depth.
directdance · 06 Mar 2006, 22:15 UTC
Thanks for you offer. FlyingCAB is on the way to you ...

Thanks,
DirectDance
Just to keep you guys up-to-date. I have recoded most of the sound engine. All channel's properties (volume, frequency, looping, panning) are kept at all time even if you issue a StopSound().