[GroupAI] Dynamic background Music V3

[GroupAI] Dynamic background Music V3

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

[GroupAI] Dynamic background Music V3

Post 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.
Last edited by AF on 21 Jul 2007, 00:54, edited 3 times in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post 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?
User avatar
chillaaa
Posts: 234
Joined: 16 Mar 2005, 00:12

Post by chillaaa »

You are the hawtness AF.

Zsinj is stalling doing any work whatsoever on his project...
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Oh, and:

MTR -1

;)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Post by Michilus_nimbus »

GODLY
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post 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)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

V2, has the entire soundtrack to OTA, autodetects the track length so no need to count seconds. Better track switching.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Is there a way to allow Spectators to master the music to the player they start out watching?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Not as far as I'm aware. You have to assign a groupAI to something for it to be loaded.
User avatar
gamer17
Posts: 235
Joined: 21 Feb 2007, 23:51

Post by gamer17 »

I keep crashing
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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)
User avatar
gamer17
Posts: 235
Joined: 21 Feb 2007, 23:51

Post by gamer17 »

No I have not modified anything, I have windows XP
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Are you using .mp3?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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?
Post Reply

Return to “AI”