Author Topic: Numsgil's Super Cool Specialization System  (Read 6791 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« on: February 23, 2005, 07:04:51 PM »
Aright, this is the system I wanted to implement.  Whatever the final version is, this should be a subset of it, the way Newtonian Physics is a subset of general relativity.

Food is divided into 'bits'.  Food is combined into the stomach of a bot.

Here are the food bit types:

Code: [Select]
Public Type StomachMouth
  Amount As Single 'how much stuff is actually in our stomach.
                   'used for calculating ratios
  
  Waste As Single 'chloroplasts in the presence of waste will use the waste up and become more productive
  nrg As Single
  light As Single 'silly, yes, but this is how plants will receive nrg from light
  protein As Single
  muscle As Single
  fat As Single
  Poison() As Poisontype 'we can have more than one type of poison in our stomach
  Venom() As Poisontype
  Slime As Single
  CalciumShell As Single
  SilicateShell As Single
  carbs As Single
  calcium As Single 'most of the time this will pass right through
  sand As Single 'Si2, this too shall pass
  SH2 As Single 'for black smokers
  SO4 As Single 'ditto
End Type

Look into the 'Energy Types and Stomachs' thread in the old forum.

Now, each bot has an enzyme array that it uses to digest foods.  The more enzymes you have, the more food you can digest at any given moment.

Light and photosynthesis are treated as a special case of this digestion process.

A bot recieves light into its stomach based on its surface area.  Light is removed from a bots stomach at the end of a cycle.  An enzyme called chloroplast converts light to nrg.  It is more productive in the presence of waste.



At the other end of the spectrum, each bot has a muscle array.

The strength of an action is determined by a heirarchy of muscles.

At the top you have general muscles.  These can perform all tasks.

Next you have group muscles.  These can only perform general tasks like movement and tie commands.

A list of all group areas:

Movement,
Shots,
Production and Metabolism
Digestion
Ties

Last you have specific muscles.  These can only affect a single command.

The strength of an action is determined by:

General Muscles + Group Muscles * 2 + Specific Muscles * 8

The coefficients are still undetermined, but you get the relative strengths.  The idea is that trying to specialize in all areas at once is less efficient than specializing in a few areas.

Now, each muscle can fire harder and harder, but it costs more and more energy.

Something like cost = 2 ^ Muscle Strength.

Each specialized muscle counts as 8 general muscles, etc.  You get the idea.

Desired Effect / (General Muscles + Group Muscles * 2 + Specific Muscles * 8) = Muscle Strength.

That is, Muscle Strength is used in cost figuring:

(General Muscles + Group Muscles * 2 + Specific Muscles * 8) * 2 ^ (Muscle Strength) = cost of action.



Muscles can be easily destroyed and turned into protein, but they take a long time to build up, and take alot of energy.  Muscles are split between parent and daughter cells during reproduction, so daughter cells inherit the specialization of the parent cell.

So for a cell to change anything about its specializations takes a long time and alot of energy, but is still possible since the mechanical mechanisms of the cell were never abandoned, just turned off.



That's it.  It's not quite finished.  Add your bits to complete the puzzle.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #1 on: February 23, 2005, 11:36:25 PM »
MECHANICS

Aright, this part is Anon Guest Person and me working together for an hour or two (he can post after I'm done if there's a point not agreed on:

All game sysvars are divided into groupings called 'mechanics'.

Definition: [you]Mechanics[/you] - a grouping of similar commands and reference variables

Definition: [you]Specializations, or specs[/you] - the more mechanics that are turned off, the more specialized the bot is said to be.  The collection of which mechanics are on/off are said to be the bot's specializations.

Mechanics can be turned on/off.  DNA files have lines at the start that set mechanics as on/off.  Children bots inherit the specializations of their parents.  The spec code at the start of the DNA represents the specs the bot inherited from its imaginary parent. Bots can change specializations by turning on/off mechanics but it isn't cheap.

Here's a possible example of the spec code at the start of DNA.  If something isn't turned off it defaults to on, for backward compatibility with older bots.

Code: [Select]
disable ties
disable poison
disable venom

It's just that easy!

To turn on/off mechanics during the simulation, a robot uses a setmech and strmech couple, not unlike the memloc/memval couple.

example:

15 .setmech store
1 .strmech store

This will turn on mechanic number 15.  We can make a set of sysvars that label the different mechanics with numbers.

It is expensive to turn on/off mechanics (the degree of this expense is still debated by Anon and me.  Input welcome).  I'd say something like 15000 energy to enable a mechanic, 10000 energy to disable and several hundred cycles for the changes to take effect. (with safeguards in the program to prevent abuse by weapons, somehow).

Anon wanted a much, much easier way to change specualizations (I believe).

If we go more expensive, we may opt for a piece-meal system to enable/disable mechanisms.

Now, the more mechanics you disable the higher your mechanics multiplier is.

Definition [you]Mechanics Multiplier[/you] - A multiplying force to all actions.  The higher it is the less actions cost or the stronger they are (depends on the action).  The rough shape of this Mechanics multiplier is (mechanics multiplier = a * b ^ (disabled mechanics)

Why have a mechanics multiplier?  It simulates the way some eukaryotic cells have lost the ability to move but used the old cillia mechanisms for other purposes.  This should help multibots' cells differentiate, as there is a strong incentive now.


MUSCLES

An analogy is in order.  Mechanics are like bones.  You must have an arm bone to have an arm, but the bone itself does nothing.

This is where muscles come in.  Muscles attach to the 'bone' of the mechanics, allowing actions.

The strength of an action is determined by a heirarchy of muscles.  At the top you have general muscles. These can perform all tasks that aren't disabled by a disabled mechanic (no bone, no muscle).

Next you have group muscles. These can only perform the actions of a particular mechanic (like a bicep of your arm).

Last you have specific muscles, that control a single command (like the muscles controlling your index finger).

Look above for more on muscles.  The only difference is the mechanics multiplier, which makes muscles stronger.


DIGESTION

Last, but not least, we have digestion.  The same mechanics/muscle system applies here but at a much more specialized level.

Each energy type gets its own enzyme.  Enzymes are the equivelant of muscles.  You can have generalized enzymes and specific enzymes.

Definition [you]Enzyme Template[/you] - The mechanism which produces a particular enzyme.

These enzymes are made from enzyme templates, which are analogous to mechanics.  If you disable an enzyme template, the remaining enzymes are made more efficient.  This represents the machinery for one enzyme's production being moved to the other enzyme production machinery.  This will create a strong incentive for specialized feeding.

Again, look above for more on enzymes.



The beauty of the above system is all the marks it passes.

It fulfills both practice and birth specializations.  It allows bots to be as generalized or specialized as they want in feeding, while providing incentive to be specialized.  It allows bots to become plants and vice-versa through painful, long evolutionary processes.

Still a few fine points to smooth out, but I think we have an all around system that fullfills all the necessities of a proper system.

I've included the mechanics' groupings Anon worked out.  There are about 35 groups he's worked out.  I haven't cracked my knuckles yet, I may suggest combining some groups together.
« Last Edit: February 23, 2005, 11:37:20 PM by Numsgil »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #2 on: February 23, 2005, 11:57:37 PM »
This is a subset of the above that I thought about after a while.

Instead of having the mechanics be only on/off, we could also define them as a string of bits.  These bits represent the actual DNA coding for the mechanics.  Mutations can change these bits.

If a bit system changes, it can either increase or decrease in efficiency.  The efficiency of a bit system is determined by some kind of hash function, so the changes appear to be random to the bot.

Bad mutations are weeded out.  Good ones are rewarded with more efficient (ie: an increase in the mechanics multipier) muscles.  Slowly you'll see bots begin to produce better and better mechanics.

Bots can still disable mechanics to increase the multiplier.  This short little bit system would effect the efficiency of those mechanics.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #3 on: March 05, 2005, 11:00:41 PM »
In general I like this idea, because it mirrors my idea of specialization.  What I don't like is things like
Quote
15000 energy to enable a mechanic, 10000 energy to disable and several hundred cycles for the changes to take effect

It's just too... artificial.  The "turning on/off" needs some more thought.  My vote would be to count how many times a given mechanic is used and set a counter for that.  The more you use something, the easier/cheaper it gets.  So that using .up would increase the counter for ".up", but also for the whole "movement".  Kind of like what Nums had with hierarchy of muscles.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #4 on: March 06, 2005, 04:53:13 AM »
The practice specialization would be mirrored in the muscle hierarchy.  You build muscles on mechanics you use.  So it's kind of a manual specialization.

I'm not sure how turning on or off mechanics would work yet.  We need to balance the fact that multicellular organisms specialize by changing their structure, and that unicellular organisms tend to be more generalized.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #5 on: March 07, 2005, 11:51:57 AM »
Even for multicellulars changing of structures comes from regulation of gene expression.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Numsgil's Super Cool Specialization System
« Reply #6 on: March 07, 2005, 12:10:14 PM »
outh , really complex type there...
Please dont make it complexer :)
« Last Edit: March 07, 2005, 12:10:53 PM by Botsareus »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Numsgil's Super Cool Specialization System
« Reply #7 on: March 07, 2005, 12:14:57 PM »
Quote
Even for multicellulars changing of structures comes from regulation of gene expression.
But how the heck do we model it without getting so complex that nobody could ever write the DNA code?

We gotta get arbitrary at some point I think.

 :unsure:  PY  :unsure:
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #8 on: March 07, 2005, 12:30:54 PM »
I think my counter system would work for that.  Remember, the counters will give [relative] efficiency to other things, not absolute.  

Efficiency of A~ A/(A+B+C)
Efficiency of B~ B/(A+B+C)
Efficiency of C~ C/(A+B+C)

You have functions A, B and C.  Use only A - it will make A better, B and C - worse.  Then stop using A and start using B - first it will suck, but as the counter reaches counter of A - it wil get better and better, until B is done better than A.  C is not used at all, so it is really expensive to start using it.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Numsgil's Super Cool Specialization System
« Reply #9 on: March 07, 2005, 01:24:50 PM »
Yes I quite like your counter idea.

It is good that it also allows us to keep rarely used genes functional too by expending a little energy in the right places.

 :D  PY  :D
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #10 on: March 07, 2005, 02:42:43 PM »
I'd really like to seperate the DNA and the specializations as much as possible.  Real life forms define everything about themselves through their DNA.  In DB, only behavior is determined in the DNA.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #11 on: March 07, 2005, 02:50:47 PM »
Huh, what do you mean Nums?  What else do you see as driving force of specialization if not DNA?  You worry me  :huh:
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7713
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #12 on: March 07, 2005, 03:21:19 PM »
No, I mean that specialization shouldn't affect behavior, only mechanics.  If you've specialized in turning left, it means you're body has.  It doesn't mean you yourself have ever turned left in your life.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #13 on: March 07, 2005, 03:37:52 PM »
But in DB behaviour is the form and shape of a bot.

Besides, how (and why) would I specialize in turning left if I never turn left in my life?

You are getting me confused Nums...

Consider this:  Even in real life, specialization can be viewed as behaviour of cells.  If you work out a lot, your muscles get bigger - look at it as if your body "decided" to invest more in production of muscles.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Numsgil's Super Cool Specialization System
« Reply #14 on: March 07, 2005, 03:42:22 PM »
Maybe I should repeat this again.  There are two types of specialization and it seems like some people confuse the two.

Specialization 1: evolutionary adaptation to a specific environment.  We already have that in DBs.  We have genes, they mutate, the best one survives and is more adapted to its environment.

Specialization 2: DNA codes for several possible scenarios for organism and depending on its environment the organism chooses one of the paths at the expense of not being able to choose others.  This we don't have and this is what we need!
"Never underestimate the power of stupid things in big numbers" - Serious Sam