Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Moving sounds into subfolders
- - By Zapper [de] Date 2015-12-12 10:50
Preparing the integration of ala's new sounds, I would now move sounds into the subfolders as suggested by ala. This would finish this.

The sound directory structure would then be

Sound.ocg
   |-Animals.ocg
   |---Chippie.ocg
   |---Fish.ocg
   |---Monster.ocg
   |---Puka.ocg
   |---Wipf.ocg
   |---Zap.ocg
   |-Buildings.ocg
   |---Chest.ocg
   |---Elevator.ocg
   |---Furnace.ocg
   |---StoneGate.ocg
   |-Clonk.ocg
   |---Action.ocg
   |-----Dig.ocg
   |---Movement.ocg
   |---Verbal.ocg
   |-Environment.ocg
   |---Disasters.ocg
   |---Tree.ocg
   |-Fire.ocg
   |-Hits.ocg
   |---Materials.ocg
   |-----Glass.ocg
   |-----Metal.ocg
   |-----Rock.ocg
   |-----Wood.ocg
   |-Liquids.ocg
   |-Objects.ocg
   |---Arrow.ocg
   |---Balloon.ocg
   |---Boompack.ocg
   |---Pickaxe.ocg
   |---Plane.ocg
   |---WallKit.ocg
   |---Weapons.ocg
   |-----Bow.ocg
   |-----Javelin.ocg
   |-----Musket.ocg
   |-----Shield.ocg
   |---Windbag.ocg
   |-UI.ocg


This would mean that we would need longer paths to play sounds, such as:

Sound("Objects::Windbag::ChargeStop");
Sound("Objects::Weapons::Javelin::Draw");
Sound("Hits::GeneralHit?");
Sound("Hits::Materials::Glass::GlassHit?");
Sound("Objects::Weapons::Bow::Shoot?");
etc...


I would use the attached file for moving/fixing the sounds plus some minor manual work.

If you have any opinions on this, now would be the time for them.

I hereby license the file git_rename.sh under the CC-BY license
Attachment: git_rename.sh - renaming script for the sound subfolder stuff (40k)
Parent - - By Armin [de] Date 2015-12-12 12:18
I like the structure but why is it necessary to write down the whole path? They are all loaded anyway, aren't they?
Parent - - By Zapper [de] Date 2015-12-12 12:25
Well, namespaces are kind of the point of the move.
Would Sound("Munch1") play Clonk::Actions::Munch1 or Animals::Fish::Munch1?
Parent - - By Armin [de] Date 2015-12-12 12:41 Edited 2015-12-12 12:51
I thought the point of the change is that when you create a new object you can now faster find matching sounds. If you want a Hit sound for a new object, you search through the Hit.ocg folder e.g.

>Would Sound("Munch1") play Clonk::Actions::Munch1 or Animals::Fish::Munch1?


There is only one Munch1 sound, that's what I would expect. We don't have thousands of sounds so that we have problems with finding unique names. Edit: MunchFish1 and Munch1 are easy.

I would never come up with the idea to write CreateObject(Vegetation::Trees::Coniferous) when we have endless possibilities for unique IDs.
Parent - - By Zapper [de] Date 2015-12-12 12:53

>We don't have thousands of sounds so that we have problems with finding unique names. Edit: MunchFish1 and Munch1 are easy.


Yeah, either ClonkMuch.wav and FishMunch.wav or Fish::Munch and Clonk::Munch. That's not really a difference. Only that the new solution allows you to also FIND the sound on your harddrive.
The question is just how deeply you want to nest those categories.

>I would never come up with the idea to write CreateObject(Vegetation::Trees::Coniferous) when we have endless possibilities for unique IDs.


You actually have to write Tree_Coniferous. Or GUI_InteractionMenu. Or Library_ClonkControl.
I don't get the point. We have been doing that since 2010 or so.
Parent - By Armin [de] Date 2015-12-12 13:07

>You actually have to write Tree_Coniferous. Or GUI_InteractionMenu. Or Library_ClonkControl.
>I don't get the point. We have been doing that since 2010 or so.


I only tried to transfer the style of the sounds to the IDs. Of course, I know the IDs of the trees but it is easy to forget that the trees are in a separate "Trees" folder and not directly in the "Vegetation" folder. However, my point is that I rather remember a slightly longer name than a slightly shorter name plus the path. Only my opinion.
Parent - - By ala [de] Date 2015-12-12 13:12
In general sounds were scattered along many internal objects, and also the sound folder was just one big list of names. Although this list was named better than in Clonk Rage, it was not really friendly from the scenario designers point of view. The Folders get a bit of overview and should encourage more sound use.

The names are a bit longer due to the path but would have also gotten very long without the folders, for example AnimalPukaHurt1 - not quite short either.
Parent - - By Armin [de] Date 2015-12-12 13:26
I see your point and I hope it will help. Still PukaHurt1 is okay imo.

Speaking of the Puka, what about the following situation:
The puka is an electric animal which is using an electric sound of the accumulator when attacking with little shocks. If you want to look at the .ogg sound, you search in Animals/Puka but there are maybe no sounds...
The wizard tower in CR used something like Sound("Electric"); when absorbing crystals. I have no clue where else that electric sound got used but it had completely different use-cases.
Parent - By ala [de] Date 2015-12-12 13:52

>I see your point and I hope it will help. Still PukaHurt1 is okay imo.


Yes, this works fine. But if the category is left out everywhere we will have a mess again :)

Well I'm not saying the system is perfect - but it's a start. We can tweak it, for example remove folders that don't have many sounds for now. So Tree::Crack would be TreeCrack again.

>Speaking of the Puka, what about the following situation:


You could see in the animal script where it was taken from. So it would not be a big deal, the only question would be where best to put a sound like that, and that probably would be environment folder.
Parent - By Armin [de] Date 2015-12-13 14:56
Since no functionality/possibilities get lost, I have nothing against the patch now btw. As I said I like the structure. My preference with the style should not delay it.
- - By Zapper [de] Date 2015-12-13 22:16
Done. I hope I fixed all locations where sound is played.

I also noticed that we try to play some sounds we never had (line break, error, ...).
Parent - - By ala [de] Date 2015-12-13 22:32

>I also noticed that we try to play some sounds we never had (line break, error, ...).


What else? - I can put them on the sound list. I actually did one error sound, not sure if it fits though.
Parent - By Sven2 [us] Date 2015-12-13 22:44
1. "Command" (Currently played when clicking a scroll bar)
2. The button-down-sound is currently ArrowHit, which is a bit too loud and complex in my opinion. It should be shorter and less loud than the click sound played when you release the button.
3. Some sound for acid corroding materials such as earth. It's currently like CR, but I think it could sound better; maybe using multiple sounds.
- - By Maikel Date 2015-12-15 09:59
General post to this topic: What happens to a sound like Sound.ocg/Clonk.ocg/bla.ogg, is that in the same namespace as the Clonk? and what happens if I define that sound in the Clonk as well?
Parent - By Zapper [de] Date 2015-12-15 12:01
Probably the same that happened previously when you had two sounds with the same name somewhere. Not 100% sure what that exactly was, though. The later sound probably just shadows the first one?
Parent - By Sven2 [us] Date 2015-12-15 16:40
The object sound overloads the global sound. Except if one is ogg and the other wav and you play with a wildcard, then I think you can have both.
- - By Maikel Date 2015-12-15 17:37
Another question on the topic: Some of our sounds are defined directly in a scenario folder, why do we allow this (it is not documented) and what about the namespace?
Parent - - By Zapper [de] Date 2015-12-15 18:29
It's most likely just played without a prefix then. I have nothing against allowing that - especially since those sounds are then probably very scenario-specific sounds and the risk of naming clashes is very low, if any.
Parent - - By Sven2 [us] Date 2015-12-15 19:21
Yes I agree. Sounds in scenarios should be no problem because scenarios "know" their scope. Also, they are the only sounds without a prefix right now. (Except for "Pop").
Parent - - By Maikel Date 2015-12-16 10:27
Then this could be documented, that scenario folders and scenarios can contained .wav and .ogg files. Are there any other places from which sound files are loaded besides these and System.ocg's and Object.ocd's?
Parent - - By Anonymous [us] Date 2015-12-16 13:53
I believe Sound.Ocg in .ocf works. But haven't tried.
Reply
Parent - - By Maikel Date 2015-12-16 16:56
I meant, we need to document that one can put files directly into the .ocs or .ocf folder. It is currently not in the documentation.
Parent - By Sven2 [jm] Date 2015-12-17 04:30
I think it's only allowed for background compatibility and the preferred method is actually to have a local Sound.ocg.

But of course it's convenient when you only have 1-2 sounds.
Up Topic Development / Developer's Corner / Moving sounds into subfolders

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill