Suggestions needed on replay-style game function

BlitzMax Forums/BlitzMax Programming/Suggestions needed on replay-style game function

The r0nin(Posted 2006) [#1]
I'm wondering if anyone has implemented something like a replay function in their game (for use in the following concept game), and can give me some tips or advice.

I have a game concept that is turn-based with a real-time component. In other words, the player will plot his movement on the screen like in a turn-based game. After finishing setting up his movement, the game then generates a series of keypress tests to determine whether the player can successfully shoot targets of opportunity, dodge enemy shots, etc., during the turn. After all of this, the game will then show the results of the turn (like a movie), including the results of the players keypresses.

What I need help with is an efficient method of storing all of the movements/actions during the first two phases of the game. I can't think of any way to do this without creating several huge arrays or types to hold all of the info, running through the turn during the keypress phase (with no graphical updates except for the keypress stuff), recording all of that info in a second copy of the arrays/types, and then finally repeating the run through of the turn, with results and graphical updates.

This whole structure is very similar to a "replay" function, and I was wondering if anyone had made replays work without taking up a huge amount of memory (for the multiple copies of data)? Would I be better off creating a swap-file on the hard drive instead of keeping all of the info in memory?

Any advice would be welcome. This is the largest project I've attempted so far (I'm hoping to release a techdemo... with my crappy programmer's graphics... at some point, just to gauge if the concept would actually be "fun" to play), and I'm stumped at how to do this without creating 3 full copies of all of the data for a level (and each level might contain 30-40 "actors" that would have to be stored...).

Any brainstorms or advice from folks would be greatly appreciated...


ImaginaryHuman(Posted 2006) [#2]
Can you cut down the amount of data you have to record by using some kind of `codes` that represent particular activities, and then also store the `results` of the actions rather than everything needed to replay the whole thing?


The r0nin(Posted 2006) [#3]
Hmmm. That's a good idea. The main thing I'm worried about is the actual movements of the units to different locations. Since the player might only have line-of-sight for a brief moment on the first run through, I'd like for the same to be true in the results phase (so I don't have the player shooting through walls, etc)...


tonyg(Posted 2006) [#4]
Not sure if this helps


The r0nin(Posted 2006) [#5]
Actaully, that's very helpful! Thanks!

Now I just need to figure whether to use types and lists to store the actor-states or whether to use arrays of types. I'm not sure the memory footprint/speed of either.

Actually, I think I'm going to have to take the design of this back to the drawing board, until I can get some of the components working independantly. Just getting the plotted movement and the playback working will be a good start...