Git Product home page Git Product logo

Comments (6)

a327ex avatar a327ex commented on May 15, 2024 2

@TimelyToga Hey, glad you liked the post. And yea, that seems like a good idea that I hadn't considered. The optimization steps I worked on only dealt with not saving static objects over and over, and that about halved the replay size from 10mb to 5mb per 10s. But it seems like your idea would be something much better to try and maybe then I can get replays to a reasonable size even with this technique. Thanks for the advice!

from blog.

TimelyToga avatar TimelyToga commented on May 15, 2024 1

Very well-written post! I enjoyed it a lot and am thankful that you took the time to write it.

I do have a suggestion for maybe reducing the filesize of the files that you make when creating replays. Instead of storing all the state every frame in your ReplayObjects, I would suggest dividing this load into two different sets. ReplayGameState and ReplayGameStateUpdate objects. The first to be essentially a mirror of the objects used in your post, while the second are just the deltas between frames. So when you initialize a new enemy / player / item for use to replay, you store all relevant character data, but in the requisite frames after that, you merely provide the fields that changed since the previous frame. Most likely the entity's x and y coordinates will change every frame, but their health and Layer won't necessarily change every frame (in the case of health) or potentially over the duration of the replay (in the case of Layer).

At any rate, thanks again!

from blog.

Yonaba avatar Yonaba commented on May 15, 2024

@adonaac, very good post and very learningful. I was about to suggest something the same enhancement @TimelyToga mentionned. But anyway, very good post, as usual. I am sharing this on #gamedev. Keep it up!

from blog.

MarvelWild avatar MarvelWild commented on May 15, 2024

Thanks for great articles.
Link is broken: https://github.com/adonaac/ld34

from blog.

lpgaming avatar lpgaming commented on May 15, 2024

I really appreciate you writing this article. There is a lot to think about here. Thank you.

from blog.

gingerbeardman avatar gingerbeardman commented on May 15, 2024

Interesting post! Thanks.

I'm working with Lua on Playdate, which is a low powered embedded device. Memory and CPU is a concern. In my game I have a fixed number of objects in each level that mostly stay still, and my system is completely deterministic. I'll look into recording and playing back inputs!

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.