Day 12
More foundation work for AI. I renamed the composite filters as move or attack filters, as I'll probably gather them throuhg composite combiners (which combine a pair of action/move).
I did a first attack filter, which is aiming to deal damage to make the quickest K.O.s first so I could start to manually chain attack then moving until composite combiners are programmed. I still am trying to look for better ways to implement world evaluation and it brought me to create a light version of entity to represent them in decision tree map representation. Vaguely inspired from game tree solving algorithms, I'm trying to explore a tree of different action possibilites and extract the "best" course out of all possible combinations. For that I could check every pair of attack/move filters so I wouldn't have to deal with an overly complex tree (where I would evaluate among n variations of the same attack/move)
I could end up with a list of possible combinations looking like this
- AttackToKill(Billy, normal attack) then MoveAway(to_some_far_point)
- CloseUpForAttack(Bobby) then AttackToKill(Bobby, some_attack)
- CloseUpTo(Billy) then EndTurn [if still too far from entitites]
- ...
Deciding the final move from that list. would end up being another way to allow customization to have different bias weightings. A ranger attacker shouldn't act the same than a healing unit or a melee attacker. Having entity representation allows me to easily and freely alter their stats to represent the world after an attack or a move, with more or less entities, etc without having to deal with altering the actual entities in-game., therefore the need for splitting the entities from their representations.
I believe it's already quite complicated as-is but it sounds promising. Maybe I could also investigate Behavior trees or other decision structures in the future but I haven't figured out if is it possible for me to adapt my project into making them work, I lack the thinking framework to make them work yet.
In other news, I made the attack animations finally scaling up/down with the game's resolution so they will have a consistent size relative to the world. I also added a toggle for manual AI stepping to check stuff between an AI's actions, nothing fancy but still great to quickly debug stuff.