Kicking Doors Down
I added some new functionality today which expands on the doors, again. I promise I’ll shut up about these soon.
Previously I had no AI Action to handle bashing down doors. This has been added, as well as the Door behavior being configurable per NPC. This means all Infected can try to bash down doors and all human characters will just open them (if they aren’t locked)
Technically this AI is ‘kicking’ the door open, although indirectly. Rather than drawing a trace from the AI’s foot direction, we are just sending the Kick Damage type directly to the door when required. This removes the need to have to add any complexity into such a simple AI action and avoids any issues where the AI or Animation is not hitting the door correctly and results in the AI never being able to open the door. For now, I think shortcuts like these are fine.
So why do I keep going on about doors like it’s the best thing since sliced bread? Well, the AI is responding to an AI Action that comes from when trying to interact with doors. This AI action is given to the NPC and the NPC is then responsible for identifying what to do with it and how to use it. Expanding this going forward will allow more AI Actions such as climbing through windows and more.
I don’t intend to add this kind of feature yet, but I may play around and test out the system in different scenarios to try to identify possible issues, bugs and other things whilst it is still in its infancy. A few fixes now may save a lot of bugs later.
I may try to use some AI Actions for Idle behavior. The AI is free to wander around currently but it has no world knowledge or desire to do anything other than roam. I’d like to possibly define a list of idle behavior for Infected enemies so that they can randomly decide to do things like:
- Lean against walls
- Lay down on the floor / objects
Obviously I am taking a page out of the Left4Dead book here
I most likely won’t get these things added just yet, but I may do a few tests to see that we can move to locations, play animations etc as a proof of concept. I probably won’t have anything to show you for these. I still have a lot of AI work to do, it won’t be perfect but it just needs to work within the confines of the play area so that the demo is not empty and boring.