Home > Infiniverse News Feed, Planet Roguelike > Massive changes in networking

Massive changes in networking

Source: Infiniverse News Feed

Today I branched both the client and the server and started to make some fundamental changes to the communication between them. Although my previous protocol improvements at least halved the bandwidth requirements, I can now see that I can do much better. For example, the coordinates of other players are currently sent as two integers, whereas on the new branch they are only two byte deltas to the client players position. I also decided to limit the maximum number of connected players to around 250 (like I'll ever get even 20 simultaneous players), which allows me to use a single byte id with each player. These things bring a position update packet size down dramatically. Also, by using single bytes wherever possible, I can get the data from a stream/string easily with the pointer index operator [], without the need to perform memcpy's.

In addition, the server itself sees some drastic architectural changes and the communication style is switched from an event based to take place at more regular intervals. Furthermore, I plan to finally make the switch from TCP to UDP, which might bring some further speed to the communication.

These things are a lot of work (and packing/unpacking bytes for transmission isn't very pleasant), but I find them essential. I'll keep you posted on the progress.
  1. No comments yet.
  1. No trackbacks yet.