thoth23 / fpscreatorengine

Automatically exported from code.google.com/p/fpscreatorengine
1 stars 0 forks source link

Water - Crash when Sound zone or custom sound/music played when under water #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. setup trigger zone with water
2. setup sound zone under water level (ogg,mp3)
3. Crash with "Sound frequency value illegal at line xxxx"
4. Same with level music (built and test level) when player starts under water

What is the expected output? What do you see instead?
mp3/ogg music should play under water

What version of the product are you using? On what operating system?
1.18 beta 9

Please provide any additional information below.
I tested it with standard stock sci-fi open/close .wmv door sound, and it 
worked. With my custom .wmv the program does not crash, but plays the sound 
only on exiting waterzone. Maybe there is just very specific file format to use 
with water? 

Original issue reported on code.google.com by dan.sand...@gmail.com on 22 Feb 2011 at 1:44

GoogleCodeExporter commented 9 years ago

Original comment by LeeBamberTGC@gmail.com on 24 Feb 2011 at 7:46

GoogleCodeExporter commented 9 years ago
Well there is specific format to make it work. The file must be 22kHz 16bit 
mono. In this case wmv plays, with "underwater" pitch effect...
How to solve it for music files I still dont know.

Also it would be cool to be able to bypass the pich effect on selected 
sounds/music :(.

Attached properties of file that works. 

Original comment by dan.sand...@gmail.com on 6 Mar 2011 at 11:32

Attachments:

GoogleCodeExporter commented 9 years ago
I don't know much about the technical stuff of music but it seems that the 
sound file must be a "wav" file.

I was using a file that was an "ogg" file. The game would crash when I entered 
into the water. However, when I converted the "ogg" file to a "wav" file there 
was NO problem. 

When using the "ogg" file I would get the error message as shown in the 
attached file.

Original comment by terryr...@gmail.com on 25 Mar 2011 at 1:45

Attachments:

GoogleCodeExporter commented 9 years ago
I am pretty sure its in the file format. However, .wav file for music would 
occupy a lot of space. Also, I suppose you prefer stereo for music, right?

There should be file format specifications at least, by authors of the engine. 
Not only sounds and music, but for videos too... This trial and error method is 
such waste of time...

I will inform you if I´ll find a workaround, but at present state your built 
game just crashes when your music is playing and you enter water pool 
(sometimes) or start level underwater (everytime). 

Original comment by dan.sand...@gmail.com on 25 Mar 2011 at 2:54

GoogleCodeExporter commented 9 years ago
OGG works everywhere but water. I use it for the exact same reason you state in 
that a WAV file is very, very large. I did not comment by meaning if we use 
water we need to use WAV. I mentioned it because it might help Lee understand 
what is going on. There are a couple of other formats that work with FPSC and I 
will be trying those as well to see if they crash. 

Original comment by terryr...@gmail.com on 25 Mar 2011 at 7:41

GoogleCodeExporter commented 9 years ago
I'm using music and I guess I don't really need stereo but when you use the 
music and musicoveride I guess you automatically get stereo? 

I never actually listened to the music when I went under water. Had the sound 
off. But, this time I did. It seems that they changes something. The music is 
slower and a little deep pitch when you go under water as if this is what one 
might hear when under water. It returns to normal when the player gets out of 
the water. I suppose it can't do that with a compressed file such as OGG. I 
don't know really. 

Because, the size goes from 1800KB to 21000KB, as a work-a-round in the 
meantime, I will use OGG but stop the music when under water. That is going to 
be tricky though.

Original comment by terryr...@gmail.com on 25 Mar 2011 at 8:00

GoogleCodeExporter commented 9 years ago
Dan,

The looking at the source code, what happens is that when going underwater the 
sound speed is altered. The command is "set sound speed:"

The command will set the frequency used by the specified Sound Number. Decibel 
frequency ranges from 100 to 100,000 and must be specified using an integer 
value. 

It resets it to a decibel value of -10000.

This command is also used for material sounds. All material sounds are small 
and all are WAV files. Material sounds are the "footfall" sounds.

I just thought of something. The error message states that the "Sound frequency 
value" is illegal. That must mean it is below a certain frequency that it can't 
handle. I need to look into that. And maybe that's why anything above a 
frequency of 10000 would work but if it was below would not? What do you think, 
Dan.

Original comment by terryr...@gmail.com on 25 Mar 2011 at 9:57

GoogleCodeExporter commented 9 years ago
OK, this has nothing to do with the fact that it is an OGG file. It has to do 
with frequency as Dan had alluded to earlier. For testing purposes only, I 
modified the source code to (for Lee):

     if sound exist(s)=1
      if sound speed(s) > 10000
        set sound speed s,sound speed(s)-10000
      endif
     endif

My OGG file did not crash the game because it did not execute. However, what I 
don't understand is that according to ImTOO OGG the frequency is 44100. That is 
more than 10000. DBPro's "sound speed" command must be finding something 
different or no frequency because it is OGG. I'm confused but it's only because 
LEE ONLY KNOWS FOR SURE. :LOL:

Original comment by terryr...@gmail.com on 25 Mar 2011 at 10:33

GoogleCodeExporter commented 9 years ago
Nice little fix, well done!! Fixed for next beta.

Original comment by LeeBamberTGC@gmail.com on 28 Mar 2011 at 5:14