This will require creating an XML format for describing states and commands in relation to animations. It should describe default animation states, allow animations that loop, and animations that when finished will go back to the current default animation. This should also allow animation speed as a parameter (such that a slow kick state can be defined using the same animation with a slower speed than a normal kick), as well as loop duration. It should also keep in mind an 'override' parameter in the HandleCommand() function where you set the current state no matter where the FSM is currently at. Eventually a graphic editor would be helpful, but is not needed to begin with.
The ultimate benefit of this is that avatar's animation programming is made simple-- you now only need to think about high level commands ("kick", "sit", "hurt1", "die") . You can share models with their FSM data between projects, and if they dont support specific commands your project desires, you can add them in. Note that this does NOT contain any information about collision, high-level AI, or movement in your world. You have to write more code around this class to incorperate that sort of stuff, but this will allow you to do something like the following:
Code: Select all
onEvent(user pressed walk) {
if( m_Avatar->HandleCommand("walkForward") ) {
m_velocity += m_facing * speed;
}
}So, to recap:
* makes avatars share-able across projects
* simplifies animation programming
* reduces re-compile time on avatar modification
As for when this will happen: I'll be getting to this fairly soon in IrrlichtRPG, but not in the next 3-4 weeks. If someone else thinks they'd like to take a shot at this in that time, I'd be happy to review/help and then modify it when I begin implementing in IRPG.