Destroy the enemy and capture all tiles! Beware however, as newly spawning enemies will emit a shockwave that convince any nearby units to its cause!
To move around, point the cursor at any location inside the window and press the left mouse button to fire.
This a small game I made in 5 days with Godot. The main goal was to make a networked game as quickly as possible. I decided to settle on a "battle royale" in the browser because it gave me 3 challenges:
- I had to optimize for a web browser, which tend to be a lot slower than native games.
- I had to optimize the bandwidth
- I had to make the game look smooth despite having a low tick rate (the server only updates 10 times per second!)
Making the game look smooth turned out to be even harder than I assumed: I thought that simply interpolating between each state would be enough but there is still stutter that I haven't managed to fix. I'm still satisfied with the end result since I gave myself only a short time frame to finish this project.
Originally I was going to use WebRTC so that I could use UDP but I ended using WebSockets (TCP) as it greatly simplified synchronizing the game state. The server only needs to send the state of the tiles at the start of each connection. After that, it only needs to send the state of each unit. It does mean the game suffers from head-of-line blocking, which can increase latency and thus cause stutters.
I intended to have a tickrate of 60 updates per second, but the server couldn't keep up with ~100 units it so I kept lowering it until there was plenty of breathing room. Then I lowered it even further to see at what point the latency becomes insufferably high. This turned out to be roughly ~100ms, or a tickrate of 10.
As I can't guarantee there will always be players online I added a very basic AI which simply drives towards the nearest unit in a certain range and shoots at it.
There is a fullscreen mode (F11) but I don't recommend it as it's much more performance-intensive.
- Units do not always get despawned on the client side (seems to happen when the browser loses focus)
Pok pok, this is the magical chicken
Leave a comment
Log in with itch.io to leave a comment.