Jump to content
  • Advertisement
Sign in to follow this  
Anddos

Recording sprite movement

This topic is 3156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

so i have a little sprite game and want to record every movement position of the player , what would be the best solution?

Share this post


Link to post
Share on other sites
Advertisement
"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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!