Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Interactive Battle Music System

This request is intended for 'A' class scripters... experts on the RGSS/Ruby system with a knowledge of RMXP's hidden classes, specifically the audio class.

It is also intended for scripters with a decent-to-high level of expertise in music writing and theory.

It almost invariably requires a rewrite of the AUDIO class itself.[/FONT]


* - * - * - * - * - * - * - *


The system I am requesting is a replacement of the battlemusic system in RMXP. It merely plays audio files, whether they be .wav, .mp3, .mid, .ogg... etc. However, it plays the music straight through... loops... plays through again... and doesn't 'really' change depending on circumstances.

:-/ Circumstances?

Yeah... like the music could change the melody to a stronger... more grim theme if the enemy is winning the battle.

:eek: You mean that you want it to actually read stuff from the battlesystem? How the heroes are doing? If they're winning or losing?

Yes, and even more.

What I was thinking was playing a base theme... nothing much, merely a repeating harmony track... drums... bass... and other various instruments that loop repeatedly throughout the battle. It should be short... merely a couple of bars or so, or perhaps a set of harmony tracks that perform one after the other.

But, melodies also play with the system. These melodies must sync up with the harmony track... probably using the 'start' point or 'end' point of the looping harmony track for timing purposes. If two smaller harmony tracks were used, you could have a more sensitive system... with the melodies able to sync up even more.

The Melodies that I mention are music files of small-to-decent size that contain more conspicuous instruments... guitars, trumpets, violins, cymbals, and etc. The volume could even be raised higher in these files. And the music would 'obviously' be made to match the style of the harmony track(s).

O_o Would suck if they didn't eh?

Shut up.

*cough*

Well, the types of melody tracks, or conditions that the system should be able to track would be the following:
  • Beginning of combat (Non-looping)This plays at the very beginning of combat. This melody could play 'before' the harmony starts... leading into it, or 'as' the harmony starts.
  • Basic 'neutral' melody (Looping)Played right after the 'beginning of combat' music. It plays continuously until other conditions apply.
  • Basic 'actor' melody (Looping)This melody plays as long as the party seems to have a better level of stats or starts right after a victory condition is registered.
  • Basic 'enemy' melody (Looping)This melody plays as long as the party seems to be losing the combat, or starts right after a losing condition is registered.
  • Actor 'higher than' melody (Non-looping)This melody plays if the party registers some effect (damage or whatnot) that gives them the upper hand. Once this music plays out, it reverts to either the 'neutral' or 'actor' melody.
  • Actor 'defeats a...' melody (Non-looping)This music plays once an actor actually defeats an enemy or condition (poison or whatnot). After this melody plays out, it reverts to either the 'neutral' or 'actor' melody.
  • Enemy 'higher than' melody (Non-looping)This melody plays if the party receives some effect (damage or whatnot) that makes them lose ground in battle. Once this music plays out, it reverts to either the 'neutral' or 'enemy' melody.
  • Enemy 'defeats a' melody (Non-looping)This music plays once an actor is killed by an enemy or condition (poison or whatnot). After this melody plays out, it reverts to either the 'neutral' or 'actor' melody.
  • End of combat (success) (Non-looping)This plays with the harmony, or as the harmony music ends.
  • End of combat (defeat) (Non-looping)This plays with the harmony, or as the harmony music ends.
And these melodies will change based on conditions checked throughout the battlesystem and the battler classes. It would check the HP and SP levels of all the battlers, negative conditions like Poison or... Frog or positive ones like Blink or Strength Up. Obviously, this would also require an extensive configuration system that points out what states 'ARE' positive or negative.

B-) So what you're saying is the game could play a decent melody throughout, then if the enemy hits with a poison skill... the music would change to a brash dark score then change again to a lower, darker piece. Then if the player performs some healing spell, the music could swell and the melody changes to something lighter. All the while the harmony goes along, keeping time for the music.

Pretty much. Some melodies loop, and others don't. Those that don't loop merely switch over to the ones that 'do' loop when they're done. And all the while, the harmony goes on and on...

As such, this system should allow for the ability to change the harmony and various melodies in-game with 'script calls' and 'map event script calls' so the battle music can change by the game-designer's whim. And, it should be able to have one or more melody attacked to a condition (like three 'success' themes are available and when a hero wins... it plays one randomly or in succession).

':| Think you made it hard enough?

Nope. Not yet.

It should be made compatible with virtually any system via aliases whenever possible, but not requiring any external script such as MACL or the SDK. It should be made as a complete standalone audio system. The fewest possible conflicts and widest range of usage as possible.

;) Aw, you gone and done it.

* - * - * - * - * - * - * - *


I know that this would be a daunting task, so I don't have any illusions. Be that as it may, someone may find themselves intrigued by this challenge.
[/FONT]
 
This would certainly make battle more appealing, as hear the same 15 seconds over and over again is boring. The problem is primarily syncing everything together. You would need to have different audio tracks, all with the same basic loop to them, and when you switch from one to another, play at a certain location then loop. If there was a rewritten audio module, this could more or less be done fairly easy.

But the API in this has killed my brain just trying to write a basic audio module. Stupid volume. That and the default Audio module is very, err... horrible. I am suprised it allows multiple sound effects to play at once. I about ready to give up on the win32 or whatever api it is the audio module uses, and find a new dll all together, and expand it with the other audio module extensions. If someone can find a decent dll, with any sort of documentation, I would more than be willing to look at it and see what I couldn't do.

If we find the right api, you could alter the music playback speed, and other audio controls like bass and whatever.

But the conditions and syncing wouldn't be too bad actually. Reading what you consider "good" or "bad" in battle isn't that difficult. Much like min/max A.I., you can just test certain things like:

~ Awarding points to certain hp and mp levels. If arshes has 1000 hp, give the part 3 "good points". If Basil has more 50% health, give x good points. etc.
~ Awarding points to good or bad states.
~ Awarding points to skills in the inventory
etc.

When you are between different ranges, check the current playing music. If it is different, fade out the current and just play normal volume the second (or less fade effect). I wouldn't suggest checking this point value though more than once every second or two. I would go with a simple checkup in the update method, and update whenever Graphics.frame_count % Graphics.frame_rate == 0 or something.

You could take this even further for users, by using the simple filename for the normal state, then test for file extensions for the good and bad states in battle.

Just throwing some ideas out there if anyone would be interested on working something like this. The hard aspect would be just finding a decent audio dll file and re-writing the API.
 
Maybe it can be done without touching the audio class (really poor, isn't it?).
You can alias 'bgm_play' of Game_System to save the name (and the volume and pitch, too) of the new playing song and with Time.now the moment when it starts.
Then alias the update def (I don't know what one should be) to look for when it's looping time (Time.now minus previous Time.now) for that fixed song.
And if there is some conditions, change the music (with the aliased bgm_play). If not the case, save the new Time.now for future loops (or better, restart the song with another call of bgm_play).

But, it's only an idea and seems difficult (you must be carefull with the time loop) and it can be tedious to customize.
 
better if the BGM changes to a harder one while calling spells or Bestias ( Like FF(.. everytime i call a bestia, the music changes to an epic one )...

Love the Idea ^^
 
"Never give up. Never Surrender." - Tim Allen (Galaxy Quest)
C'mon... it was a fun Star Trek-like parody...;)

Giving it a li'l more life, let me explain that this system I want was not a flash of inspiration. It was done before.

Back in the mid-to-late 80's (yep... I'm not that young), there were a series of fighter games by LucasArts that were... not BAD! And they were founded on the Star Wars franchise. Heh... go figure. The first two 'DOS' games (X-Wing and TieFighter) used a system known as iMuse which was able to play midi music based on the player's actions:
makeitsimple.com":1ryttoyb said:
IMUSE was Lucasart's design for synchronizing music with game play. By changing to different midi tracks when certain situations were occurring (enemies enter sector, engaging starfighters, clear of starfighters), gamers felt much more in touch with the action.
However, their third game... X-Wing vs TieFighter (a 'Windows98' game and an attempt at multiplayer)... didn't fare so well as they removed the iMuse system.

But when they released the fourth game, X-Wing Alliance, they reinstated a whole new iMuse system that used 44.1KHz/CD Quality audio files from the actual John Williams score. That was when he was less repetitive and more creative.

So with this li'l history lesson... I BUMP this request.
 
this script is putting me on the edge of my seat!!!

can't someone do something along the lines of a Battle Scene class...
and have it setup with 'if and then's...
it would seem so simple???
but yet im no script writer... (IF scripting was easier... i would so do it)
class battle
if skill use
ME is ""
if Stat on Ally
ME is ""
if Stat on Enemy
ME is ""
If Hp is < 50%
If Hp is > Enemy Hp
BGM is ""
Else
if Enmey Hp < 50%
BGM is ""
and what not... also have it like...
haha... yet i don't know how these things work..
and DerVVulfman don't you script?
 
Well, I'm asking for something a little bit more complicated and would probably need to rewrite the entire AUDIO class. I did think about using MEs and BMGs at the same time, but it would probably be a bit more ... elegant (?) ... if the system was able to blend the audio tracks.

Also... while I have a good ear for music, I don't really have 'too' much experience with RGSS's AUDIO class or with the Windows API (well, not anymore). Even Seph gets a headache dealing with it. Why not? It IS a headache to mess with the windows API... :yes:
 
This is not constructive per se, but Shadow of the Colossus did this with their battle musics. The music would shift with the sway of the battle, becoming more triumphant as you took the Colossus down. It was a lovely feature (both because of it's effect and th excellent sound track). you have my moral support.
 
Cant you sort this out with something like the good points/ bad points Seph suggested, so you have certain basic melodies and it changes depending on how well/ badly the battle is going? And to flourish it maybe have MEs for when you use special skills, in an array, like
Code:
when skillid = 1
play ME 'cross cut'
You could even enhance this by having different MEs used depending on the points of hte battle
Code:
when skillid = 1
if battlepoints < 50
play 'cross cut 1'
else
play 'cross cut 2'
That would probably still take some work but it wouldnt require rewriting the Audio class.

Or have I entirely missed the point of this exersize?
 
Sounds like a great idea, I hope this request gets fulfilled =)

I can't really think of many RPGs that do this, but I imagine its something like in the old Mario games, where the music would get much faster as time ran out (But, for RPG battles and something different than time running out)
 
Oh this sounds great. I'm looking for a script like this, so it's all handy dandy.

Btw, you should definetly have the option for people to change the neutral/actor/enemy/etc music anytime durign the game via script commands. Just an idea.
 
this would be awesome and i really do hope you get the help you need.
but, heres a little suggestion (i have no idea if this would simplify the process or not) how about changing the pitch as a basic option?
So when the enemies are winning the music could become closer to -50%.

Just an idea, but your request would definately improve battles alot.
 
New2Ya's and darksora's ideas are ones to consider. Stuff you could call like battle event calls you'd set up in the TROOPS database. Nice touch.

Though the primary system to design would be the timing system that gauges when the melodies start (or replace older melodies) in-sync with the baseline harmony(s). That, and how to store a list of the different melodies and harmonies for a single battle music episode (or something like that).

Like... one battle music set would have two harmonies, and one set of ups, downs and etc. These would have to be stored as a battle BGM. Another battle music set coulld have one harmony, and another set of ups... and etc, to be stored as another battle BGM.

Changing the battle BGM in a map event or whatnot changes the harmonies and melodies like the default system, but for this interactive Battle Music system.
 
This is a great idea. It reminds me of Skies of Arcadia. The battle music in the game changed if one of your characters died, and slowly went back to the original battle music if he/she was revived. :)
 
This is a great idea, I've only started scripting so I can just grasp how difficult this is, the only way I could see this being completed is if all of RMXP's best scripters were to work together.
 
Another idea... as victory events can be checked in the system, why not have an option for a victory melody (or melodies) that play... again in timing with the harmony base? It should be able to carry its way through the Battle Report popup and so on, so there won't be a need for the separate ME music that plays after the battle.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top