psycopathicteen wrote:
I'm not really that familiar with scripts. I probably misunderstood what you said.
Since
Gunstar Heroes is being discussed in that other thread, and I just checked it out to comment on that thread, let me use it as an example. At the very beginning, there's an intro sequence, where the characters run, look up, talk, point at things... that's essentially a scripted animation. How would you code that in your game? Have you though of a way yet?
There are many ways you can do it, but one I can think of that wouldn't be a pain in the ass would be to write all the actions of each object in sequence, and advance (roll over) to the next state based on whatever is more convenient (end of action, other object's actions, frame count, etc.). This allows you to use the same objects you use in-game (with all their animations, physics, actions) for these animations, all you have to do is code the whole script as if it were a state and force that state when the cutscene starts.
The alternative would probably be coding an actual scripting engine (which is really not worth it unless you're coding a game that heavily relies on scripts, such an RPG), faking all the action with animations, tediously recreating it frame by frame.
This is sort of a "bonus" that comes with the technique though. The main point is still to simplify the state management. If you ask me, simply not having to name every little intermediary action is already a hell of an advantage!
tepples wrote:
I'm sleepy and I didn't understand a word of that article!
rainwarrior wrote:
This was in C++
I always wondered how this would work in a high-level language. Interesting solution!
Quote:
Basically he would have the ability to put a YIELD macro or something similar in the middle of a function to defer execution for a frame
Or simply RTS if I wanted the object to keep doing what it's currently doing.