IrrAdventure - Part 7 - Sound creation and completions of the game
Back to the index
Sound creation
To add a sound, add between the "sounds" markers :
<sound fileName="click.wav" />
<sound fileName="wind.wav" />
and create these two sounds, or pick them from the example game, and put them in the "sound" folder, which you will create in "data". Note: you can use files with format wav, mp3 (to a certain extent), ogg, and all what is supported by audiere.
Now, add the attribute sound with value 1 to the opening markers of mechanism :
<mechanism clickX="-0.948778" clickY="-0.218659" clickZ="-0.228055" clickRadius="2" newNode="0" sound="1">
And modify the opening markers of node 0, with the attribute ambientSound to 2:
<node0 north="1" ambientSound="2">
Sound test
Launch the game. You hear the sound "wind.wav" played in loop. Click on the mechanism, you hear "click.wav".
Why did we use numbers 1 and 2 ? Because it is what allows you to identify the sounds, in the order where they were charged by the game. For better understanding, reverse the order of the "sound" markers.
Configuration of the config.xml file
Open the config.xml file. It contains some attributes which you can change the value.
- windowSizeX and windowSizeY defines the resolution of the game. It was put at 640x480 to create the game with more facility. When you finished the game, rather put it at 1024 and 768
- isFullscreen : defines if the game is in full screen mode. Set 1 when the game making is finished.
- displayBits : display resolution. 32 is advised. Drop to 16 in the event of problem.
- driverType : driver type. Values accepted :
- 0 : No driver (Do not use).
- 1 : Software rendering (Do not use).
- 2 : OpenGL 1.2
- 3 : Direct3D 8.1 (Beware, Direct3D does not work under linux)
- 4 : Direct3D 9 (Beware, Direct3D does not work under linux)
- 5 : Direct3D 8 on Windows and OpenGL on Linux
- 6 : Direct3D 9 on Windows and OpenGL on Linux
The rendering is a little better with OpenGL that with Direct3D.
If you don't know what to choose, set 2.
- isRelease : is the game finished. Set 0 or 1. If you specify 1, then keys A,Q, the right button of the mouse, and the comments on the console are unactivated.
- nbNodesMaxInMemory : number of nodes set in backbuffer memory. Bigger the number is, bigger the memory taken by the program is, and so the game can be slow. In an other hand, if the number is too small (minimum 1), the loading for each node will always be slow.
- timeFade : time of white fading between nodes (miliseconds). Set to 0 if you don't want any fading.
And here it is all! You can now create your own adventure game !
Back to the index