Hello there! It’s Dennis, the AI programmer here again. It’s been a while since I last wrote something so I have been able to get lots of things done. I will focus on the fear of light and talk about the rest briefly.
Fear of light
Detecting if an object actually receives light from light components in the engine wasn’t something that could be done easily. It would’ve been very accurate and fair to detect light that way, but I had to go the simple way and just use trigger colliders. It has both ups and downs; I have more control of where it is able to get scared but the triggers must be sized manually to match the light.
The original plan was to make the AI run away when it has been exposed to light for too long, but I couldn’t find a good way to detect where it should run. I Also needed to save time since there isn’t much time left of development, so I simply made the AI stay on place and be stunned for a while.

The AI adapts to light. Each time it gets stunned, it’s resistance to light is increased. This challenges the player to not rely to the flashlight too much and try to find different ways to play. The AI will also get less resistant to light if it hasn’t been stunned for some time.
I also made interactable lamps that the player can switch on and off. The lamps, which should be very simple objects, probably caused me the biggest problems so far for me. To make the AI avoid lit lamps, I wanted to break the nav mesh so it couldn’t be able to go there at all. Breaking the nav mesh in the right way was what took a long time. There wasn’t a good way to break the nav mesh with a sphere shape, it would always break it with the shape of a box for some interesting and stupid reason. A very bad solution to this was to attach Nav Modifiers to each of placed lamps in the maps. The modifiers could be shaped as cylinders and the nav mesh would actually be broken as cylinders. I also had to make sure that the attached modifiers would be activated/deactivated when the lamp would be switched on/off.
Another problem was that the AI could get stuck when the lamp was lit if its goal was within the broken mesh. It couldn’t find any way to the goal if both AI and its destination was outside of the nav mesh. To solve this, I made a new type of path node that the AI will walk to when inside the lamp trigger. These need to be set manually to make sure that they are inside the nav mesh.
I’m not very happy with the result of the lamps, but the result works. The problem is that you have to make adjustments to each lamp you place which is very annoying and takes much time.

Suspiciousness
Before, the AI would always search at least one hiding spot in each room. Now, the AI will only search if it is suspicious. This works the way I described it in my last devlog post with some tweaks. If the AI hears a noise, the suspiciousness will be low. If the player is seen, it will be medium. When the player is found inside a hiding spot, the AI know that the player actually hides in spots so the suspiciousness will be at its maximum. The suspiciousness will reduce for each failed search attempt.
Other stuff
I made the tweaks that was required and the others were happy with them. It is now easier to build paths for the AI which can speed up development of levels a little bit. It could be improved even more by adding editor graphics like lines between path nodes so that you can actually see where it will go.
The AI character now also has an actual model and some nice looking animations that Erik got us. The enemy is now somewhat scary and looks way better than that ugly cylinder I made. Not only has it graphics, it has sounds and voice acting. I acted as a voice actor and recorded lines that indicates reactions of the AI so the player better knows what it thinks and is about to do.
We had a play test last week with people in class and others invited to the school. It was very stressful before it because we encountered some last minute bugs that could ruin the experience completely. We managed to fix everything in time and the test went smoothly. The testers gave us some good feedback and didn’t find any new bugs.
What’s next?
We only have a week left of development so we can’t add much new stuff. The remaining time we have will be dedicated to finish what’s already in progress, fix bugs and add some more polish. We also have reports to write and a presentation of our achievements to prepare for so we’ll see how much more we can do with the game.
Next time I will mostly write about how I feel about the result of the game. I will also discuss what we didn’t have time for and what a finished product could have looked like. There are quite a few things that I wanted to have done during these weeks so stay tuned until next time!
0 comments