I Taught a Stick-Figure NPC to Dodge Bullets With a Neural Network I Wrote From Scratch

The NPCs in your favorite games are (mostly) faking it Most game "AI" is a lie, and a good one. The guard who flanks you, the boss who dodges your attacks, the enemy that seems to read your mind, and almost all of it is a decision tree, a finite state machine, or a pile of if statements a designer hand-tuned over months. It works. It shipped Halo and Half-Life and a thousand others. But it doesn't learn. The enemy that flanks you on level one flanks you exactly the same way on level fifty, because a human wrote that flank by hand. I wanted to see what it takes to build the other kind, an NPC that starts out completely useless and teaches itself to survive. No scripted behavior. No designer
…