How I Built a Multiplayer Game from Scratch with AI (Without Being a Game Developer)
What I Learned from Vibe Coding and Letting AI Do the Heavy Lifting
Have you used Cursor AI? If not, you should do it ASAP. I used Cursor along with Claude Sonnet, switching between models 3.5, 3.7, Thinking, and sometimes Max, to create the game I will present to you in this post.
Creating a game was not an easy task, and I see a lot of posts from people having similar issues to the ones I had. I got so frustrated with the AI many times during the process, but I realized that I was the cause of the problem.
To start the process, I asked the AI to create a game where opponents could share the same map, inspired somewhat by League of Legends, with additional influences from Tibia and other MMORPGs.
My first goal was to be able to walk around the map with my character. This was my first commit, the one I called Genesis:
Then, I started improving the graphics and adding UI elements like health bars, mana, experience, etc.:
I also asked it to add a model for the player, and an initial temple for the game:
My biggest mistake was blindly asking the AI to add everything I wanted, without questioning its approach. Also, I did not have enough experience with games, so I did not know what a server-authority game was or the requirements for a multiplayer game. I learned this by creating the game and talking to the AI.
Lessons Learned
At the beginning, I noticed I was facing a lot of repeated (regressive) bugs. I would request a feature, and the AI would implement it, but remove something else from the game in the process.
At one point, I realized that I had a 3,000-line monolithic codebase for a game that wasn’t even playable yet and was full of issues.
Then, I started to learn about what a Server Authority Game was! Do you know what it is? It is something necessary for a multiplayer game. Let's say you have a client and a server, so you need to make sure the important decisions of the game, like gaining experience, dealing damage, updating status, etc., are made on the server side. This way, you eliminate a lot of hacking possibilities.
In a server-authority game, the client will request the server to damage another player, to gain experience from killing a monster, and only if the server approves it, can that operation be done. This prevents people from changing the code on the client side and multiplying experience gained from monsters, etc.
Refactoring with AI
So, what did I do with the monolithic code that also didn’t have server authority? I started refactoring the code with AI’s help.
I asked the AI to restructure the game into modular components without code duplication. However, even with this request, the AI struggled with refactoring; it would delete files and old code to "clean up," but in doing so, it lost context for future refactorings, using the refactored code as a reference to the old game, turning everything into a mess. To avoid the loss of context, I created a separate folder inside my project containing the original monolithic code and used it as a "source of truth" for the refactoring process.
I then started asking the AI: "Please refactor our monolithic game into a modular game without code duplication. Use the old.src folder as a reference to understand how the monolithic game worked. Make sure we do not have duplicated code, make sure we follow a server-authority game, and make sure it has modular code."
This helped a lot! In the end, the problem was ME. I was not being specific enough. And it reminded me of product professionals I have worked with in my life who used to do the same with developers!
Because of this simple issue, I lost an entire weekend refactoring, and I still have things to clean up today. Also, some of my "modular components" became "monolithic modules", for example, skill files need to be split into multiple smaller files for each skill, but for the current MVP, I left them as they are.
Security Issues
Another thing I am realizing on the internet is that many people who have no idea about programming and also no idea about product development are trying to create software with AI’s help. They just ask the AI to create the software, with no knowledge of server/client, networking, security, etc. There was a guy who was celebrating that he could create his company without programmers in one day, but three days later, he was complaining that people hacked his software. The irony of this case? He might have been safe if he had asked the AI to run a vulnerability check by asking something like: "Can you run a vulnerability check on our code to see if we have any risks of releasing this software for exploiters and hackers?" I did this and also asked AI to help me configure a CDN.
It was my first time using a CDN. Before, I learned what it was by studying system design, but I never had the chance to use/configure one. One more thing I learned by creating a game during my free/fun time!
About the MVP...
I’ve suffered a lot in my career because of the disaster called MVP (Minimum Viable Product).
I’ve worked with multiple product owners and managers who always wanted to release an MVP into production, but their version of an MVP was always something broken, low-quality, and frustrating for users instead of something they would actually enjoy using.
So, in my mind, I decided I would only release my game when it reached a point where the user experience was at least minimally enjoyable. I spent 3 weeks working in something minimum acceptable, and the only reason I released it was to enter a game jam that was happening during the release date. If I did not have the rush to release, I would wait a bit more to have more features on the initial MVP.
Right now, you can enter the game, level up, and try to defeat the boss Typhon, a very strong enemy that one-shots level 1 players. You need to level up your character to stand a chance against him. I eliminated multiple nice to have features and thought about creating a fun challenge for the players: level up to kill a very strong boss.
Instead of an MVP (Minimum Viable Product), I prefer an MLP (Minimum Lovable Product). In the case of the game, it’s an MLG (Minimum Lovable Game). =D
Next Steps
I deployed the game to production, had 5 players online at the same time, and collected feedback about the game experience, bugs, and feature requests.
I heard the users' pain and also asked them what they enjoyed while playing the game, and now I know what I have to work on for the following MVPs.
Also, I have some technical debt that only I know exists. I need to prioritize a backlog of work to determine what will keep players playing the game and, at the same time, think about removing technical debt that could affect the maintenance of the game, to avoid another headache like the monolith refactor I mentioned before.
It is not only about Software
So, creating a game or even creating another type of software is not only about adding code to your repository. You need to learn multiple disciplines. You also need to learn product development, the software development lifecycle, and clear communication to talk to the coders (AI in this case) and collect feedback from the users.
I received this image from someone when talking about this game. I would also add other areas to the Pre-AI, which are: QA, Sec, Ops, and Marketing. I see a future of Product Generalists, or as I heard from YCombinator: Product Engineers.
If you want to know more about the Game, here is the landing page of my game:
That was my longest post ever. I hope you liked it, and I thank you for reading until the end. Enjoy your journey in your Post-AI life!