Behavior Editor Implementation

The Behavior editor is a LARGE part of the game. Its what helps us in later stages decide what our microbes and multicellular organisms act and think. I would very much be up to the task of starting some work on prototyping and implementation, but I came to realise that the AI is going to need to be reworked before we start doing that.

Could we make the AI modular? And if so, would having proper speciation and generation make this easier? Or perhaps finding some way to germeate the players cell throughout the enviroment?

Interesting. It’s cool you’ve got a passion to work on this, that is great.

What do you imagine the behaviour editor actually doing? Is it just programming the ai for members of your species that aren’t you? (Because you control yourself). Does it have some effect on the CPA system? I guess this would be in the much talked about but not actually started predation formula. I guess also if we had sub-patches / associations then those might be programmable too.

Ive always had the vision of a node based system of sorts, with panels to help you move between different areas of behaviors. I imagine it would program members of your species, and later help you create mannerisms and other such things that help control your own cell too. And of course, since your rewiring how your species functions it would be obvious to have it cost MP.

I can imagine it having a very large impact on the CPA system. Say overtime you move your population from a herbivorous species to a carnivorous species, eventually the compound distribution and populations would fluctuate to keep up with a new predator on the scene. And a predation formula? I thought that was accounted for in the CPA system?

Im thinking atm we can start changing the AI so that it runs off of certain blocks of code? It might not work, but we haven’t even talked about this much to my knowledge so hey, a stab in the dark is still a stab.

I was thinking we could have a simplified neural net with preset logic gates (which you could also accomplish with a neural network). So you would have inputs, such as compound direction and predators, and you would be able to change the “weight” of the connections and the action potential of each link. The outputs would then be rotation (with a negative value being clockwise and a positive counter-clockwise) and thrust (WASD keys for the player). Later you would add additional outputs such as toxin release. This net would be auto generated by the computer for the player depending on the organelles, but the player would be able to modify it. Similar would be for the AI species, with the net being originally preset based on the organelles, but it could be changed for more aggressive or passive behavior. For those of you who will say that neural networks are inefficient, keep in mind that we aren’t “evolving” and “training” it in the sense that most companies use ANNs. We start with an already working one, and any change will still be considered a viable neural network that wouldn’t result in the cell spinning in a circle. Finally, neural networks are sooo fast compared to any other AI we could build since it’s basically just adding/subtracting integers and then comparing them to a threshold.

I actually have a fairly extensive knowledge of neural networks, so ask me if you need help. Good luck!

1 Like

Sounds good! What your proposing is eerily similar to my thought process, but basically listen to what TheCreator said. I mightn eed your help in the future if you have the time.

How does this relate to the ai of the other microbes? Surely what we’re really saying is that the player should be able to program the ai for their species but we want to program an evolving ai for all the other species as well. Would it not make sense to merge the two systems. So have something, like the neural net, control all the ai microbes and have the players species have one and let the player play around with it?

So basically every species might have the same network with different weights and the weights are either set but auto-evo or by the player?

Also what the exact inputs would be needs some thought. For example each input must be a number between 0 and 1 so what if there are 4 microbes on the screen in different directions from different species? How is all that turned into numbers?

Cool problem. Hope you enjoy working on it Montanaspud!

I feel that if we have the species generated by auto-evo, auto-evo should very much cover their neural networks. Also, I would think that the neural networks would be very similar, but different depending on organelle count and such. So a photosynthesizing cell would have priorities based more on finding CO2 and light-spots than a free-moving cell, which might focus on finding glucose and oxygen in the environment, and avoiding other cells.

The problem with weights could also depend on the organelle count, and if we could determine this, the fitness of that organism. Do the inputs have to be somewhere between 0 and 1? Or could the inputs vary a bit more?

Ill start prototyping this as soon as I can.

All microbes will have a different neural net that will change itself depending on the physiology of the microbe. The only difference is that the player will be able to edit his auto-generated (so you could immediately play after adding a toxin vacuole and not fearing that other members of your species wouldn’t use it) neural network. So I don’t really see “two systems” as you called them.

Each player will have different neural networks. The weights and thresholds would change over time, but so would the topology. You would get extra inputs (when you evolve signal agents and stuff) and outputs (such as flagellum and toxin ejection).

The inputs would likely not be between 0 and 1; neither would be the firing thresholds and the outputs. We could obviously have a node that fires only one or zero, but a lot of the time we would love to have a logistic function, so you would output a higher number if the input was higher (for things like movement).

The species would have to decide which species was more of a threat/more of a food source. We’ll be using logic gates and simple operations (which can all be formed using nodes, we just use this as an abstraction), so we could have a Max node with two inputs. The first input would be species1 (1 if present or 0 if not) multiplied by distance and weight of connection (say 3), while the second would be species2 (1 or 0) multiplied by distance and weight of the connection (say 5), so if this species1 and species2 are both the same distance away, the Max node will only relay the information for the second species (larger value) and the species will move accordingly.

Say both species 1 and species2 are predators, we wouldn’t want to go away from species2 only to run in the opposite direction and hit species1. In this case, we would not use a Max node, and would blend both inputs to instead move in a direction that gets us as far away as possible from both. I have a prototype of this lying somewhere…

Does this make sense? I’ll try to draw up the neural networks for all the species we have so far, so it is easier to implement (and then we could actually move onto evolving/modifying them).

It makes total sense. Though the AI will have to be reworked somewhat, for each species. A prototype would be nice to start out with. I can get on that myself.

Its also worth noting that the behavior editor, at least in the later stages, not only functions as a way to make the AI of your species, but also as a “tech tree” of sorts(not an actual tree but you get the idea), with you overtime evolving your species together. Signal Agents and Bonding agents, as well as class structures, reproduction, all of these things ARE covered by the editor.

How would we make it so that the species naturally bond together using the editor?

Cool well you know I love prototypes. Go nuts!

Here’s the old ai thread if you need any inspiration.

Also, if it helps, there’s this thread from the older forums (which unfortunately has all the pictures missing):

As far as I have seen there has been little discussion of the behavior editor here and in the community forums (atleast in regards to dedicated threads.) So I have decided to devise a new idea regarding it’s mechanics and how it would function. I have noticed concerns that the behavior editor would not be as engaging as other editors since editing AI would only effect NPCs and not the player, so I have taken steps to remedy such concerns.

Menu Design
A rather important aspect to any editor is it’s shape and form. An editor without a good design can be confusing, messy, and downright frustrating to use to those who are unaccustomed to it. However, simpler menus often sacrifice another important feature, which is often the freedom of what can be done in such an editor. I have created a rough design that I hope balances this issue in favor of the player.
The editor is divided into two primary parts. [Behavior], and [Traits].

Functions
Behavior:
This part of the editor could resemble an expandable list of customizable behaviors assembled in blocks. Each block would have 2 customization options which would be the stimulis, and then the reaction. The stimulis is something the cell detects, should it be another cell, compounds, light, or toxins. Perhaps it could be feasible for the player to customize the amount of detected objects to trigger the reaction, for example a cell may only flee in the presence of 5 or more cells.
Next will be the reaction, which is how a cell behaves in response to the chosen stimulis. The reactions could be the cell fleeing away from the stimulis, attempting to engulf it, simply approaching it, or any other behaviors we could devise. Note that the default behavior of any cell should always be to seek out loose compounds in the enviroment. If there are no stimuli present the cell will scavenge.

There could also be a third option, which is range. This option could likely be located between [Stimulis] and [Reactions] and would determine at what distance the stimulis triggers a cell’s reaction. This option would allow for more complex behaviors but it may be more difficult to code.

Traits:
Traits are likely to directly impact the player the most as they will determine how a cell behaves within itself. Traits could include things such as how your cell delivers their toxins, adjusting the speed of their flagella (for less ATP cost), or determining the priority of which compound is synthesized for ATP (Such as only consuming glucose when no sulfide is posessed). As you might guess, traits will not edit the AI of cells.
The editor for traits will likely be very similar to the [Behavior] part, but the traits may have parameters to determine the extent of their function. (Flagella speed trait would have a customization option for 10-100% speed, and the toxin delivery trait would have an option for the specified type of delivery). With traits, you should only be able to have one of each kind, and some traits may prevent you from posessing others due to incompatibility.

Cost
Changing the behavior of cells should naturally cost MP since it is as much an adaptation as developing new physical parts, But with the depth of customizability it should not be an extreme cost to change smaller variables. So I have made a rought estimate of what I believe should be the average cost of change. The smaller the change the trait or behavior induces, the less it should cost to adjust.

Adding new Behaviors/Traits:
Highest- 50 MP
Average- 30 MP
Lowest- 20 MP
Adjusting Behavior/traits Variables:
Highest- 20 MP
Average- 10 MP
Lowest- 5 MP
Removing Behaviors or Traits could cost the same as adding them, but it may be easier to simply use a similar flat cost to removing organelles.

I believe that this system could be simple to understand and use for anyone who plays Thrive. In the event that it may still be confusing we could potentially provide the option for presets such as “predator”, “scavenger”, etc to help introduce players to the mechanics. The presets would also make it easier for the player to simply select their preferred playstyle if they do not like to design a creature’s mentality from scratch. These presets could be buttons that cost the required MP to load.
It also to my understanding that this system could be easily adaptable to later stages of gameplay. Though I may be wrong in that matter.

Tell me what you think!

Here is some quick concept art I made to help convey my idea.


Edit: I accidently typed ATP instead of MP, oops.

3 Likes

Wow it really has been 3 years now huh? I’ve come back to this design now, as we have since implemented a functional behavior editor that allows for a nice amount of flexibility for species. I ask that the previous designs I had be entirely disregarded in favor of the following, as I feel I’ve grown since then.

Today I am going to bring up how we might be able to expand and improve upon the behavior editor going forward, based on how we have seen players interact with it with the following two concepts.


Fixed Adjustments

This editor as it currently stands works well enough, but it is not without it’s faults, namely that the values are currently unclear, and fail to communicate to the player the impact they have on their species.

To potentially solve this, I propose that the behavior sliders be fixed to specific values in increments of 100 each. I believe there is little to no need for controlling the exact value beyond these major increments as they will presumably make little difference in behavior. Doing so will make behavioral adjustment and tweaking more approachable and uniform for players as they will be able to better understand the impact of each adjustment when they are more significant.
If needed or otherwise desired, we could potentially reserve the current slider style for an “advanced option” for those so inclined.

In addition to fixed increments, changing the descriptive term of a species’ behavior based on their current values is worth considering, as it would concisely communicate to the player what to expect from the values they have chosen. A significant downside to this is increased translation burden, as well as the need to provide neutral terms between each extreme (EX: Peaceful, Neutral, Aggressive) which some might argue won’t be worth the effort.


Behavioral Impulse

The behavior editor currently allows players to adjust the general attitude of their species which allows for a great deal of flexibility. However, it currently lacks room for more specific response to stimuli, or behavioral quirks in general.

Main Idea:
I call my solution impulses; The player will be able to designate a particular stimulus, whether it be a particular level of light or perhaps detection of an external compound, that then creates an “impulse” in the species that alters their behavior by decreasing or increasing a chosen behavioral scale.
For example; Upon detecting phosphates with their chemoreceptor, a normally sessile species would have their activity increased.

The use of impulses would be entirely optional, with the player safely being able to ignore the feature if they so chose. But for those inclined, it could provide an entirely new level of engagement.

How it works:
Players would first click the “+” symbol in the Impulse category to bring up a selection menu listing available stimuli to choose from such as light level; Upon selecting their choice, a blank impulse would be created. After creation of an impulse, the player is then free to adjust the available modifiers and target behavior to determine what the impulse does, and when it is triggered. For example; In the concept art above, the player has created an impulse that increases activity once available light is above 50%.

Players would be able to make as many impulses as they desire, as well as freely delete any they no longer need or want.

Matters of Progression:
While the use of impulses is entirely optional, it is still helpful to ease it’s introduction to players overtime.
In the beginning, players would not have access to any stimuli. They would only be able to adjust the behavioral sliders to determine their species’ attitude. However, by possessing certain parts that allow them to sense things beyond primitive means, the player will be provided with new stimuli with which they can create impulses. For example, evolving a thylakoid could unlock lux level for impulses.

The idea is that as the species becomes more complex, it’s behavioral options begin to expand as well.

Connections to the process panel:
In the future, it may be attractive to bridge functionality between impulses and the process panel as devised in the past. Instead of altering behavioral scales, an impulse could instead be made to automatically deactivate/reactivate certain processes in the right conditions, allowing for effective automation of the process toggling feature. This would also potentially allow the AI to use the feature.

An example of this would be an impulse shutting off all rustycyanin when there is no available iron to process.
Such advanced functions could be locked behind the nucleus, or possibly nervous systems In later stages to roughly simulate the presence and evolution of an endocrine response system.


The UI as depicted in my concept should not be taken as a final rendition (unless the graphics team loves it, I doubt it) and I would strongly encourage we receive some input from the graphics team on how best to present the feature before attempting proper implementation.

The end result should be a more engaging and approachable behavior editor, featuring both easy to use scales for new players to quickly alter, and a more advanced and in depth but entirely optional impulse system for more advanced players to sink their teeth into.

I hope that I adequately explained my thoughts on an expanded behavioral editor! If there is anything particularly unclear or poorly explained don’t be afraid to ask me to elaborate. Please let me know what y’all think!

3 Likes