© 2023 by Name of Site. Proudly created with Wix.com

Operation Phantasm Devblog #3

January 24, 2017

This week I worked on implementing the first iteration of the mental system. This system is heavily influenced by Darkest Dungeon’s stress and quirks system. The idea is that while managing units in combat, the player will also need to manage their unit’s mental attributes and react to effects and behaviors resultant of the state of said attributes. This adds another layer of complexity to our combat system. The player must now move between 1 and 5 units, select which enemies to attack, manage their unit’s abilities, and manage each unit’s mental state and resultant effects. We are going all out with this first iteration and will be dialing back based on playtest results. Here is an overview of the first iteration of the mental system in Operation Phantasm.


Each player unit gets a mental manager that tracks the mental stats and applies the resultant effects when necessary. I created a mental utility to allow for various classes and objects to adjust each other’s mental stats with minimal knowledge of each other. Yay for decoupling!


Fear: A unit gains fear when they are attacked, in proximity of an enemy, or can see an enemy. The more fear a unit has accumulated, a larger accuracy penalty is applied. Killing an enemy unit reduces fear.


This was implemented largely by extending code I had already written, and some code that my team had written. The FOV script that my teammate Tyler had written was hooked into by the mental system to allow me to count how many enemies’ a given player unit can see. A trigger script that tracks targets of a given type within an area that I made last week was utilized to handle counting enemies that are in proximity to a player unit. I then extended that logic to check line of sight based on a ray cast to each nearby enemy. Checking against a obstacle layermask that can be adjusted in the inspector.


Delusion: Delusion is accumulated when a player unit kills an enemy unit. The stat gates at 25/50/75, at 100 a negative effect is applied to the player unit. After the negative effect is applied the delusion amount goes to 0. Delusion decreases passively until it hits one of the gates.

Negative effects- Lose control, mode switch to aggressive, zero accuracy, ability cooldown increased, and player Fears (runs away).


The delusion stat is a fairly simple one that only required me to do some work in the combat utility. Determining if the killing blow was coming from a player unit then adjusting that player unit's mental stats via the mental utility.


Despair: Despair is gained by witnessing or partaking in the death of a family type enemy. Despair can be reduced by killing a mortal enemy. The more despair a unit has the less damage they do.


As a part of the mental system, the enemy that is of the family type was added. This enemy type is linked with one of the player units and will raise their despair if dispatched in that character’s presence. A mortal type enemy will decrease despair of the unit that kills them.


The despair system was just the inverse of the delusion system in the sense that I was now checking for an enemy attacking a player instead of the other way around.


In addition to the mental system, I created and implemented the name tags for player units that display each respective unit’s name, health, fear, delusion, and despair. I made sure the nametag system was modular when implementing it so it could also be used in making a name tag for enemies that display name and health.


Of course, it goes without saying. Even though I am going to say it right now. With each week comes more bugs and bug fixes. This week wasn’t so bad when it comes to bugs. The mental system went in bug free, which is very nice when that happens on the first try. The bugs I did fix were all related to edge cases in the ability system changes implemented last week. Next week will see me working to add more ability types and implement the passive trait system. A breakdown of the tasks I will be working on can be found below.


Next week I will work on the following tasks:

Traits that can be applied to characters.

Values adjustable in inspector


Positive Trait- Immune/very resistant to fear.

Negative Trait- Extremely susceptible to despair.


Positive Trait- Does not gain despair for killing family members.

Negative Trait- Highly susceptible to fear.


Positive Trait- Decreases the despair of nearby friendly units

Negative Trait- Special chance to become randomly aggressive, which is modified by number of nearby enemies.


Positive Trait- Increased FOV/combat stats

Negative Trait- Slowly spreads despair to nearby allies.


feedback for the delusion effects on the nametag UI


An ability that will heal a target teammate within a set range (values adjustable)

Share on Facebook
Share on Twitter
Please reload

Featured Posts

Operation Phantom Devblog #8

February 27, 2017

Please reload

Recent Posts
Please reload

Please reload

Search By Tags
Please reload