p2p multiplayer architecture in gdevelop
P2P networking works well for small co-op indie games using tick loops, JSON packet relays, and authoritative host overrides.
- A client can serialize positions and states into JSON packets at 30 ticks per second and relay them through the host
- Hosts can validate incoming client data to kick hackers and periodically broadcast authoritative packets every 3 to 5 seconds to fix desync
- Running AI directly on the host machine and synchronizing positions avoids complex networked enemy calculations across clients
- Small co-op projects avoid server costs and heavy anticheat burdens, unlike competitive multiplayer or MMO games
- P2P exposes player IP addresses, making private lobbies or in-game warnings recommended when joining games with strangers


