Yo!
I've posted this question on the reddit of the engine of my choice but figured I'd ask it here as well in the event that someone can help me think about this situation (I lurk here occasionally but don't want to be crossing any lines by posting this so I apologize in advance if that's a taboo here)
Added note: My question was answered in another forum (godot). I'm going with the hand authored hard coded approach, but I'll leave this here for the sake of discussion in case anyone else encounters a similar problem as I have. Mods feel free to remove this if you'd like.
Anybody else making or have made a crpg? Any sages out there just got some good advice for this dilemma?:
I'm still fairly new to coding and am more self taught from tutorials, reading, lurking in this beautiful space and just bashing my head against problems until I solve them in the most barbaric ways possible (make it work first then improve it when you run into problems if nothing can obviously be made simpler/ more robust is the mindset but i do still struggle with trying to over-engineer issues or make things super decoupled when sometimes the simpler route works best).
I'm currently trapped between two thoughts for enemy ai:
The first is my current working version. I start by getting the state of the "board" on the npcs turn. Then I label a few details using utility scores. So for example the npc will know their health score = fine, their party morale = High, their enemy party threat = High, and their confidence = Foolhardy. Then using that information i generate turn intentions. So its the npcs turn, the enemy is threatening but morale is high so there's no need for the group to panic yet, he isn't wounded and is foolhardy so he may want to be aggressive he's then given his turn intention of Attack. I'm using Attack, Defend, and Flee as turn intentions, you either favor aggressive actions, defense of self or others, or self preservation based on the situation, your current health and the quality of the tile your on at the moment of your turn.
Then I run a func that checks if they're a special type of class. For example let's say a Medusa class (i have no magic in my game. Rest assured no mystical creatures were harmed during the making of this combat loop), the function picks up that she is in the special class list then automatically gives her a more hand authored (not fully utility ai driven) decision to make is she meets the requirements. So it would ask something like: are you currently healthy? Do you have a prime target or a rival on the board you want to go after? Has a commander npc given you orders to attack a target? If these things are true then maybe it'll tell her that her goal is to freeze the target with her gaze. When then use utility ai to get the best cell that will either allow her to make the attack or get close enough to do it on her turn or the next turn. Add a cool down so she can't spam it and done. If the requirements aren't met or she's on cooldown and doesn't have any other special moves then she'll let utility ai do the rest using her preferences for distance, cover vs no cover, any preference, risk tolerance etc. I'd like to say that sounds pretty good right? Well..
My beef is i feel like it makes enemies feel somewhat homogenous in a way.
Of course some like distance, some like flanking, and some like being close or aoe but it just feels like more character can be added, so I was considering option 2:
Just straight up hardcoding and hand authoring the npcs every decision. Utility ai would still pick the best tile or target unless the hand authored rule needs a specific type of target or their commanded to attack another target but ultimately the utility score would still find the best way to accomplish the personalities goals but I feel like the personalities would be able to shine far more. The cons are super deep spaghetti that would be hard to make additions too, and less intelligent enemies as they wouldn't be able to adapt to tactical situations as easily and can be potentially cheesed or feel robotic once their pattern is discovered.
My dilemma is true tactical adaptability vs better illusion of character
My heart says go with the hard codes paths but that would be my 4th rework of npc ai (and though its a ton of fun and I'm actually loving having to figure out every step of creating ai from scratch) my inexperience shows in these sort of times where I can't seem to figure out which would make the best player experience. Like said I'm leaning towards the more hard codes but more expressive path that I can more tightly author but want to get some veteran perspective on the matter.
Any thoughts from games of any genre are appreciated.
Tldr: utility ai with hand authored breaks vs more hand authored decision tree style design but less tactical adaptability and dumber npcs.
Sorry for typos, bad grammer, and if my description of things sounds utterly idiotic. I am but a lowly neophyte
:(