I know this works fine in C/C++ I am currently rewriting the system to python.
I think I got it refined enough it won't be to heavy for it.
There are multiple classes in the system the two most important are the character_ai and task. I previously called it event_type.
The task class keeps track of what stats it effects on the AI it has a function that can be assigned to run for that task. It also can track modifiers such as what makes that event possible to run. That last of those isn't as important as the first two.
Tasks:
You can effectively make a task do anything. You can make a task of running multiple other tasks in succession. Such as if your Character had a job assignment. Or if they came home and wanted to cook something.
Tasks can be assigned to people, locations, jobs and objects.
Say your Character gets home from work. It wants to raise happiness up some and it looks for entertainment. It checks the location which also acts as the object manager. The object manager tells the character_ai what is in that area. It can make a selection from that or use a path system to check outside the area and find something to do away from there.
Anything: I said that didn't I:
Let me expand on that to the fullest extent. You could technically give it the ability to write and expand its own code.
If you wrote it a function to find the best answers to a question it could do that. If you added a neural net to a function to identify whatever it could do that.
But we don't need anything to that level for the game.
What this allows is creating a crap load of interactivity for pretty much anything in the game you can add without a lot of programming to do it.
If you want the AI to come home and study or cook or reload the fridge or watch tv go to bed ... all done with minimal effort.
You start off with a few basic tasks attached to the AI and a few functions that determine what the goals are and which one has priority at the moment.
Example: You don't want the AI deciding it should take a nap over going to the hospital if its health is low.
So what is so good about the concept. Well you get a huge amount of functionality without having to write most of the code you would if you use conventional methods.
Expanding it to handle corruption / sexuality:
There is a class for relation:
Events is another name for tasks. They function identical and use the same class.
When the character performs that sexual act or performs in an event such as exhibition or voyeurism ... it runs the event at the end of which it modifies the specific stats of the AI listed in that event.
As I said above tasks can be anything. Including running other tasks or a list of tasks.
Drive, walk, strip one item or all items or show tits to full sex session.
You only need to create the task once for all the characters to use it.
The final 4 or now 3:
Location. It can be a scenic area or building or just a location on the map. It store a name and data for assets needed for it.
More importantly you can store them with parent child connection. This way your AI class can search for stuff it wants to find.
It can also stores ownership info such as for a home, occupants the people currently in that location, tasks / events attached to location.
Maybe, you are at the beach and want to have a volley ball event or a wet_T competition.
It also stores jobs available at the location.
Finally object management.This was originally a separate class but I chose to combine it into location.
It simply provide the Character with a list of objects in the area that can be interacted with. This way the AI can find stuff to do on its own.
Object. This can be anything the AI interacts with. Vending machine, tv, sword, stove, register ...
It has location orientation information. When placed it registers with the local area.
It also stores a list of tasks and states and depending on the state it can give out different tasks.
Example refrigerator doesn't need to advertise giving out food if it is empty.
So the task it gives out is go buy food to fill me up.
Then once the fridge has food in it. It switch back to I'm a source of food you can increase energy here.
Job: This has title location time start and end pay and the list of tasks that need doing and job requirements.
I mentioned the Character_AI class at the top:
The biggest part about this class is the goal system and AI stats.
Goals can be added and removed. The priority of goals always changes depending on the state of the AI and its stats and its personality traits.
Each time a task is completed an evaluation is done to determine what is the new priority.
This system is mostly used for AI that are autonomous. Not one that is Player driven.
However, it could be left in to provide hints to the player. Things like "I'm hungry", "I'm horny" or it could even be used to give more precise hints like "I'm horny, didn't a new strip club open up?" ...
In addition to that system a lot more can be added on via the task system.
But you can also add in a dialog system. There are a couple different levels to what this can be built up.
The easiest is using sentence pools for sentence substitution. It requires writing multiple sentences to represent the way different characters with different personality types may act at different levels. You can even have an AI that is hanging around another one pick up sentences from the other ones pool.
You can also vary reactions between AI's and the player driven character based on their levels and personality types.
A cut above this would include word supplementation. You basically use a format for a number of different sentence and then create pools of words and rewrite sentences as the personality changes.
It is also possible to build in a rating system so the AI evaluates how well different tasks work in increasing stats or accomplishing the goal.
The same can be done for the dialog system.
Sexual corruption:
The way this ties into corruption is you can write a task for each type of sexual event. It will work for all characters if done correctly.
It can be done in such a manor as the correct assets and scenes are used for each AI and location as needed.
that means the work to make 1000 characters in your game isn't much more than making work for 1 character.
The primary means of using it would be create various tasks for sexual acts or events. These tasks modify stuff like character experience for that task.
it might also increase happiness or other attributes of the character. The skill level and mental stats can be used as gates for making other sex acts available.
Those levels can all vary depending on the AI personality you setup. So one character may be easier to get in bed vs another. One may be worried about getting pregnant more so be more willing to do anal over vaginal ... Use your imagination!!!
What about the story?
I want to make this clear up front. It by no means prevents linear story telling. You just need to know how to use it!
Easy, you use tasks for that also. You simply set the requirements for that task to run and attach it to a location or the character.
For that matter you could connect it to an object or even a job. Maybe, you want the trigger to be when your AI uses the water cooler at work or goes to work on such and such day or after they reach a certain level of sexuality.
You also can use different methods to corrupt a person. You could use incrementalism or you could force them under threat of life the AI would most likely do so if there isn't some personality trait you gave them that prevents it. You could use carrot and stick methods. Because it has goals of being happy and not wanting to be hurt you could create tasks that provide the pain make them suffer by lowering happiness it could then evaulate the behavior of saying no as not leading to being happy. But that would require adding the evaluation method performance. Over time it would rate each action based on how much it affects stuff like happiness, comfort, energy, health ... It would then create modifiers for various actions to influence what the character does.
Really the only limiting factor to what you can do with this is your own imagination.
The code snippets are just from a test demo I have been working with at home.
All the functionality discussed in this is because one simple concept being able to pass a container for task from one thing to another. The character_AI can get a skill from an object such as a book. It then could use a task to teach other AI to propagate that task to others. Technically the AI never has to do anything more than run most the tasks. It has no need to store them long term because when it goes back to a location it will still be there.
In C++ this can save a crap load of memory usage and boost performance in large scale simulations. The reason being is all those tasks are really just created one time and accessed via a pointer to it. Not sure exactly how python does it.
I think I got it refined enough it won't be to heavy for it.
There are multiple classes in the system the two most important are the character_ai and task. I previously called it event_type.
The task class keeps track of what stats it effects on the AI it has a function that can be assigned to run for that task. It also can track modifiers such as what makes that event possible to run. That last of those isn't as important as the first two.
Tasks:
You don't have permission to view the spoiler content.
Log in or register now.
Tasks can be assigned to people, locations, jobs and objects.
Say your Character gets home from work. It wants to raise happiness up some and it looks for entertainment. It checks the location which also acts as the object manager. The object manager tells the character_ai what is in that area. It can make a selection from that or use a path system to check outside the area and find something to do away from there.
Anything: I said that didn't I:
Let me expand on that to the fullest extent. You could technically give it the ability to write and expand its own code.
If you wrote it a function to find the best answers to a question it could do that. If you added a neural net to a function to identify whatever it could do that.
But we don't need anything to that level for the game.
What this allows is creating a crap load of interactivity for pretty much anything in the game you can add without a lot of programming to do it.
If you want the AI to come home and study or cook or reload the fridge or watch tv go to bed ... all done with minimal effort.
You start off with a few basic tasks attached to the AI and a few functions that determine what the goals are and which one has priority at the moment.
Example: You don't want the AI deciding it should take a nap over going to the hospital if its health is low.
So what is so good about the concept. Well you get a huge amount of functionality without having to write most of the code you would if you use conventional methods.
Expanding it to handle corruption / sexuality:
There is a class for relation:
You don't have permission to view the spoiler content.
Log in or register now.
When the character performs that sexual act or performs in an event such as exhibition or voyeurism ... it runs the event at the end of which it modifies the specific stats of the AI listed in that event.
As I said above tasks can be anything. Including running other tasks or a list of tasks.
Drive, walk, strip one item or all items or show tits to full sex session.
You only need to create the task once for all the characters to use it.
The final 4 or now 3:
Location. It can be a scenic area or building or just a location on the map. It store a name and data for assets needed for it.
More importantly you can store them with parent child connection. This way your AI class can search for stuff it wants to find.
It can also stores ownership info such as for a home, occupants the people currently in that location, tasks / events attached to location.
Maybe, you are at the beach and want to have a volley ball event or a wet_T competition.
It also stores jobs available at the location.
Finally object management.This was originally a separate class but I chose to combine it into location.
It simply provide the Character with a list of objects in the area that can be interacted with. This way the AI can find stuff to do on its own.
Object. This can be anything the AI interacts with. Vending machine, tv, sword, stove, register ...
It has location orientation information. When placed it registers with the local area.
It also stores a list of tasks and states and depending on the state it can give out different tasks.
Example refrigerator doesn't need to advertise giving out food if it is empty.
So the task it gives out is go buy food to fill me up.
Then once the fridge has food in it. It switch back to I'm a source of food you can increase energy here.
Job: This has title location time start and end pay and the list of tasks that need doing and job requirements.
I mentioned the Character_AI class at the top:
You don't have permission to view the spoiler content.
Log in or register now.
Goals can be added and removed. The priority of goals always changes depending on the state of the AI and its stats and its personality traits.
Each time a task is completed an evaluation is done to determine what is the new priority.
This system is mostly used for AI that are autonomous. Not one that is Player driven.
However, it could be left in to provide hints to the player. Things like "I'm hungry", "I'm horny" or it could even be used to give more precise hints like "I'm horny, didn't a new strip club open up?" ...
In addition to that system a lot more can be added on via the task system.
But you can also add in a dialog system. There are a couple different levels to what this can be built up.
The easiest is using sentence pools for sentence substitution. It requires writing multiple sentences to represent the way different characters with different personality types may act at different levels. You can even have an AI that is hanging around another one pick up sentences from the other ones pool.
You can also vary reactions between AI's and the player driven character based on their levels and personality types.
A cut above this would include word supplementation. You basically use a format for a number of different sentence and then create pools of words and rewrite sentences as the personality changes.
It is also possible to build in a rating system so the AI evaluates how well different tasks work in increasing stats or accomplishing the goal.
The same can be done for the dialog system.
Sexual corruption:
The way this ties into corruption is you can write a task for each type of sexual event. It will work for all characters if done correctly.
It can be done in such a manor as the correct assets and scenes are used for each AI and location as needed.
that means the work to make 1000 characters in your game isn't much more than making work for 1 character.
The primary means of using it would be create various tasks for sexual acts or events. These tasks modify stuff like character experience for that task.
it might also increase happiness or other attributes of the character. The skill level and mental stats can be used as gates for making other sex acts available.
Those levels can all vary depending on the AI personality you setup. So one character may be easier to get in bed vs another. One may be worried about getting pregnant more so be more willing to do anal over vaginal ... Use your imagination!!!
What about the story?
I want to make this clear up front. It by no means prevents linear story telling. You just need to know how to use it!
Easy, you use tasks for that also. You simply set the requirements for that task to run and attach it to a location or the character.
For that matter you could connect it to an object or even a job. Maybe, you want the trigger to be when your AI uses the water cooler at work or goes to work on such and such day or after they reach a certain level of sexuality.
You also can use different methods to corrupt a person. You could use incrementalism or you could force them under threat of life the AI would most likely do so if there isn't some personality trait you gave them that prevents it. You could use carrot and stick methods. Because it has goals of being happy and not wanting to be hurt you could create tasks that provide the pain make them suffer by lowering happiness it could then evaulate the behavior of saying no as not leading to being happy. But that would require adding the evaluation method performance. Over time it would rate each action based on how much it affects stuff like happiness, comfort, energy, health ... It would then create modifiers for various actions to influence what the character does.
Really the only limiting factor to what you can do with this is your own imagination.
The code snippets are just from a test demo I have been working with at home.
All the functionality discussed in this is because one simple concept being able to pass a container for task from one thing to another. The character_AI can get a skill from an object such as a book. It then could use a task to teach other AI to propagate that task to others. Technically the AI never has to do anything more than run most the tasks. It has no need to store them long term because when it goes back to a location it will still be there.
In C++ this can save a crap load of memory usage and boost performance in large scale simulations. The reason being is all those tasks are really just created one time and accessed via a pointer to it. Not sure exactly how python does it.
Last edited: