Sqorgar
|
|
« Reply #6 on: July 02, 2015, 04:44:11 AM » |
|
My approach was to make the game out of cutscenes, rather than the cutscenes out of game. By that I mean that the characters on screen are a view of the game model, with the cutscene directions being the controller. I use an actor/stage metaphor.
Each actor has a queue of commands that it can follow. Move here. Play this animation. Fade visibility. Stuff like that. The commands set up animations and return immediately, so there's also commands to wait on animations or delay the queue for a few seconds. So the actor's command queue might look like:
MoveTo 64,85 PlayAnimation "Walking_NE" WaitOnAnimation position MoveTo 300, 85 PlayAnimation "Walking_E" Delay 4.5
And so on. Basically, each animating attribute has 7 commands (set, moveTo, moveFromTo, shift, abort, complete, wait).
Above that, I've got a Stage and a queue of stage directions. They are very similar to actor commands, but are more for coordinating multiple actors. So you can send actor commands to any actor, wait on actors, create new actors, and so on.
Ted: MoveTo 64,85 Ted: PlayAnimation "Walking_NE" Mike: PlayAnimation "ImpatientWobble" WaitOn Ted Mike: MoveTo 1,1
So the actor commands control the actors and the stage directions coordinate multiple actors. This system was largely designed for turn based strategy games where you make up complex behaviors involving multiple actors on the fly, but I'm fairly sure it can be used to build adventure games or cutscenes within an action framework. The most important part is the ability to block the queue based on various events. I'm assuming that the most important events are actors finishing behavior (waitOn) and waiting a set amount of time (delay).
I animate the position attributes directly, so if I wanted some sort of complex path to be followed, I'd probably break it down into a series of MoveTo/WaitOn instructions. One way to do this is to use a stack instead of a queue, so a command "PathTo x,y" could be popped off, and the individual commands could then be pushed on in its place.
|