Using AI to build a tactical shooter
Enemy AI
My latest side project is a 2D shooter where the enemies plan their attacks. I’m using a technique called Goal Oriented Action Planning. This approach was used in an old game from the 2000s called F.E.A.R. It was a sort of spooky tactical shooter. Think Rainbow Six but with that creepy girl from The Ring hanging about the place. In FEAR, the enemies could flank the player and provide suppressing fire. They could stay in cover and coordinate with each other.
More side projects with AI-augmented programming
Why am I making this? It seemed like it would be fun to try a structurally simple 2D game with tricky enemy AI.
In the age of programming with AI, it’s much easier to follow this kind of whimsy. I’m more productive and I can get to the interesting stuff more quickly.
Productivity hack
You know that film with Bradley Cooper*, where he takes a drug that makes him super focused and productive, but he ends up ruining his life? Well, I’ve found something similar.
Livestreaming.
If you want to trade some of your lifespan and peace of mind for some productivity, just record yourself working. It’s quite stressful. You’re worried about making blunders in front of other people. You can’t take breaks. You definitely can’t start scrolling X.
But you will get a lot done.
Game tape
Everyone’s eternally wanking on about Camp 4†. I wasn’t there, but I think X might have it bested. It’s awash in scenius. The field or tradecraft of AI-augmented programming is proceeding so unbelievably fast. And the best place to learn about it is in ephemera and asides crammed into tiny boxes dispensed by a misfiring slot machine.
So, here is a contribution to the effluvial stream. A video of me working on the 2D shooter. You can see me plan out the project and generate the code that lays out the level, implements player movement, and implements collision detection. Pretty good for an hour and fifteen minutes.
Though extemporaneous, the video outlines a powerful AI-augmented workflow for writing software -
- Plan and iterate on the plan§ with AI, solving many design problems at the spec stage.
- Get the AI to implement the first milestone (often as a one-shot).
- Check off the milestone and move to the next one.
Some of the techniques I demonstrate -
- Using voice-to-text to prompt the LLM. Much faster than typing.
- Staying in flow by using voice and Cursor Agent mode. One UI that lets me plan, refine and generate code. No stitching together tools or copy/pasting.
- Using the AI as a rubber duck to think through problems.
- Also using the AI as a thought partner to come up with better solutions.
- Asking the AI technical questions (e.g. on ECS architecture idioms).
- Keeping the spec short and dense for easy manipulation and scanning.
- Avoiding unnecessary abstraction, but also defining a robust architecture to keep the project extensible.
- Using popular technical approaches (ECS, SAT collisions) to ensure a robust approach and also make it easier for the AI to one-shot correct implementations.
* Limitless is not a very good film. But if you like Bradley and like good films, definitely watch The Place Beyond the Pines. My Dad and I saw it a continent apart - him in England and me living in New York - and we still talk about it.
† Rock climbing scenius at Camp 4.
§ Thanks to Geoffrey for teaching me this!
Subscribe to my newsletter to hear about my latest work