Notes

Mud Lurker: Building a 3D Game With AI

How I built Mud Lurker, a 3D squad shooter that runs in your browser, with AI, and why getting it to play well on a phone was still the hard part.

Mud Lurker: Building a 3D Game With AI
Adam Jackson 4 min readaigames

My first two games were both cricket. Mud Lurker is the first that isn't, and it's a much bigger step: a 3D squad shooter in a flooding jungle.

It's also the clearest example I have of the gap between how fast AI can get you to a working game, and how much work is left after that.

What it is

You lead five men through a jungle against a militia dug in on the far bank of a river. One hit kills anyone, them and you. The river starts small, then the banks burst and the water only ever comes in. Get whoever's left to the boat. The ones who don't make it get their names read out, and the next five come up from the reserve.

The reference point was Cannon Fodder on the Amiga. It's built with three.js and about 11,000 lines of TypeScript, with a retro pixel finish. The whole game is 5.8 MB.

Where AI made the difference

Going from 2D cricket to a 3D shooter is a big jump. There's a camera, a terrain, water, a squad that moves together, enemies that fire back. A few years ago a project like this would have been a long stretch of evenings and weekends before anything was playable.

AI changed that. It got me to a working version far faster than I could have managed on my own. Setting up a 3D scene, moving units across terrain, handling clicks and taps, all of that is well-trodden ground, and AI handles well-trodden ground very quickly.

Where it didn't

A working 3D game in a browser is one thing. A 3D game that runs smoothly on a phone is another. Phones have less power, smaller screens and fingers instead of a mouse. Getting Mud Lurker to play properly on one is the kind of work AI doesn't do for you, because the problem isn't writing code. It's noticing that something feels sluggish or awkward on a real device and working out why.

Then there's the design. "One hit kills anyone" can feel tense or it can feel unfair. The difference is in a lot of small decisions about how enemies behave, how much warning you get and how the squad moves. AI will happily build any version you describe. It has no feel for which one is good.

That's why I keep saying the same thing: AI speeds up the build, but quality is still hard. Mud Lurker is where I felt that most.

Controls on two kinds of device

On a computer, left click to walk your squad and hold right click or Space to fire at the reticle. On a phone, tap to walk and use the firing zone in the corner of the screen.

Designing controls twice for one game is a good lesson for websites too. A page that works with a mouse isn't automatically a page that works with a thumb. Most of your customers are on a phone, so that's where the testing has to happen.

The same base underneath

Mud Lurker is the third game I've built on the same foundation as Ton Up Cricket, even though it looks nothing like it. That shared base, and the player each game runs in on my site, is what lets me put out new work quickly without starting from nothing every time. If you want the earlier part of the story, start with why a web developer builds games and building Ton Up Cricket Zombies Edition with AI.

I use the same approach on client work, and I've set it out on my AI-powered build method page.

Have a go

Mud Lurker is free in your browser with no login, on phone and desktop. It's a shooter, so it's better suited to older players.

If you want something built with the same care, get in touch. I'll convert your existing site to HD CMS for free, then it's £20 a month for hosting and updates.

Related reading

AI for business →