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

https://hackernoon.imgix.net/images/CmMFflnGv3RIrJY7qc4GQFBQtxW2-c883fs5.png

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 itselfto survive. No scripted behavior. No designer telling it "if a bullet is near, move away." Just a neural network, a reward signal,...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more