For high-res texture/sprite projects, sprite-fix patches, music add-ons, music randomizers, and other graphic/sound-only projects.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
This demonstration shows off a small handful of basic ideas. In a nutshell - it's a very basic arcade/arena shooter where waves of enemies spawn until the player kills them all and the next wave can spawn. The background music will progress in song structure (horizontally) between each wave. However, within each wave, the given section of looping music will develop with additional instruments and rising patterns (vertically). Some additional details take place such as in-game event being synced to the music, powerup duration affecting instrumentation, etc.
This is the first episode in what will (hopefully) be a handful of similar demonstrations. There is a lot you can do with music integration, and I have a few more ideas I'd like to make proof of concepts for.
I plan on doing a video talking through everything in-depth for those who might not have a background in game dev / game audio / etc...but you folks around here are bright and experienced modder types, so you probably won't need any additional explanation.
ALSO - note that you may find a bug or two. This demonstration is a glorified portfolio piece, not an airtight plug-and-play engine. It's primarily to serve as a vehicle for shopping my music work around. Most of the time in gamedev, this sort of stuff is handled in middleware programs such as FMOD or Wwise...but I wanted to see if I could do it via ACS. Do not expect a professional engineer's level of code. That said, I thought some of you might get some enjoyment out of it regardless.
BASICALLY - you take a song, chop it up into separate chunks, assign each chunk to its own ambient sound thing via sndinfo (defined as world sounds), then use ACS to toggle the volumes of each on the fly depending on whatever in-game conditions you want.
Let's say you have a pre-chorus section of a song that you want to loop in-game while the player is trying to meet a goal. The closer the player gets to the goal, you want the drums to get more and more intense. So - you render out several versions of that same pre-chorus section of your song, each with an increasingly intense drum beat. In your map, you'll have each version assigned to its own ambient sound thing. At the beginning of the map, you essentially hit the "play button" on all of them, and instantly turn the volume down on all of them - this way, they are all playing in sync on top of each other, but the player is unaware. As the player then plays through the map, your script will constantly check how close the player is to the respective goal (via whatever conditions you decide), and turn the volume up on the desired ambient sound thing at any given point, giving the effect that the song is changing dynamically.
There are probably other ways to achieve this. One method I've considered but haven't tried yet is to have individual instrument tracks (rather than entire song chunks) set to their own ambient sound things. This way, you could use volume altering more akin to faders on a mixing board. This method's usefulness would probably be dependent upon the genre you're composing in - I imagine electronic styles might lend themselves well - but the lack of audio control you get with ACS/zdoom engine might not be worth it.
Known issues:
Spoiler:
Sadly, this is not a perfect system. Should you decide to play around with this method of music presentation for your maps, there are some problems to beware of...
There appears to be a sync issue regarding the engine. You may occasionally notice some of the transitions between sections sounding a split second off. Sometimes, the script appears to trigger a transition about a half-tic off where it should. Sometimes it's slightly ahead, sometimes it's slightly behind. Sometimes it's fine. It's very inconsistent. I've made every attempt to try and keep all the ambient sounds 100% in sync at the beginning of the map, but it seems unrelated to the ACS and beyond my control. Frequent opening of the ESC menu or console may worsen this, not 100% sure.
Due to the engine's tic length, you must compose your music in a tempo that lends itself to being chopped up evenly. Since the smallest unit of measurement in ACS is 1/35th of a second, you're gonna run into trouble if your song chunks need you to loop at 1/52nd of a second. The song in this demo is 160bpms, allowing each song chunk to be chopped up at an even 12:00 seconds.
Because the music in this method is technically considered sound effects and not music, the player won't be able to use the music volume slider in the menu. The sound effects slider will control the volume for both the sound effects and the music. Also, you may notice some volume ducking in the music when loud explosions/impacts/sound effects happen.
The music will stop upon opening the ESC menu or console. Some may consider this a minor break in immersion. I believe there is a workaround, but you likely won't want to use it - if the music continues while a menu is open, it will become out of sync with the script, giving you all types of issues.
I've been out of the doom modding scene for years, so perhaps there are developments I'm not aware of which might be useful. I haven't even looked at ZSCRIPT yet, as it didn't exist back when I was active on this board. Maybe some of you scripting wizards can come up with better ways of doing it...!
Anyways, have fun with it! Hope you enjoy. Feel free to shoot me an email with any feedback or questions. Cheers
I'm pretty sure there is a way to play different sounds/music in reaction to specific triggers during gameplay using UDMF scripting, but I can't really recall seeing anyone use it in any meaningful way before, so I'm not quite sure if it stacks up to your technique. Regardless, what you've done is certainly an advanced application of the concept.