Improbable Icon

How To: Position and movement optimisation

how-to
best-practice

#1

Hello everyone,

Following up on some of the content that was presented at our GDC booth this year I’ve convinced our very own @callumb to share his thoughts on the subject of optimising both position and movement in your SpatialOS games.

You can find the corresponding slide-deck here, and these are his very own thoughts about these technical insights:


This is a talk I ran at our booth at GDC.

The point I was trying to drive home is that everything you know as a game developer about optimization still applies to SpatialOS. Yes, some of what we do feels like magic - but the same rules still apply.

I went with a curve ball analogy: optimization is like climbing a mountain. Except you don’t want to get to the top…because that’s a 0 byte executable that doesn’t make any money! Our goal is to get as high as we need for the view we want.

I hope you find the slides useful; if you have any follow up questions - hit me up!


What insights have you had yourself while working on this topic? Did you use a similar approach or a completely different one? So come and share your thoughts! Both @callumb and me are looking forward to learn what you have discovered on your side.

Duco


Deep Dive: Worker Authority
#3

Remember that optimization always come with a price… adaptability.


#4

Very true @SionoiS. Do you have any particular thoughts or things that you encountered yourself on the topic of position and movement optimisation?


#5

Nothing that hasn’t been explained better by someone else I’m afraid :stuck_out_tongue:

Number 1 for me is Thing outside the box.
#2 Math is your friend.

Tips:

  • Exponentially smoothed moving averages are very simple and useful for movements
  • Think down to the bits!
  • Always think “high context”, the more you assume the simpler the message can be.

#6

I would add, wherever possible, try to get the client doing as much as possible on their own. For example, in an RPG, a seed value could be synced between client/server and then used to allow NPCs nearby a player to be entirely simulated by the client, with the server doing periodic sanity checks and syncs when needed. Imagining that this is possible in your own game, very large amounts of positioning/movement… data does not even need to be sent from server to client.

In this way, depending on what game you are building, a LOT can be gotten away with.

Of course, nothing the client simulates is actually authoritative, and if they “go off script” so to speak, the server’s state is used to snap things back into place. A “best guess” is usually good enough.

One other thing to be careful of is keeping in mind the capabilities of player characters in your game, and molding things based on that. Of course if you are running an FPS where bullets are hit-scan or extremely fast, it may be preferable to not even bother sending the actual position of the bullets/projectiles. There are many, many potential opportunities for optimization like this and of course it’s highly dependent on the specific game and systems you are building.

Great slide deck/presentation by the way.