zoot Posted December 3, 2012 Report Share Posted December 3, 2012 Here is the basic battle detection functionality: https://github.com/zootzoot/0ad/compare/master...battle-detectionIt keeps a list of attacks dealt by the player for the past interval milliseconds. When the sum of the damage of all of the attacks divided by the interval (i.e. the damage rate) exceeds a specified threshold, the component registers the player as being in battle. Quote Link to comment Share on other sites More sharing options...
zoot Posted December 4, 2012 Report Share Posted December 4, 2012 (edited) Maybe Omri can give some input on how he would prefer the musical side of this worked?After having tested a few games, I've found that there are bound to be corner cases where the game goes in and out of 'battle state' within a short period of time. This probably has to be masked with a bit of artistry: In the simplest case, we can cross-fade the tracks relatively slowly, so any state changes back and forth won't be too abrupt. In the more advanced case, the rhythm of the battle and peace tracks could be designed to match each other so when one is faded over the other, it sounds like they are part of the same piece. In the even more advanced case, a special 'transition track' could be played while cross-fading. Edited December 4, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 30, 2012 Report Share Posted December 30, 2012 this battle detection how works, with a Sound, and Battle Music?or too Minimap make a flashing wave? Quote Link to comment Share on other sites More sharing options...
zoot Posted December 31, 2012 Report Share Posted December 31, 2012 (edited) It's just for toggling battle music. Edited December 31, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 31, 2012 Report Share Posted December 31, 2012 It's just for toggling battle music. i was read the ticket, if you put a flare/flashing minimap for Skirmish, and a sound alert for for Battle, maybe can use that for radius localization, to avoid all units get a alert if are under attack, but if are closer could be same alert, or same battle, the adius determine if a battle are same than other. that i think is how works in some rts. Quote Link to comment Share on other sites More sharing options...
zoot Posted December 31, 2012 Report Share Posted December 31, 2012 (edited) i was read the ticket, if you put a flare/flashing minimap for Skirmish, and a sound alert for for Battle, maybe can use that for radius localization, to avoid all units get a alert if are under attack, but if are closer could be same alert, or same battle, the adius determine if a battle are same than other. that i think is how works in some rts.That is what the snippet quantumstate posted in #50 does. Battle detection isn't useful for attack notification because it doesn't keep track of the location of the attack. Edited December 31, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.