Page 1 of 4
[GroupAI] Dynamic background Music V3
Posted: 15 Jun 2007, 08:21
by AF
Yes thats right, the biggest of the MTR's singe spring began, background music that changes based on what happens ingame! Whatsmore music that can be defined via mod (possible not the best method though).
This will drop a folder called music into your spring folder along with a few mp3's and a music.tdf If you wish to add music to your mod add a music/music.tdf to your mod and then include mp3s (not packaged in your sdz/7, they need to be inside the spring/music folder not the VFS).
Then ingame assign the groupAI to your commander or some other insignificant unit and hey presto.
Download v3 (0.74b3) here
Download v3 replacement dll(0.75b2) patch here
.76b1 version
note: uses windows MCI APIs, dont expect a linux build anytime soon.
Posted: 15 Jun 2007, 08:25
by AF
http://www.fileuniverse.com/?p=show&a=cat&id=54
OTA cavedog music. I already have a few in there already. Rename them to remove spaces, and then add them to music.tdf. Increase the files tag and add a set of new tags for the filename and the length in seconds.
Posted: 15 Jun 2007, 08:29
by Warlord Zsinj
Wow, if this works, I'm very impressed.
A few questions:
- Roughly how much CPU does it take to run this?
- What algorithms are you using to determine what changes the music?
Posted: 15 Jun 2007, 08:33
by chillaaa
You are the hawtness AF.
Zsinj is stalling doing any work whatsoever on his project...
Posted: 15 Jun 2007, 08:34
by Warlord Zsinj
Oh, and:
MTR -1

Posted: 15 Jun 2007, 08:37
by AF
I've yet ot notice a slowdown of any kind.
The mechanism for controlling music switches is simple, I'd have liked to have gone into more detail with it but groupAI lacks numerous calls skirmish AIs have.
It basically checks the unitcount and if its gone up or down at set intervals, along with a few timers to prevent switching back and forth every second.
Ideally I'd want it to be the gradient of damage dealt per second increase that determines the switches but I dont have that information.
Posted: 15 Jun 2007, 08:45
by Warlord Zsinj
I haven't tested it yet, so I shouldn't be asking questions till I do, but:
- Does it fade music in and out? Or does it just switch tracks? That's pretty important, IMO.
Posted: 15 Jun 2007, 08:49
by AF
I couldnt fade with the APIs I had that worked it just switches, but the change when it does happen isnt that bad at all, mainly thanks to the OTA music. I'll be looking to remedy this in the future.
Posted: 15 Jun 2007, 12:15
by Michilus_nimbus
GODLY
Posted: 15 Jun 2007, 12:30
by AF
I've removed the need to define the track length in the next version. Once I figure out howto start the groupAI via lua I'll release v2
Posted: 15 Jun 2007, 13:44
by trepan
An OS independant version can already be made using 0.74b3's LuaUI,
but I'm not fond of the technique that would have to be used. I may add
a simple lua call to 0.75 that would make it 'cleaner'. I'd also write an open-
source widget to go along with it
P.S. Spectators can't play the music with GroupAI? (no units)
Posted: 15 Jun 2007, 14:33
by AF
google is terribly obscure with mp3.
Most of what I've found refrences Windows MCI, installing codecs, encoding and decoding at command line between formats, and a collection of code projects articles that simply dont work.
I wasnt aware spring had an mp3 decoder compiled in it? There are OpenAL extensions for Mp3 but they're linux only.
Posted: 15 Jun 2007, 18:08
by AF
V2, has the entire soundtrack to OTA, autodetects the track length so no need to count seconds. Better track switching.
Posted: 15 Jun 2007, 18:46
by Neddie
Is there a way to allow Spectators to master the music to the player they start out watching?
Posted: 15 Jun 2007, 21:28
by AF
Not as far as I'm aware. You have to assign a groupAI to something for it to be loaded.
Posted: 15 Jun 2007, 22:27
by gamer17
I keep crashing
Posted: 15 Jun 2007, 23:13
by AF
Have you modified music.tdf? If so have you got any files with spaces in them?
If you've modified your version in any way can you send me the changes you made.
Finally, what version of windows?(60% sure it wont work with wine+linux/reactOS)
Posted: 15 Jun 2007, 23:46
by gamer17
No I have not modified anything, I have windows XP
Posted: 16 Jun 2007, 00:27
by Neddie
Are you using .mp3?
Posted: 16 Jun 2007, 00:57
by AF
and can you play the OTA soundtrack mp3s? (using microsoft windows media player not VLAN or winamp).
Is the crash as soon as you start the groupAI? If it doesnt crash within 10 seconds of you selecting and assignign that groupAI it isnt the groupAIs fault. Every single operation executed by the groupAI is executed in the very first run through, if it was going to crash its crash instantly.
XP?
XPn?
XP x64?
XP Pro?
XP home?
XP corporate?
XP tablet?
XP media center?
XP sp1 or sp2?
Directx 8?
Directx 9?
Integrated audio?
Codec packs?