Background

Hi! I just wanted to make a little blog post about these bots I’ve been working on (because game ai is my favorite aspect of development).

OASIS’s ai

ogura

First though, I wanna talk about the ai in OASIS: Tokyo. In terms of ai they’re actually fairly basic - they are just state machines. Though you might have noticed if you’ve played the game that each faction (except for the gangs, they’re the “base” ai) have their own unique aspect to their ai. For example: SectCom sometimes will not chase you when they lose line of sight, so you’ll have to peek them again; Corporate Security gains the ability to run away/heal, as do targets and some bosses.

Speaking of bosses, most of them have their own unique aspect as well:

  • Akaji will literally beeline straight for his target, he literally cannot go into a strafing mode like the normal ai or lose his target
  • Ogura will spawn with followers, and those followers will get the target of Ogura/other followers so you often have to deal with all of them together
  • The corp teams in the facility in Iwakura’s questline behave similar to Ogura, however one of them stays behind in their spawn. If the one that stays behind or their leader dies, all of them will immediately retreat to where they spawned and if they make it there they will despawn (they are “retreating”).

These new ai are sorta still state machines too and share a lot of the same code (translated, since i use godot now) but that’s not what I consider special (or at least uncommon) about them.

Unreal Tournament’s Bots

thannis

This idea initially came about when I started playing Unreal Tournament 2004 (the earlier games have this too i think but i’ve only played 2004 as of writing). Bots in this game are part of a preset roster, even the ones used in multiplayer. They have their own stats and some even have a preferred weapon to use. These new ai are very much inspired by this, as well as the order commands you can give to them in matches. I’m also not sure if I’ve seen this done since (in an fps at least).

Genuinely, if you know of another game/series that has done something like this please let me know I’d love to play it. The closest I’ve seen recently is Sinned Arena which I found in this Feb’s Next Fest which seems to have a roster of unique characters. Although as a game it has no real objective-focused modes which I prefer over simple deathmatches (the demo just had deathmatch and not much else. the “heartcore” gamemode leaves a lot to be desired as the only non-deathmatch gamemode, i would not consider it objective-focused personally)

Archetypes

So, taking from the orders in UT2004, I’ve created what I call “Archetypes”. For Koi specifically this allows the current gamemode to decide where the bot should go based on its archetype. There are 4 archetypes currently:

  • Normal: Just normal behavior, bots with this attack/defend objectives as appropriate. If an archetype has no special behaviour it falls back to this
  • Aggressive: When defending in Search and Destroy, bots with this will act like its tdm instead of staying near bomb sites
  • Defensive: In Domination, bots with this will not try to cap new points, and will stay at the last point their team has captured
  • Hungry: These bots will not play the objectives what-so-ever and will just act like it is TDM and roam around the map

I plan to expand on these archetypes as I add more gamemodes. There are currently 5 gamemodes (some of the names will probably be changed at some point): TDM, Domination (dom), Search and Destroy (sd), Elimination (gunfight/teamfight-like mode), and Tournament (round-robin multi-team mode based on elimination, similar to tarkov arena’s removed shootout mode)

Stats

Also inspired by the displayed stats in UT2004, there are “percentage” stats which will change different values of the bot from 0% to 200% of a default value that I consider well-rounded:

  • Aggressive: Generally affects bots’ strafing range/time frame
  • Reactions: How quickly a bot will react to a new target and how quickly it aims towards it
  • Recoil: How well the bot reduces recoil
  • Burst: How many shots the bot will fire in 1 burst, and how long it takes between bursts
  • Patience: How often the bot will request a new objective position from the gamemode (so a lower % will stay in one position for less time)

These percentage stats will also be expanded upon as I add more features to the bots

These two aspects I think will bring dynamic and unique bots to Koi, OASIS 2, and any other future games I make that require ai like this.

Future Improvements

Of course, these bots (and Koi in general) are still very much a work in progress. In particular, they are missing a few features OASIS’s ai had, such as “hearing” audio, and the run away these bots do is currently much more simpler than OASIS’s version. I would also like to add new features, such as the ability for them to intentionally flank their target. These also have potential in OASIS 2, as with this framework I can more easily create unique personalities for ai, whether they are normal enemies, bosses, or perhaps even companions.

Thank you for reading! Please wishlist my upcoming game Dyskairos on Steam. Thank you for your support!

Updated: