In my previous post, I had already created a state machine, using a purchased Unity model and some prebaked humanoid animations. My first priority was creating a system for both combat and sound manipulation. Unity, of course, doesn't have sound detection in it natively. So this gave me an opportunity to add in a feature that I simply had no notion of how to implement in college. But with a few years of hindsight? I have a simple, elegant solution.
The above gif shows manipulation of this system, using a crossbow bolt to lure an NPC. And with that, we can start prototyping a level.
0 Comments
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.
But a few months ago, I decided to binge Dishonored 2. I finished it in two days on low chaos Emily and immediately start my high chaos Emily playthrough, which I finished in three days. And I realized that I got into games because I wanted to make a Deus Ex, Thief, and Dishonored. And I hadn't done any of that since college. When I was in my senior year of college, I made my first attempt to make an Immersive Sim, Cloak.
Next step is adding a lighting system.
|
Jed MyersDeveloper Archives
February 2021
|