Neurons

From Worldbox Wiki

This page is not yet complete but still contains valuable information.

The neuron system is a new AI system added in 0.50, which determines the actions and behaviors of all units. Each task or action is represented by a neuron, which may fire based on certain conditions and at certain intervals. Players can enable / disable neurons, which allows / prohibits the units from performing the corresponding task.

Every neuron has the following parameters:

  • Cooldown - A specific period of time during which a neuron remains dormant after firing.
  • Weight - a hidden property which determines the probability of the neuron firing.
  • Priority - reflects the importance / urgency of the corresponding action / task. Each priority level corresponds directly to a neuro layer; minimal, low, moderate, high, critical corresponds respectively to idle, growth, cognitive, survival and immediate. Neurons with higher priority often have larger weights, but this is not always the case.

Note that different neurons may share the same name. For example, different neurons corresponding to sleeping under different conditions all share the same name “Drowsing”.

The Neuron System[edit]

The neuron system does not run for the following units:

  • Unconscious units, including units who are sleeping, and units with the “Stunned” status effect
  • Units controlled by the player

Different types of units have different combinations of neurons. Some neurons are only seen in animals, some are only seen in civilized units, some are only seen in adult or child units, etc.

Each time a unit makes a decision, it chooses a neuron to fire. Neurons which can fire must satisfy the following conditions:

  • The neuron is not in cooldown
  • The neuron has not been manually disabled by the player
  • Certain special conditions are satisfied - e.g. Eating neurons only fire when the unit is hungry; Drowsing, Breeding and Plotting neurons only fire when the unit is not in combat, etc.

When choosing a neuron to fire, there is

  • 80% chance to choose only from neurons with the highest priority level
  • 20% chance to choose from all active neurons

Neurons and Weights[edit]

The chance of each neuron firing depends on its weights. Each neuron has a basic weights property; this is usually a fixed value, but some neurons have weights which vary based on certain conditions:

  • Breeding - before reaching the offspring limit, the neuron’s basic weight is 2; once the limit is reached, the weight drops to 0.1
  • Job Seeking - normally has a weight of 2; when the unit’s nutrition drops to 50, its weight becomes 1; when nutrition drops to 0, its weight becomes 0.3
  • Claiming - basic weight = 2 + stewardship * 0.02

According to the neuron’s basic weight, the system calculates the neuron’s actual weight, which is the exponential of the basic weight

Actual weight = ebasic weight

Where e = 2.718…

The final probability of each neuron firing is directly proportional to its actual weight. In other words, the probability of a neuron firing is its actual weight divided by the sum of the actual weights of all possible neurons.

Neuron Info[edit]

Neuron Info
Name Icon Cooldown Basic Weights Priority/Layer Conditions Effects Other Requirements Code
Drowsing 90 0.05 Level 0-Minimal/Idle Only fires when not in combat bored_sleep
Drowsing 90 0.8 Level 1-Low/Growth Only fires when not in combat polyphasic_sleep
Drowsing 200 0.75 Level 1-Low/Growth Only fires when not in combat monophasic_sleep
Drowsing 30 1 Level 2-Moderate/Cognitive Only fires when not in combat sleep_at_winter_age
Drowsing 30 1 Level 2-Moderate/Cognitive Only fires when not in combat sleep_at_dark_age
Drowsing 30 1 Level 2-Moderate/Cognitive Only fires when not in combat sleep_when_not_chaos_age
Drowsing 30 1 Level 2-Moderate/Cognitive Only fires when not in combat sleep_at_light_age
Dreamwalking 120 1.5 Level 2-Moderate/Cognitive Only fires in adults try_affect_dreams
Celebrating 60 1.5 Level 2-Moderate/Cognitive try_to_launch_fireworks
Socializing 30 0.5 Level 2-Moderate/Cognitive socialize_initial_check
Breeding 60 Level 3-High/Survival Only fires in adults asexual_reproduction_spores
Breeding 20 Level 3-High/Survival Only fires in adults asexual_reproduction_fission
Breeding 30 2.5 Level 3-High/Survival Only fires in adults asexual_reproduction_vegetative
Breeding 50 Level 3-High/Survival Only fires in adults asexual_reproduction_budding
Breeding 60 Level 3-High/Survival Only fires in adults asexual_reproduction_divine
Breeding 40 Level 3-High/Survival Only fires in adults asexual_reproduction_parthenogenesis
Breeding 20 Level 3-High/Survival Only fires in adults
Only fires when not in combat
sexual_reproduction_try
Moving 1 0.2 Level 0-Minimal/Idle random_move
Moving 10 0.2 Level 1-Low/Growth Only present in animals random_fun_move
Moving 30 0.3 Level 0-Minimal/Idle random_move_near_house
Fleeing 10 2 Level 3-High/Survival run_away_from_carnivore
Fleeing 10 3.1 Level 3-High/Survival run_away
Fleeing 10 5 Level 3-High/Survival run_away_being_sus
Moving 1 4 Level 4-Critical/Immediate swim_to_island
Moving 1 4 Level 4-Critical/Immediate move_to_water
Waiting 10 0.1 Level 0-Minimal/Idle wait5
Confused 1 3.5 Level 4-Critical/Immediate status_confused
Soul Harvested 40 Level 3-High/Survival Only fires when not in combat status_soul_harvested
Plotting 40 1.5 Level 2-Moderate/Cognitive Only fires in adults
Only fires when not in combat
Only present in civilized creatures
try_new_plot
Plotting 3 5 Level 3-High/Survival Only fires when not in combat check_plot
Migrating 10 1 Level 2-Moderate/Cognitive check_join_city
Migrating 10 1 Level 2-Moderate/Cognitive check_join_empty_nearby_city
Returning 15 3 Level 2-Moderate/Cognitive Only fires in adults try_to_return_to_home_city
Job-Seeking 50 Level 3-High/Survival find_city_job
Paying Taxes 90 2.55 Level 3-High/Survival give_tax
Eating 10 2.6 Level 3-High/Survival Only fires when hungry try_to_eat_city_food
House-Hunting 10 0.5 Level 2-Moderate/Cognitive find_house
Idle 15 0.5 Level 1-Low/Growth Only present in civilized creatures stay_in_own_home
Idle 60 1.5 Level 2-Moderate/Cognitive Only present in civilized creatures generate_loot
Pining 30 1.5 Level 3-High/Survival Only fires in adults check_lover_city
Courting 50 1.5 Level 3-High/Survival Only fires in adults find_lover
Settling 20 1 Level 2-Moderate/Cognitive Only fires in adults
Only fires in sapient units
Only fires when not in combat
try_to_start_new_civilization
Moving 90 3 Level 3-High/Survival check_if_stuck_on_small_land
Settling 60 1 Level 2-Moderate/Cognitive Only fires in adults build_civ_city_here
Storing 5 3.1 Level 3-High/Survival store_resources
Walking 5 0.5 Level 1-Low/Growth city_idle_walking
Drinking 30 0.3 Level 2-Moderate/Cognitive replenish_energy
Repairing 300 0.3 Level 2-Moderate/Cognitive repair_equipment
Deciding 60 3 Level 2-Moderate/Cognitive Only fires in adults king_check_new_city_foundation
Decreeing 10 1 Level 2-Moderate/Cognitive king_change_kingdom_language
Reforming 10 1 Level 2-Moderate/Cognitive king_change_kingdom_culture
Converting 10 1 Level 2-Moderate/Cognitive king_change_kingdom_religion
Mandating 10 1 Level 2-Moderate/Cognitive leader_change_city_language
Adopting 10 1 Level 2-Moderate/Cognitive leader_change_city_culture
Preaching 10 1 Level 2-Moderate/Cognitive leader_change_city_religion
Claiming 60 Level 2-Moderate/Cognitive claim_land
Reading 120 1 Level 2-Moderate/Cognitive Only fires in adults try_to_read
Looting 180 1.5 Level 2-Moderate/Cognitive Only fires in adults try_to_take_city_item
Crafting 90 0.4 Level 2-Moderate/Cognitive Only fires in adults make_items
Playing 5 0.1 Level 1-Low/Growth Only present in baby units child_random_flips
Playing 5 0.1 Level 1-Low/Growth Only present in baby units child_play_at_one_spot
Playing 5 0.1 Level 1-Low/Growth Only present in baby units child_random_jump
Moving 10 0.2 Level 2-Moderate/Cognitive child_follow_parent
Reflecting 60 2 Level 3-High/Survival family_check_existence
Following 5 0.7 Level 2-Moderate/Cognitive Only fires in herd creatures family_group_follow
Leaving 20 0.5 Level 1-Low/Growth Only fires in adults
Only fires in herd creatures
Only fires when not in combat
family_group_leave
Grouping 60 0.3 Level 3-High/Survival Only fires in herd creatures family_group_join_or_new_herd
Moving 200 0.8 Level 2-Moderate/Cognitive Only fires in herd creatures family_alpha_move
Healing 5 0.5 Level 2-Moderate/Cognitive check_heal
Summoning 10 0.5 Level 2-Moderate/Cognitive make_skeleton
Fertilizing 10 0.5 Level 2-Moderate/Cognitive spawn_fertilizer
Teleporting 20 0.5 Level 1-Low/Growth random_teleport
Teleporting Home 60 1 Level 1-Low/Growth teleport_back_home
Curing 15 0.5 Level 2-Moderate/Cognitive check_cure
Burning 10 0.5 Level 3-High/Survival burn_tumors
Moving 10 0.5 Level 1-Low/Growth random_move_towards_civ_building
Attacking 60 1 Level 3-High/Survival Only fires in mobs attack_golden_brain
Craving 5 4 Level 3-High/Survival follow_desire_target
Stealing 60 1 Level 2-Moderate/Cognitive try_to_steal_money
Existing 60 1.5 Level 2-Moderate/Cognitive try_to_poop
Judging 200 3 Level 3-High/Survival kill_unruly_clan_members
Banishing 200 3 Level 3-High/Survival banish_unruly_clan_members
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_flowers
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_fruits
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_crops
Eating 20 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_grass
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_vegetation
Eating 25 0.96 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_meat
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_fish
Eating 25 0.96 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_meat_insect
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_algae
Eating 60 0.3 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_same_species
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_nectar
Eating 25 0.96 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_blood
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_minerals
Eating 30 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_wood
Eating 10 1 Level 3-High/Survival Only fires when not in combat
Only fires when hungry
diet_tiles
Yearning 5 1 Level 1-Low/Growth boat_check_existence
Fleeing 5 1.25 Level 1-Low/Growth boat_danger_check
Idle 5 0.75 Level 1-Low/Growth boat_idle
Moving 15 1 Level 1-Low/Growth boat_check_limits
Fishing 1 1.3 Level 1-Low/Growth boat_fishing
Trading 1 1.3 Level 1-Low/Growth boat_trading
Searching 1 1.3 Level 2-Moderate/Cognitive boat_transport_check
Thinking 10 0.5 Level 2-Moderate/Cognitive Only present in civilized creatures check_city_destroyed
Marching 1 1.5 Level 2-Moderate/Cognitive warrior_army_leader_move_random
Attacking 1 2 Level 3-High/Survival warrior_army_leader_move_to_attack_target
Walking 20 1.3 Level 2-Moderate/Cognitive warrior_army_captain_idle_walking_city
Walking 20 1.5 Level 2-Moderate/Cognitive warrior_army_captain_waiting
Enlisting 5 3 Level 3-High/Survival warrior_try_join_army_group
Following 1 2 Level 3-High/Survival warrior_army_follow_leader
Investigating 5 2.7 Level 3-High/Survival city_walking_to_danger_zone
Traveling 6 2 Level 2-Moderate/Cognitive check_warrior_transport
Deciding 60 0.7 Level 2-Moderate/Cognitive check_warrior_limit
Moving 4 1.6 Level 1-Low/Growth warrior_random_move
Training 100 1.1 Level 2-Moderate/Cognitive warrior_train_with_dummy
Reflecting 100 2.5 Level 2-Moderate/Cognitive reflection
Hallucinating 60 2.5 Level 3-High/Survival madness_random_emotion
Raging 1 3 Level 4-Critical/Immediate do_tantrum
Possessed 1 3 Level 4-Critical/Immediate possessed_following
Pollinating 10 1.3 Level 1-Low/Growth pollinate
Moving 10 2 Level 1-Low/Growth random_swim
Running 1 5 Level 4-Critical/Immediate run_to_water_when_on_fire
Searching Hive 20 1.5 Level 2-Moderate/Cognitive Only fires in mobs bee_find_hive
Building Hive 200 1.5 Level 2-Moderate/Cognitive Only fires in mobs bee_create_hive
Cursing 60 0.1 Level 3-High/Survival check_swearing