The heuristic function I used wasn't very good at that point, and I'm fairly certain my A* implementation had a bug or two at this stage, so the NPC gets stuck even in places he shouldn't. But, overall, it worked. I later got the point where I could do RTS-style click-and-command control over the NPC.
Made me think, if I kept the level design relatively sane, I could probably create reasonably competent AI allies. But just having allies is a bit boring if they're all the same. So I figured the best thing to do about that is to give them different abilities and equipment affinities, so switching between them to approach various problems would makes sense.
My current line of thinking is having three different classes:
- A ninja/acrobat style character that can double-jump, blink, and relies mainly on mobility, for closing up and sniping high value monsters.
- An engineer that can summon turrets, robots, UAVs, whatever on cooldown.
- A heavy weapons guy that relies on equipment such as grenades, rocket launchers, flame throwers, mainly acting as crowd control.
That's still just vague designs at this point. What I do have, however, is the ability to control a team of characters that all look exactly the same, with an AI that is mildly frustrating at points. And items, equipment slots, and some stats.
Although for this to work out I need more monster diversification. Right now I have melee zombies. That's it. And that's just a matter of killing them faster than they walk. Not very fun.
Adding equipment and an inventory drove the need to develop a menu system. It's still pretty crude, but mostly functional.
So without further ado, here's two game play videos, one where the AI plays relatively nice, and one where it doesn't...
As you can no doubt see, the ladders pose serious trouble for my NPCs. Should be reasonably fixable though. It's not something I've spent a lot of time working on yet. I may or may not have to add "Creepy Watson"-teleportation as well.
In closing, this week I also re-learned the lesson that one shouldn't write C++ code when tired. The code will be incredibly buggy, and you will spend twice as long fixing the mess...