top of page

Operation Phantasm Devblog # 6

Hello,

A lot happened this week and I thought it would make a good blog post. So here we are. We have finalized our first draft GDD and finally have a unified vision of the game. This was accomplished through some long meetings, and sometimes heated debates, and has resulted in some great ideas for the game. Another thing that happened is that we finally stopped kicking the can down the road and have decide to completely re implement our AI. That is what this blog post will focus on.

The reasoning behind this is that the AI have had up to this point was largely just an automated version of our player controller. It was great for testing the initial tech of the player characters. Since we really only needed to make sure that abilities, combat orders, attacking, taking damage, dying, etc. worked. However, it resulted in a very bland and non flexible AI system. This became a problem when we needed to start making fun engagements. We could not create a variety of enemy types that would test our players ability to master the toolkit we were giving them. Thus the decision to refactor was made. Before refactoring began, we decided to sit down and decide what kind of enemies we wanted. Smart, right? We focused on creating enemies that tested our player's ability to master the tools available to them. These are the enemy types we hope to introduce with our new AI system.

Core Enemies
  1. Basic Melee

  2. Fast movement

  3. Low hp

  4. Weak melee hits

  5. High rate of fire

  6. Attacks as a part of a mixed group or a small squad of the same type.

  7. Challenge: This unit forces the player to think about their positioning.

  1. Basic Ranged

  2. Medium movement

  3. Low hp

  4. Weak ranged hits

  5. Low rate of fire

  6. Attacks as a part of a mixed group or small squad of the same type.

  7. Challenge: This unit forces the player to use cover.

  1. Suicide Melee

  2. Medium movement

  3. Low hp

  4. Explodes after a short time when in range of a character

  5. High damage in a small area of effect

  6. Attacks as a part of a mixed group or small squad of the same type.

  7. Challenge: This unit forces the player to prioritize between targets.

Special Enemies
  1. Special Melee

  2. Medium movement

  3. High hp

  4. Strong melee hits

  5. Low rate of fire

  6. Ability 1: Small sized area of effect smash attack in melee range.

  7. Ability 2: Spreads fear to characters in a medium sized area of effect.

  8. Attacks solo, as a very small squad of the same type, or as a part of a mixed group.

  9. Challenge: This unit forces the player to continuously reposition their characters, use crowd control abilities, and focus on the fear related mechanics more.

  1. Special Ranged

  2. Low movement

  3. Low hp

  4. Average ranged hits.

  5. Medium rate of fire

  6. Ability 1: Casts medium sized area of effect attacks on clusters of characters for medium damage.

  7. Ability 2: Buffs nearby enemy units.

  8. Ability 3: When this unit detects characters, it will alert other enemy units in a large area.

  9. Attacks as a part of a mixed group.

  10. Challenge: This unit forces the player to try and avoid detection until their characters are in a good position. This unit also forces the player to prioritize the unit with high damage abilities and continuously reposition to avoid its area of effect attack.

  1. Special Ranged Spawner

  2. Low movement

  3. High hp

  4. Weak ranged hits

  5. Low rate of fire

  6. Ability 1: Periodically spawns a small group of Basic Melee units.

  7. Ability 2: Puts a speed debuff on each character this unit hits with a ranged attack.

  8. Challenge: This unit forces the player to use area of effect crowd control and damage abilities, as well as single-target abilities with high damage. This unit also forces the player to push forward through waves of enemies to get to one high value target.

Boss Enemy
  1. Level 3

  2. TBD

So far I have all of the basic functionality working that is essential to our core enemy types. That is, everything in this flow chart. Except spell casting and some extra retargeting and repositioning behavior for the special ranged unit that is not on that flow chart. Do you think a low hp ranged spell caster would want to stay in one place during a fight? Me neither. Below are some examples of the new AI in action against some target dummies.

1. Travels between set way points. Optionally can look at a specified transform for a set duration before moving to the next way point.

2. Has a variable targeting time, after which the enemy will move to attack range. Once in attack range the enemy will deal damage at regular intervals. (basic attacking with a rate of fire)

3. Once in combat the enemy will make sure to keep track of all the participants. Once a target is finished off, the enemy will automatically find a new target in the combat zone.

The "combat zone" in this context is just a trigger that keeps track of all the enemies and players in a radius around the parent enemy. Eventually enemies that move into each other's combat zone triggers will share target data. This will allow units that are not near a player but still engaged in the same area be a part of the fight. If that was bit hard to follow, here is a helpful diagram.

4. When forming the combat participant list, and subsequently updating it, the system will respect line of sight. So if the enemy takes down a player character and there are some other player characters hiding behind a wall nearby the enemy will not know about those other player characters.

5. For those out there that like to stealth, or can't handle the heat of these AI, don't worry I got you. The AI will chase you but only for a set time. After that time they will go back to their non combat behavior.

6. The system is quite modular and all the values are adjustable. What is implemented so far covers all of the basic functionality for all of our enemy types. It is flexible enough to make each enemy really feel like it has a different size, feel, and mentality. Here we see a wild refactored AI murder hoboing through some target dummies from range. Very scary!

A lot is done but there is still a lot to do with the new AI. The next steps are to refactor the way we handle instanced data on enemies. Currently the enemies also have player controllers, as I said before the enemies currently are automated players. In that player controller is instanced data pulled from scriptable objects that are dropped in on a prefab by prefab basis. So enemies will need their own data handler class. Which means that the combat utility script I made for managing all player -> player, player -> enemy, and enemy -> player data interactions will need some tweaking. In addition to this, each special enemy still needs its spells created. With that comes some additional behavior that needs to be added to the enemy AI's state machine. Here are some behavior questions I will have to answer, and have implementations for, between this coming week and the end of the month.

How does the enemy decide who to target with the spell?

How often does the enemy cast the spell?

Does it cast the spell at the same target every time?

If it is an AOE spell does the enemy send it at one target's positions? or the average of all the intended target's positions?

How will the special ranged unit re position during a fight? How often will it do so?

Does the special melee enemy pick targets just like the basic melee enemy?

That concludes this dev blog. Hope some of that information was interesting, helpful, and/or informative.


Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
bottom of page