An important detail I forgot to mention last blog post is probably the most important one: How does the statemachine work in this game?
The State Machine required for a looking glass-style game like Cloak requires the following states: Non-combat/Alert State
I got that state machine fully set-up using an enum method and then moved onto a lighting system. The current method relies on trigger volumes that define their radius by the lighting source's range. The light source has it's own instance of a scriptable object that tracks how close or far the player is accordingly and uses that to determine the intensity of the light and therefore how lit the player is when there is an unobstructed line between the player and the lightsource. Upon entering the radius, the scriptable object instance is added to the player and upon leaving the trigger or moving too far away. This object adds to the player's lighting meter and in turn acts as a variable to raises or lowers the amount of time it will take to be spotted by the AI. Once the player is at 0 lighting, the player cannot be seen unless the NPC is at very close distances, the player moves faster than a certain amount of meters a second, or they are attacked at close range.
0 Comments
Leave a Reply. |
Jed MyersDeveloper Archives
February 2021
|