Monday, May 6, 2013

A little AI work

Over the past few days much of my time has been spent improving NPC movement behavior. Here is a video showing a flying NPC that is forced to navigate around some blocks in order to get somewhere it could attack the player.
This video also shows a few problems with the way the character is moving around, which have since been fixed as part of this work. I like to show the buggy stuff sometimes so people can get a sense of the kinds of weird things we have to deal with when making games. It doesn't generally just show up on screen working as we would like it to, usually it's an iterative process as we figure out why our first take on sometime only got us part of the way (hopefully most of the way) there.

This next video shows a bunch of ground NPCs trying to get into melee range of the player. It's a bit of a load test where I just spammed the debug key to spawn a bunch of them. The main thing I was testing was how they behave with some new code that causes them to separate instead of overlapping the same space.

Prior to this change, a swarm like this would pretty much stand right next to the player with so much overlap going on it would look like one giant unbelievably buggy mess.