Required reading: API Rundown: the basics & Getting lists of animations and more with ODatabase
This article goes into a bit of detail on how the AI full-auto control works and how you can make your own AI control logic.
You probably only need to read this if you're going to add Aggressive-style scenes in an OStim addon, or want to make your own AI control script.
AI control was long planned in OSA, you can find bits of code and even icons referencing it within OSAs code. Fast forward to the modern day, and OStim & ODatabase have made creating an AI control system fairly simple. You can find all AI control source code in OAiScript.psc
OAi is basically a seperate OStim addon packaged in within OStim. It waits for a OStim_start event, starts a separate async AI thread, and then reads some data from the OStim to edit its parameters like how often to switch animations, how much foreplay to do if it all, whether or not the male should pull out at the end, and so on. After that, it simply grabs animations it wants from ODatabase and feeds warptoanimation commands in to OStim. Originally, I wanted to use traveltoanimation commands, however, as of right now travelling in OSex is very buggy, and certain animations almost always get stuck while trying to travel to them. I attempted to figure out a way to either detect when a travel would fail and warp instead, or to detect being stuck and cancel the travel, but had no real luck with either. If you find a consistent way to get travelling working, let me know.
Since the AI control is separate from OStim's code, you can easily create your own AI algorithm. To do this, just disable OStim's Use Full-auto settings and then create an addon like OAiScript. Originally, OAi was going to build "profiles" of NPCs you had sex with and they would always have sex in a certain way, however that ended up getting simplified quite a bit. For example, the idea was a high-level female Orc Bandit Chief could get a "Dominatrix" type profile and always choose animations that go with that style. With the simplified OAi, femdom AI like that will still kick in, but only if an OStim addon starts a scene, and specifies that the scene is both aggressive and the orc is the aggressor. Someone could still make a more advanced AI system like I originally planned.
On the topic of using OStim's new Aggressive starting parameters, they are done like so:
Starting an aggressive scene like this while in manual mode will basically do nothing, a normal OSex scene will start. This is why there are switches in OStim's MCM to force full-auto for aggressive scenes.
OAi will change AI behavior for scenes like this, and will prioritize animations marked as aggressive. If no aggressive animations are found, it will default back to normal animations. This occurs if you have the full OSex vanilla animation library, there are no male driven sexual animations that are aggressive, so without third party animation packs it will fall back.
With NPC on NPC scenes, AI control automatically kicks in no matter what. This allows NPC on NPC scenes for the first time in OSex. However, you can still disable the AI during these scenes with a property on the main script, if you want your own AI control to be used.
0 comments