Then There Was Fire
Power of the Deadline
Once the second week of #vibejam was announced, I knew I was cooked, and had to implement multiplayer.
I was naive about how much work it would take, even with LLMs on my side.
The main issue was breaking out the physics logic from the client and moving it to the server.
Keeping cannon animation on the frontend consistent with the physics on the backend was a challenge.
You don’t want cannonballs hitting water but counting as hits on an enemy ship.
Once the basics were working, I spent a bit of time optimising the server.
The game worked well in multiplayer, you could fire cannons, accurately hit opponents, and die when taking too much damage.
But after a few minutes of gameplay, the server started getting laggy.
At first, I thought it was the link between the Vercel instance and the AWS server running the backend.
It wasn’t.
Turned out ships and cannonballs weren’t getting recycled.
Each cannonball fired would stay in the world and keep getting refreshed with every game loop.
Once that was sorted, the game was ready to submit.
On Coding with LLMs
We’re in a very exciting time to be a software developer.
Everyone becomes a 10x developer. We can build so much, so fast.
The giants, Zoom, HubSpot, Slack, will be challenged by companies with better products and smaller teams.
Smaller teams means less bureaucracy. Faster iterations. Happier customers.
On Cursor
What a tool, but it had its days where it just didn’t work.
I was trying to use the Claude 3.7 model and it would just spin in circles.
I think Cursor is a fantastic IDE.
Shame it’s based on VS Code. I never liked VS.
It’s a bit flimsy, shortcuts don’t work at all times, terminal command history gets wiped each time you reopen it.
You can’t even copy files directly from the project explorer.
That said, Cursor’s ability to take in multiple files as context and edit code in the right way is amazing.
I wouldn’t have been able to produce this game in such a short time without it.
On Vercel
Did you know you can't run websockets on a Vercel server?
I didn’t.
This forced me to spin up an AWS instance just to handle multiplayer connections.
One more unexpected detour, but that’s the game.
On Building With a Deadline
If #vibejam didn’t have a deadline, the game would never have been multiplayer-ready.
I stayed up all night before submission day to get it working.
This makes me think I should set deadlines for other projects too.
But setting a deadline alone isn’t enough.
The problem is there’s no punishment if you miss a self-imposed deadline.
With #vibejam, if you missed the deadline, you missed the competition.
How can I put myself on the hook for a self-imposed deadline?
© 2024 getwebwizard blog. No rights reserved. Sharing is caring.