Sex Autonomy - How Does It Work 1 (Patreon)
Content
The process of Sex Autonomy is divided into three main categories: Situation, Relationship and Location.
New setting for Sex Autonomy Level was introduced that allows to disable autonomy or set it on the low, normal or high level.
Situation
The first step is to decide which NPC Sims are capable of the sex interaction.
At first, every Sim on the active zone is checked for their current situation. If they are underage, busy working, sleeping or some serious stuff is happening, they won't be counted as available.
This is a pretty straightforward process and it returns a list of Sims that are candidates for Sex Autonomy.
Relationship
The second step is to try to find possible pairs of Sims from the list of available Sims. The relationship between every Sim is scored and the Sims with the highest score are more likely to be picked.
Sims friendship and romance, skills, social context, desire, mood, moodlets and few other special things are summed up to return a score.
How the relationship between Sims is scored was changed a little bit for NPC Sims because of the lack of player control. The main changes allow age and gender preference to affect the overall score. The autonomy level setting will affect the score too.
The reason for looking up only pairs is because that's the starting point of any sex interaction. It's not impossible for NPC Sims to join later though. And solo interactions could be an option later too.
Once Sims are collected, scored, and sorted, depending on the autonomy level setting, one from the top scored relationship pairs is picked for the next step.
Location
The third and last step is about finding the right location and it's the most complicated because of how the game is designed.
The initial step is to get all the rooms on the active lot. The term "room" is pretty loose since it doesn't have to refer to a place that has walls or even a single room. Instead, the game divides the lot into "blocks" that have some magical properties and you can imagine that this was an issue.
Rooms are being returned as a set of flat polygons that create the shape of the room. Base on the corners of the polygons the size of a room is being calculated as one of the factors in deciding about a good location. The idea is that the bigger the room, the higher the chance of lowered privacy.
Another thing collects all of the objects that are inside a room to determine it's purpose. Furniture makes the room and when you see a toilet or a shower inside one, you can safely guess that it's a bathroom. The main types of rooms that are being detected is bathroom, kitchen, bedroom, living room, office room, and kids room. You can imagine which ones are more likely to be picked.
Just like objects, Sims that are in rooms are counted and lower the chance of that room being a good location. Age of the Sims plays an important role too.
Then again, objects are being checked once more. This time it's all about counting how many animations they have to offer, checking if they are not in use and some manual balance with common objects, like windows.
The floor location is being considered too, but it's less likely to be picked because of the problematic ways of detecting rooms.
From all the collected locations, depending on the autonomy level setting, one of the top best locations is picked to finally start the sex interaction.
Conclusion
There is quite a lot of stuff that has to be done to allow Sims for autonomous sex. This process can actually take even 2 seconds to run which may sound to you like not much, but most of the actions in the game are done 14000% faster.
It was not meant to trigger Sex Autonomy often anyway, but I made sure it won't affect the performance of the game. Sims will not be trying to have sex all the time, there are few minor tests done before it can even happen.
Progress
I am almost done with the initial release of Sex Autonomy. What I mean by the initial release is that the core mechanics are already in place. Situation, Relationship and Location are already running.
After the initial release, I will have to focus on NPC Sims joining sex, NPC Sims asking players for sex, NPC Sims pregnancy and special traits to increase or decrease Sims chances for sex.
The amount of time taken by Sex Autonomy initiation can still be reduced. In the future, I may allow Sims to look for a location outside the lot itself. I may offer Sex Autonomy for player Sims too.
If you think something is clearly missing, you don't understand or want to add something to this, let me know!