Monday, May 4, 2020

AI now and later

Note: this may be a fairly technical entry.

Given that the most important goal of this game is creating rich character interactions, it's fundamental for the game to have rich AI systems capable of making their behaviors interesting.

This supposes some challenges for me. For starters, there are many different instances in which "interesting behavior" means fairly different things: Is a given character fleeing from another? Are they aware of any possible danger? Do they want anything other than pleasure in this specific scene? And so on. As if that wasn't enough, this is a game that will see new mechanics be introduced, mechanics that the AI has to take into account, and I will have to deliver playable builds periodically.

Block of code showing the definition for some tagged tastes. Each move has a number of tags, and non-playable characters use their own tastes and the dynamics of the current scene to decide which move they will use next. This will be seen in action in some scenes of the Demo build.

Creating the perfect AI for any of these builds, that will have a specific set of mechanics at the moment of release would imply a lot of work that would become obsolete when the AI for that specific task needs to get updated. An acceptable compromise, in my view, is delivering functional yet not polished AIs in the early builds: I'll be mostly creating auxiliary functions and systems that are generally useful to gather and sort data and priorities, which will then be assembled into small algorythms.

One of these auxiliary systems is the pathfinder. Above, you can see the logged results showing the paths to each room in the Training Grounds from the West Library. The first maps will be playable in the version 0.1.

This methodology will allow me to keep creating code that will remain useful in the future, instead of recrafting many sharp tools that go rust in a couple of months. When the main mechanics of the game are fully designed and everything that's left to serve is content, I'll have a lot of resources available to create refined and polished AI systems.


One off-topic note: the vast majority of the content for the Demo is finished, and it'll be playable at some point during May. Stay updated!