How a simple idea turned into an obsession, and what building AI opponents taught me about patience
The Itch That Started It All
It was a random Tuesday night when I tried to play a simple browser game. You know the drill: click a link, wait for the page to load, get hit with a pop-up asking me to download their app, another one wanting my email, and finally a third one begging me to disable my ad blocker.
By the time I closed all those modals, I'd lost interest.
That frustration planted a seed: What if browser games could just... work? Click and play. No downloads. No sign-ups. No nonsense.
one week later, that seed grew into InstantGames.top — a collection of 17 handcrafted browser games that load in under two seconds.
This is the story of how it happened, the problems I didn't expect, and why teaching a computer to play Gomoku almost drove me crazy.
Teaching a Machine to Think: The Gomoku AI Adventure
Of all the games I built, Gomoku (Five in a Row) was the one that humbled me the most.
The rules are simple: place stones on a 15×15 board, first to get five in a row wins. A child can learn it in minutes. But building an AI opponent? That's where things got interesting.
My First Attempt Was Embarrassingly Bad
I started with the most straightforward approach: have the computer check every possible move and pick the best one. The problem? A 15×15 board has 225 intersections. After just a few moves, the number of possible games explodes into the billions. My initial AI would sit there "thinking" forever, spinning the browser into oblivion.
I needed a smarter approach.
Enter Monte Carlo Tree Search
After weeks of research and many failed experiments, I discovered MCTS — Monte Carlo Tree Search. It's the same algorithm that powers the AI in games like Go, where the search space is absolutely massive.
The beautiful thing about MCTS is that it doesn't try to analyze everything. Instead, it plays thousands of random games in its head, keeping track of which moves lead to wins most often. It's like asking a thousand versions of yourself to play quick games and then averaging their advice.
The "aha moment" came when I finally got it working. I placed a stone, and after a brief pause, the AI responded with a genuinely clever move. Not just blocking my obvious threat, but setting up a counter-attack I hadn't anticipated.
I lost that game. To my own creation. And I couldn't stop smiling.
The Three Difficulty Levels
Eventually, I tuned the AI into three personalities:
Easy mode plays like someone learning the game — it sees obvious moves but misses subtle traps. Perfect for beginners who want to feel the joy of winning while learning.
Medium mode is the sweet spot for most players — challenging enough to keep you engaged, forgiving enough to let you recover from mistakes.
Hard mode is... humbling. It runs 15,000 simulations before each move, thinking several steps ahead. I've beaten it exactly twice, and both times felt like winning the lottery.
You can challenge the AI yourself at the Gomoku game. Fair warning: start with Easy.
Building a Racing Game That Feels Right
While Gomoku was all about outsmarting an AI, Traffic Rider Extreme was about something more primal: speed.
I wanted to create the feeling of weaving through highway traffic at ridiculous speeds, with neon lights streaking past and your heart racing as you narrowly miss a truck.
The Physics Problem
Here's what I learned: making something "feel" fast is much harder than making something move quickly.
My first version had the motorcycle zipping across the screen at high speeds, but it felt floaty and disconnected. There was no weight, no momentum. It was like controlling a ghost.
The breakthrough came when I stopped trying to simulate realistic physics and started thinking about perceived physics. When you steer at high speed in real life, there's a delay. Your bike leans into the turn. There's a feeling of weight shifting. I added all of that — subtle, almost imperceptible delays and accelerations that your brain interprets as mass and momentum.
The result? A motorcycle that feels planted and responsive, even when you're weaving between cars at 300 km/h.
The AI Traffic That Keeps You on Your Toes
Static traffic is boring. If cars just spawn randomly, you quickly learn the patterns and the game becomes mechanical.
So I built traffic that adapts. It looks at where you are, how fast you're going, and creates interesting challenges just ahead. Not unfair surprises — you always have time to react — but moments that keep you alert.
The AI traffic also has personality. Some vehicles speed up when you try to pass them. Others drift between lanes. One type (my personal favorite) moves in convoys, creating obstacles you have to thread through like a needle.
The Autopilot Easter Egg
Here's a secret: there's an AI autopilot hidden in the game. Turn it on, and the motorcycle will navigate through traffic on its own while you watch.
I built it partly as a debugging tool, but it became something more. There's something mesmerizing about watching an AI make split-second decisions, sliding between cars with inhuman precision. It's the same algorithm that could drive a real autonomous vehicle, just applied to a neon-soaked video game motorcycle.
Try it at Traffic Rider Extreme — press the autopilot button and watch the show.
The Performance Obsession
Early in development, I learned a painful lesson: games that take too long to load never get played.
I tested early versions with friends, and the pattern was consistent. If the game didn't start within 3 seconds, they'd close the tab. They didn't complain. They didn't wait. They just... left.
This turned me into a performance obsessive.
Every Millisecond Matters
I spent weeks shaving milliseconds off my load times. Fonts were loaded asynchronously. Images were lazy-loaded. Scripts were deferred. I even delayed loading advertisements until after the user had interacted with the page — because those who never engage shouldn't have to pay the performance penalty.
The result? All 17 games now load in under 2 seconds on a decent connection. On a fast connection, they often load in under a second.
Smooth as Butter
Load time is just the beginning. Games need to feel smooth while playing.
I learned about an obscure CSS property called "contain" that tells the browser exactly how isolated a UI element is. By marking my game cards as "contained," I prevented the browser from redoing unnecessary layout calculations, which eliminated those annoying stutters during scrolling.
The games themselves run at a locked 60 frames per second. Not 59, not 61 — exactly 60. Any frame drops are immediately noticeable, especially in fast games like Traffic Rider. Achieving this consistency required careful performance profiling and sometimes ruthless cutting of fancy visual effects.
A beautiful effect that causes frame drops is worthless. Smooth always beats pretty.
The Unexpected Lessons
Looking back at a year of development, the technical lessons were expected. The personal lessons caught me by surprise.
Lesson 1: Constraints Breed Creativity
Every game had to work in a browser. No native apps, no plugins, no dependencies on specific hardware. These constraints felt limiting at first, but they forced creative solutions.
My poker game uses CSS gradients instead of image files for the card designs — this saved hundreds of kilobytes and made the game load faster. My 2048 game uses simple CSS transforms for smooth animations that work on even the oldest smartphones.
Constraints don't limit creativity; they focus it.
Lesson 2: Good Enough Is Not Good Enough
Early on, I shipped games that were "good enough." They worked. They were playable. But something was missing.
Over time, I realized that "polish" is what separates a game people play once from a game they bookmark. It's the sound effect when you place a stone. It's the screen shake when you crash. It's the way a card flips when you deal it.
None of these things are strictly necessary. All of them are essential.
Lesson 3: Players Are Smarter Than You Think
My AIs have been beaten by 8-year-olds and 80-year-olds. Players discover shortcuts I never intended. They find bugs I never imagined. They combine game mechanics in ways that break my carefully balanced systems.
And I love every bit of it. Players are creativity stress tests. They make games better by breaking them.
What's Next?
Seventeen games feels like a milestone, not a destination.
I'm currently building a Chinese Chess game with an aggressive AI that plays in a style inspired by classical masters. Online multiplayer for Gomoku is in the works. And I have a notebook full of ideas for new games that keep me up at night.
The goal remains the same as that frustrated Tuesday night: games that just work. Click and play. No nonsense.
Try Them Yourself
Everything is free at InstantGames.top.
My personal favorites:
🎯 Gomoku AI — See if you can beat Hard mode (I dare you)
🏍️ Traffic Rider Extreme — Cyberpunk racing at its finest
♠️ Midnight Poker — Texas Hold'em with attitude
🃏 Midnight Blackjack — Casino vibes, zero risk
I'd love to hear which game you tried and what you thought. The comments are open!
Thanks for reading this far. If you enjoyed the journey, a heart ❤️ would mean the world. Follow for more stories from the trenches of browser game development!




Top comments (1)
Amazing games.
By any chance the Galaxy Guardian is open source?
Thanks.