Home Artists Posts Import Register

Content

Hayoo! Newww... devlog? Warning: long.

Been a while since we did one of these, as we've largely been focused on content generation, and also because I keep forgetting to do them when we have new development news. I think I even missed doing one about the encounter editor tooling... alas.

So this time we're talking about an undertaking that's been percolating for a while - the AI system. There's a lot that's dependent on this - rebalancing, new mechanics that the AI can interact with, and other improvements to battles and their connection to the rest of the game, so it's not just that AI improvements will make enemies behave more intelligently and with more personality - it'll also open up a lot of other new possibilities for work we plan to do.

First, here's a little summary of the old system and the current state implemented in the game as of now - skip to the word BANANA to see a write-up of what's to come.

First, things that are still true and will remain true: Battles in ToA are deterministic - there are no random dice rolls involved in the combat at all. Once each belligerent chooses a skill to use, the turn executes (simultaneously) and the results are fully deterministic. For AI controlled characters, the act of *choosing* a skill, however, is non-deterministic - it has a random component.

For both the player and AI controlled characters, the list of available moves to begin with on a given turn is based on your stance and circumstances.

Formerly, and this has now been removed, there was a section of the AI code that did "overrides" - it would detect a situation and automatically force the AI to use a particular move, particularly in enemies with special movesets like the Slime or Quetzal. While there is still a routine for "forcing" moves (which will definitely be de-emphasized or removed once the full system is in place), it no longer overrides the basic logic of whether a move *can* be used - that is, the AI character has to be in the right stance and can't ignore things like clothing that's in the way. So enemies behave the same way in regards to rules for move eligibility that the player character does, now.

Another thing that is still the same but is going to change is how the AI selects a move from a list of eligible moves once the forcing routine has completed. It takes that list and pares it down to only those matching its current preferred "type" of move (for instance, if an AI character is horny and wants to top, it might only take moves that are tagged "Lewd Top") - if no such moves exist, it continues with the existing list. Then it chooses one randomly, weighing towards more offensive or defensive skills depending on character type (for instance, Werewolves and Goblins are more Offensive, Brigands are more Defensive).  If using the skill would cause the character to fall over, they'll try to pick one that won't instead.

And... that's it! There's not much surface area there for custom AI behaviors - I can put in character-specific forcing, I can determine what "preferences" they have and try to tag all the skills accordingly (this is... less than ideal), and I can (now) determine what moves they even have access to (which are "learned" by a particular character), but that's all.

With the "forcing" code and the "preferences" code, it's possible to do medium-to-long-term planning for a given character, but in a very clumsy and error-prone way. If I want the Brigand to try and wrestle you, pull down your pants, and stick it in... either I have to guide her in that direction, leaving her easily distracted, or I have to specify the exact moves she needs to use in a particular situation, which will probably result in her acting very robotically, if it works correctly at all. So, what's the alternative?

~~ The New Hotness.  ~~

BANANA! So, like I said, some of the above has already been improved - the override is gone, for one. What skills enemies have access to is now more formalized and that along with the requirements code and the AI code makes it have more parity with the player and easier to see: A) why a character has a skill B) why a character can't currently use a skill, C) why a character chooses a skill. That actually neatly divides the three systems, which are analogous in each case to something the player is familiar with.

1) What skills do you know? Enemies have learned skills just like the player.

2) What skills are you allowed to use right now? Enemies have the same restrictions as the player.

3) What skills do you select? The player and the AI code ultimately select this.

So that's all done already - leaving the most intriguing part, which we've left as a black box until this point: the coming revamp of #3, the AI move selection system. This will replace or absorb, fully, the offensive/defensive weighing, the the technique preferences, the "don't fall over" routine, and all of the bespoke skill forcing, which is the biggest change. As mentioned earlier, it also partly sucks up stuff that used to be the domain of the code that determines what skills a character *can use* at all (meaning characters will gain access to new skills, but their priority might be very low), and so similarly replaces some of the stuff that was in the skill usage requirements code for convenience before.

That's nice from a stream-lining perspective, but what is this AI code and what does it allow us to do that we couldn't do before? The second thing first: there's a lot of stuff we couldn't do (or couldn't do easily) with the old system, namely: multi-turn planning, individualized character AI that responds to the player's actions in a satisfying way (getting more aggressive when angry, or responding to various kinds of seduction depending on the character's personality, etc. ),  generate appropriate dialogue as a result of the AI character's choices and mental state, or set *priorities* for characters, rather than forced commands. From a player perspective, it also means you'll be able to have more control over your opponent's actions in an intuitive way - if you know, for instance, the way a particular character behaves when they're after your butt, or the way that same character behaves when they're angry (and what makes them angry), you can intentionally make them angry or seduce them to guide their actions or predict them. If you want to trip a character, knowing that they stop caring about their footing when they've got hearts in their eyes can be very useful!

"Hearts in their eyes" also suggests some of the fun stuff we can do after this - more expressions and dialogue from characters in combat matching up to changes in their behavior. Some really fun stuff we can do when the characters have more personality behind their decisions.

Now for the actual AI code... on the design side, we've made a list of behaviors that each enemy will have, and we'll be assigning them to each enemy. Stuff like "will try to avoid falling over unless drunk", "will get more aggressive if angry", "will focus exclusively on mating when aroused", "will only try to get oral from the player when aroused for it", "will lick ass regardless of arousal", "tries to bleed opponent and then fight defensively", "will mount cowgirl opportunistically", "will spank during anal", "prefers pronebone to doggy during anal and will switch if given the opportunity", "will try to Embarrass opponent", "fights defensively when opponent has weapon equipped", etc. etc. - it's a very long list, and this isn't scratching the surface of it. It includes some general "smart" behavior that many characters - but not all - will have, like trying to negate the damage from potentially hard-hitting attacks, avoiding falling over if you can help it, and leveraging bonuses on attacks when they're applicable.

This is all helped by a prediction engine that can simulate the turn - or potentially multiple turns if necessary - with more intelligent characters able to make better predictions, similar to the outlook the player character gets - which we'll also be upgrading at some point as well.

This is where we're at right now, and why the AI code has been taking a while - the prediction engine is effectively like a chess engine, and those are notoriously complex and performance-dependent. We've had to make changes to the underlying turn-execution code to get it to run thousands, tens of thousands, or hundreds of thousands of times, whereas before it was only running once per "turn". If you imagine a brute-force approach to simulation, simulating all of a character's options against all of their opponent's options - a single turn lookahead if they each have 5 available options is 25 simulated turns, a two turn lookahead is 625 simulated turns, a three-turn lookahead is 15625 simulated turns, and a four turn lookahead is 390625 (!) simulated turns, which is the point at which it becomes nearly intractable. We want to keep turns instantaneous, with no noticeable "thinking" time for the opponent, so that simulation has to fit in a very small time window - ideally a single frame, which is 16.6 milliseconds, but depending on how much we have to search it might require more time than that. That being said, we've written it in a way that will allow for parallelization... though that may not be quite the silver bullet on Android. All of that means some intense real-time optimization.

It's a bit of a heavy-duty system, but we think it'll be worth it, at no real cost to the player - just some time and effort on our part. Likely, because of the evaluations from the behavior code mentioned above, we won't really need deep searches for predictions, but we wanted to make sure we had as much flexibility as possible while not having any impact on performance, even on Android, and that meant reducing simulation time. With changes we have on our development branch, we've gotten it down from ~35µs (35 microseconds) per simulation to ~3µs per simulation as is, a more than 10X speed-up. We've also reduced the memory footprint of a given simulation as well. With some testing, we estimated the lower bound at around 800ns, that is, nanoseconds, per simulate, but getting it that low might not be worth it, as it doesn't buy us too much (that's only about 4X faster than 3µs) - but we're still working on it.

tldr; the end result, hopefully, will be a system, in total, that's easy to debug and extend, will be less buggy, will give the characters in battle more personality (and the potential for even more with appropriate audiovisual cues) and more *distinguishable* personality, and enable more complex strategies both for them and for the player to engage with them.

Potentially a tall order, but if we can bring it home, it'll be a huge help in making ToA's battle system even better, both from a fun gameplay perspective and from a sexy romp perspective. And, significantly, it will also mean we can move on to the next big finalized improvements - but we'll talk more about that later, since this post is definitely long enough.

I know this looks like a lot, and like there's been a lot of talk about this, but this work has mostly been carried out by Dern, our programming contractor, (shoutouts to Dern, he's been putting a lot of heart and soul into this) - with my input, so it hasn't affected the pace of content and feature development much otherwise.

Thanks for reading, and thanks for supporting us,

Majalis

Comments

Anonymous

Thanks for the info and the good work 👍

zedd

This isn’t your average fembot smut this is AI advanced femboy smut.

Ryan Breggie

This. This is what I have always wanted from ToA. I shall wait patiently, and excitedly. Godspeed, friendos.

Samu 2000

thanks for the information, and than you for the great work

NOWYOUSEEME

Will the dominant seduction moves ever have a affect on the enemy? Such as blow me or rub it

MB

All of it sounds great; but what I'm really excited about is the reactionary dialogue you mentioned. I think dialogue in battle, and adding more life to the characters in battle is amazing. Can't wait to see how it turns out.

Persephone sinlow

Whenever I play I rarely go through traditional fight options and opt to either top or sub through catamite would love to see the ai be a bit more willing when using dominant seduction or a bit more of a dynamic experience when subbing. Ideally, I'd love to be able to fuck my way through every encounter but characters like the vampires or dark knight get in the way of that playstyle. I'm happy to hear some more AI work is being done in this regard!