Creating Point and Click Games with Escoria

Music and sound effects

Referring to the Godot Engine book, importing and playing sound is quite simple in Godot context. But there are a few things to take care of :

  1. sounds effects could be in wav format to avoid uncompressing effort and avoid delay due to this
  2. music can be in mpc, ogg or opus
  3. try to delete silences at the beginning and at the end of the samples
  4. to speed up sound playing you can stick to 44Khz mono rate, eventually 44khz stereo if it is important to your game. The game will be much smaller in size and play drastically faster.
If needed Audacity is a free GPL software that can be use to convert and improve sounds before importing in Godot.

Background music

Background music is a good way to improve the design of your world.

To add background music to your game, verify main.scn contains globals/bg_music.scn as a child of telon.

insert background music in point and click game

To launch to music, you have 2 choices depending on the way you want it to happen.

If you want the music to be played automatically, change the globals/bg_music.tscn by adding a stream path to the stream node. You have to activate autoplay property in Inspector too.

autoplay background music in godot escoria

To control the music changes on event, use the set_state to bg_music command when you want to load a new music and give the file path in local system :

set_state bg_music "res://scenes/intro-game/sounds/asianoriental2.ogg"
Take care to use only stream formats for bg music, like ogg, mpc or opus. Wavs won't work here !

To change a music to another, just reuse the set_state with another ressource path.

To stop the music, use set_state bg_music off.

Keep in mind that the state of the object will be saved to the savegame, so this music setting will be restored when a game is loaded.

Sound effects

Sound effects are made to give a better feedback to action as well as giving the game more reality. Most sound effects you’ll need will happen while picking or using object, or even when a dialog happen as dubbing. Because there can often be animations in the same time the sound plays, Escoria uses those animations too. If you don’t have any, you will have to set one for each sound.

For example, if we’d want the good_bamboo play sounds when picking it we should do the following.

  1. edit the good_bamboo.tscn file
  2. add a samplePlayer Node
  3. in the Inspector, modify the Samples property to create a New SampleLibrary and press > to enter the library to load sample files in wav format
    adding sound sample in godot
  4. then select animation node, create an animation and name it whatever you want, for example pick_up
  5. keeping the animation panel open, select the samplePlayer node, go to Play property when you can select you sample from the list.
  6. you have to click on the little keyat right of the Playproperty to add it to the animation. If Godot ask for adding a track, just answer create.
    using sample sound in animation
  7. you can add this way as many animation as you have sounds to play in your item
  8. the last thing is to declare the animation when you want the sound to be used. You could use set_state command, but we can preferably use anim global_id animation_name or cut_scene global_id animation_name. In our case, we would get :
anim good_bamboo pick_up

Il y a une erreur de communication avec le serveur Booktype. Nous ne savons pas actuellement où est le problème.

Vous devriez rafraîchir la page.