Implementation of a udp network game

Hi! I have made a small network game using msgpack to encode the udp network packets as binary data. I had to make some changes to msgpack.lua to support userdata such as vec3 and color.

Try to click on the moving space ships :slight_smile:

You can try it out by selecting ”host game” on one device and ”connect” on another on the same local network. The client broadcasts subscribe messages until it starts receiving data from the host. Touch events are sent from the client to the host to handle.

It’s much easier to win when you are the host. The code doesn’t handle different screen sizes yet, so start the host on the device with the smallest screen :slight_smile:

The game logic is done with a ecs - entity component system, so that all components can be sent over the network. Currently it sends the whole game state, so it can be much improved :). Currently lagging a lot :slight_smile:

Tnlogy.zip (5.9 KB)

1 Like