Hacker News new | ask | show | jobs
by holografix 1475 days ago
This is very cool and reminds me of Ultima Online!

What is the most expensive part of the game loop in terms of processing time?

1 comments

It's worth saying that, by far, most of the processor time goes towards the networking (serializing, compressing, sending, receiving).

Specifically with the game loop though, the interest management system takes the most time, with the movement system close behind. The interest management system uses a spatial partitioning grid (the "EntityLocator") to efficiently build lists of what entities are in range of each client entity. The movement system moves entities while enforcing a (currently very simple) collision check.

With 1000 clients connected, the interest management system averages around 600us per run, and the movement system around 450us (measured using Tracy). The server runs at 30 ticks per second, so the simulation loop has to fit within a 33ms deadline each tick.