Sign in to follow this  
Anddos

Recording sprite movement

Recommended Posts

"Best" could have a lot of meanings, depending on your exact scenario the best scenario could be different.

That being said...

If your game is 100% deterministic you should be able to just record the input button changes and the time/frame they occur into an array and then play them back later.

If your game isn't perfectly deterministic, you could record player and spawned enemy position and movement information for every frame, as well as storing events (i.e. animation changes, deaths, spawns, etc) as applicable.

If your game isn't written in a way that you can store and reenact event triggers you could either fix that, or you could save everything each frame -- including camera position (i.e. screen offset in to your 'map') visible player/enemy locations and texture ids. This is expensive (basically saving a complete render list every frame), but would work.

There are lots of spots in between, and completely different techniques, but hopefully that should get you started finding the right solution for your game.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this