Turn-based strategy game playback?
I''m trying to implement a turn based strategy game engine but am stuck on some major points.
First I''ll introduce you to the style of game play. During the player''s turn they give their soldiers orders and once all of these orders are completed for every troop then the playback mode commences. During playback mode the player watches the result of his and the other players/computers'' movements. I have no idea on how to construct the visual stuff using the player''s orders and previous troop states.
How in the world do I organize the data structures? How do I implement the playback mode combining the movement and actions of each troop? How do I handle object generation (i.e. projectiles)...
I don''t think it would be efficient to construct a complete frame be frame for the playback mode using the instructions once and then leaving them alone. But perhaps that would work if I optimized it like FLI compression or something...
Anyone''s thoughts would be much appreciated.
Writing this message has seriously inspired me, weird how that happens... I would still appreciate anyone''s input.
-Andy
Look at Alpha Centauri. Not only will the game suck hours from your life; it also has very simple animations when the computer''s playing. I think from your post that this is what you''re looking for.
Since you didn''t give much information about your project, I can''t be too specific in my reply, but I''ll try. I''d suggest putting the moves in a linked list--this way you can go back and delete moves from the middle easily. Each "move" would be a unit action or something. When the player''s done making her moves, she hits "go" and then your program processes each of those moves, starting at the head of the list. Or, if order is important, it would all happen simultaneously (but that would be hard to follow).
In executing each of the moves, your engine updates the stats of the units involved (position, damage, etc.) and shows an animation or something. Then you go to the next turn.
Since you didn''t give much information about your project, I can''t be too specific in my reply, but I''ll try. I''d suggest putting the moves in a linked list--this way you can go back and delete moves from the middle easily. Each "move" would be a unit action or something. When the player''s done making her moves, she hits "go" and then your program processes each of those moves, starting at the head of the list. Or, if order is important, it would all happen simultaneously (but that would be hard to follow).
In executing each of the moves, your engine updates the stats of the units involved (position, damage, etc.) and shows an animation or something. Then you go to the next turn.
ya, I guess keep an array, or linked list, whatever, for storing the animation data for the replay. unless you have to be able to replay the whole game, you can just delete and create a new array during each turn.
JoeMont001@aol.com www.polarisoft.n3.net
JoeMont001@aol.com www.polarisoft.n3.net
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement