I was thinking about improving the Cataclysm experience and my thoughts got to the point where I wannt to add sounds to the game. Because the tiles are on their way (I believe they are).
It will be too much for developers to think about what audio sample they want to put on breaking door or banging zombie’s head with a burst of shrapnel since they have a lot of gameplay and balance business now.
My suggestion is to write everything that happens to player to some sort of an output stream. It may be stdout or stderr or maybe any other stream. But the std’s would be the best. Something like std::cout<<“thud_west” or <<“clear_window” would be great.
If this will be done I can write a launcher that will catch these messages and play sounds according to them. From this point player will be more aware of what is happening in the game since he will not only read it in the number of strings to the right, but also hear it.
Now I’m going to make an experimental build with the guys from 2ch, but if some volunteers want to help me with the output part - please pm me or write in this thread.
If you do sound, do it right. Cataclysm is a very immersive/“realistic” game, so whatever API you use to catch sounds, it should have the relative position to the player, as well as the loudness(including e.g. using floodfill to compute the amount of walls between the player and the source of the sound).
Cool, this is similar to what I proposed the last time sound effects and music came up. Part of the issue is that cross-platform audio support is even more fragmented than cross-platform graphics, so doing all this in-game encounters major issues with including libraries and keeping them happy, and also sound imposes asynchronous programming issues that we generally don’t have to worry about (and I’d like to keep it that way if possible).
On linux/mac the obvious way to do this is with either a named pipe, or a local socket. I think the simplest way to do this would be with a local UDP socket, and I’m sure that’s generic enough to work on all our target platforms. The cataclysm process would listen on a UDP socket (port determined by a config file probably, that way you can change it in case of conflicts, and the other side can read the config file too.), and if another process opens the socket, we start pushing out sound events in UDP packets, probably just ASCII encoded, or maybe json since we’re fairly standardised on that.
It really shouldn’t be all that hard to hook up the current sound infrastructure to spit out events when various things happen, and at some point we could either expand it to music control or add a seperate socket for that. That way you could have ambient events like “x monsters spotted” and “driving”, and “sleep”, “crafting”, whatever that could influence music, even procedural music generation if someone were interested in that.
The point being if you don’t follow forum ettiquite like staying on topic for the thread you post in and not reviving long-dead threads, your posts will get ignored, like this one.