Enemy AI - Now Playable


Hello conduits!

Previously, the game was practically unplayable. A tech demo in the loosest sense of the word.

Now it's playable! Hurrah hurrah! It's been a long time coming.

 It's time to start iterating - let's make this game shine 😎

Feedback would be very much appreciated. I'm considering a redesign of some aspects to fit more of a circuit theme - resistors, capacitors, inductors, batteries, etc.

https://i.imgur.com/PFxA9LF.mp4

--------------

Just in case you're interested

General Tech
- Single GameController managing order of creation + player input


Today I added a questionable Enemy AI using an questionable unofficial technique - dictionary priority
1. Dug straight into GameController, I'll pull out the logic later
2. Created EnemyAI coroutine that runs when GameStateHelper changes teams
3. For each enemy unit, create a 'Priority' dictionary mapping a grouped object of Effect Type (Damage, Healing) and TargetTileType (Self, Enemy, Teammate) to a number representing priority weight (1-6).
4. Depending on unit and game state, manipulate the priority weight.
         Ex. If unit is half health, increase the priority of (Healing, Self) by arbitrary number. If full health, decrease it instead.

5. Using this dictionary, calculate the best ability - for every possible ability's effects' (double loop), get sum up effect priority using the dictionary to try and maximize priority value. If sum of ability effects is equal to another abilities, I add it to a list that gets reset if any other ability is larger. That way, I can randomize effects with equal priority.

Issues:
- Imperfect AI - Uses arbitrary weights you give it. Doesn't learn.
- An effect tag can't always sum up it's priority - almost impossible to fine tune.
              Ex. just because it heals doesn't mean it's a strong heal, but it's given the same priority.
               A major headache has been movement - the type of movement (switching vs. empty only) hasn't been included yet.
             My first thought is to have the effect provide it's priority, but every enemy type will have it's own priority list. 
- Creating a new dictionary instance was used since weights were adjusted after creation
- Complex - Nested for loops all over the place. With only ~8 units I don't think it will be a problem.


If you think you know a better way I would love to hear it!

Files

CODENAME_CONDUIT_ScoreJam_V0.2_WebGL.zip Play in browser
Nov 10, 2022

Get CODENAME: CONDUIT

Leave a comment

Log in with itch.io to leave a comment.