Git Product home page Git Product logo

Comments (2)

jondubois avatar jondubois commented on May 18, 2024

@Poea Could you give more details please?

You may get items disappearing on the map if your front end doesn't receive updated data for a while.
That can happen if your WORLD_UPDATE_INTERVAL is too low and the cell processing takes longer than the update interval (the CPU can become congested).

If this happens, you may want to make the WORLD_UPDATE_INTERVAL higher. The default 20ms is actually really low/fast (it's 50 times per second), 40ms is more reasonable (and most games seem to update at that rate since bandwidth can be expensive anyway); if you find the 40ms interval to be too 'choppy', you may want to add some sort of motion smoothing/interpolation on the front-end to smooth things out.

Having a longer interval duration allows you to perform more processing without overwhelming the CPU.

Another solution if you don't want to increase the WORLD_UPDATE_INTERVAL, is to make the cells in your grid smaller (see this) - With more smaller cells, each cell will cover less area and will have fewer items/states to process so it means that it can process them faster (and, therefore, it will be able to keep up with the low WORLD_UPDATE_INTERVAL).

from iogrid.

Poea avatar Poea commented on May 18, 2024

i'll take a look into client side interpolation

from iogrid.

Related Issues (10)

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.