Today I worked on improving the enemy behavior system. Yesterday I implemented a scripting system for enemies, but this is only half of the battle – enemies need to be able to respond to external (and even internal) stimuli that can override the basic scripting system. Otherwise enemies are mindless and just move in set patterns.
Figuring out how to create this second half of the system was hard at first, but I eventually came to a solution after fighting with the C# language a bit.
To test it out, I implemented a basic “sight box” that can be customized for each enemy. Then I hooked that to my new script override trigger system and now enemies will light up and start to follow you if they see you.
I plan to use this trigger system to implement more complex behaviors down the line. Not every enemy will make use of this sight system – it’d make things insanely tough! But I do hope to make it so enemies can act and react in interesting ways. It’d be a cinch to add stuff like what they do in Metal Gear Solid, in fact. Stuff like seeing footprints, stuff like that. I don’t think I’m going to go quite THAT far, though
But it’s neat to be implementing something that’s at least akin to what the Metal Gear games use.
Download


Can they see through walls? The video wasn’t really clear on that.
Yeah. It might be a lot of work to implement blocked line of sight, so I’m not sure if I want to mess with it yet or not.
Oh, okay. Just wondering.