Darwinbots Forum

Code center => Suggestions => Specialization, Metabolism, Digestions and Env Grid => Topic started by: shvarz on March 18, 2005, 12:40:41 AM

Title: Metabolism part 1: Catabolism in animals
Post by: shvarz on March 18, 2005, 12:40:41 AM
OK, here is a very brief metabolism that we can already start using.  I decided to go with the barest minimum for two reasons:
1. Don't want to intimidate people
2. We can always add stuff later as a way to introduce balance/diversity.

As a result, what you'll see below is only about 0.1% of all reactions that are happening in our bodies.  I assume that we'll have carbs/protein/fat system.  These turn up in bot's stomach, and then are digested.  What follows below is description of how bots can use them to extract energy.  Theoretically all these reactions are reversible, meaning that they can be used to create carbs/protein/fat, but the energy required to make stuff is always more than you get when you destroy stuff.  It is especially true for proteins, which require 10 times more energy to make them, than energy that is released when you destroy them.

Another note:  I'll use ATP to keep track of how much energy is generated.  Simply assume that ATPs will be converted to nrg with some coefficient.

So here it goes:

CARBS
' Note: carb degradation is the major route of energy production.  Fats and proteins join in as small streams join big river.

carb+7 H20=8 glucose
glucose = 2 pyruvate + 2 H2O + 8 ATP
pyruvate + 1.5 O2 = AcCoA + CO2 + 3H20 +6 ATP
AcCoA + 2 O2 = 2 CO2 +12 ATP

FAT

fat + ATP = fatCoA
fatCoA +7 O2=8 AcCoA + 42 H2O + 35 ATP
(see above for fate of AcCoA)

PROTEIN

protein = 8 am.acids
am.acid = pyruvate + NH4
(see above for fate of pyruvate, see below for fate of NH4)

NH4
'Note: This is very-very toxic.  If bot does not get rid of it, it gets really messed up.  It cannot be directly thrown out, it has to be converted to urea.

2 NH4 + CO2 + 3 ATP + H2O = urea
(urea is basically "waste", it can be discarded as such).

Final summary of how much energy you get from each type of food:

1 fat = -1+35+8x12=130
1 protein = 8x6+8x12-4x3=116
1 carb = 8x36=288

P.S: As I said, this is only the barest possible basics.  We can add more steps everywhere.  Two possible reasons to do that: a) make sim more complicated, leading to bigger diversity and b) balancing issues - adding more steps means that it takes longer to digest and requires more enzymes.
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 06:06:51 AM
Great stuff.

I thought fats give more energy than carbs.  Or is it just that the same amount of energy stored in fat takes up less space?

Keep in mind that all the reactions will probably need to be backward compatible.  So if we have A -> E +nrg and then later add A + B -> C, C+D->E + nrg we will still need to keep the A -> E reaction unless we want old bots to break.

But I think we could probably change the amount of energy a reaction gives without hurting anything.  if A->E + nrg turns into A->E + 1/16 nrg old bots will still work, but there's incentive to figure out the old way.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 09:06:13 AM
So far we only seem to be looking at animal metabolism.

What about plants? they work in a slightly different way. They store cellulose and woody lignins as their body mass.

If we want to model real life then we have to allow robots to become plants too.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 09:58:17 AM
Catabolism is breaking down glucose and sugars, etc. for energy.  Photosynthesis and chemotrophy will probably be forthcoming.  Hence: 'part 1'.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 10:08:59 AM
That wasn't quite what I meant.

My point is that it takes entirely different digestion processes (and enzymes) to digest meat than it does to digest grass.

This means that robots can further specialize in eating veggies or hunting other "meat", Something totally lacking in the present system.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 10:18:03 AM
I'm a little unsure what you're getting at then.

Are we talking about the process of eating or are we talking about digesting once the stuff's in your stomach?
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 10:28:40 AM
We are talking about digestion I guess since shots will do damage to both plants and animal unless we actually put the enzymes in the shots instead of stomach.

(Now there is an interesting thought. Make a shot contain all enzymes that a robot has so that returned shots are all pure energy in one form. That way if you don't have the right enzyme you can't damage the target. But that is a completely different issue.)

Anyway my point is that full fledged veggies that use photosynthesis would store their bulk as cellulose or lignin rather than proteins and fats that animals store. They also can't spend down their body mass for energy either.

A shot that hits a 100% veggie is only going to return bits of wood and cellulose molecules which many robots would be unable to digest.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 10:37:18 AM
The question is do we want to make plants unable to produce fats, or simply make it in their best interest to produce carbs.

I have thought cursorally of things like cellulose and lignin, but I'm not sure how we'd implement it.
Title: Metabolism part 1: Catabolism in animals
Post by: shvarz on March 18, 2005, 10:39:51 AM
Quote
I thought fats give more energy than carbs. Or is it just that the same amount of energy stored in fat takes up less space?

Yeah, I had to adjust that a bit.  But it did not break the "sizes vs energy vs weight" balance (as I described in "Physical sizes" thread).

Quote
But I think we could probably change the amount of energy a reaction gives without hurting anything. if A->E + nrg turns into A->E + 1/16 nrg old bots will still work, but there's incentive to figure out the old way.

Good idea!

Quote
What about plants? they work in a slightly different way. They store cellulose and woody lignins as their body mass.

Darn it, you are right PY.   :(   More balancing issues  :angry:   I hate these.  Guys from Blizzard have to deal with 3-4 races, I am balancing the whole freaking universe  :help:   And most biochem books go only briefly into the plant metabolism, so I have to find a good book, bleah :blueblob:

Quote
A shot that hits a 100% veggie is only going to return bits of wood and cellulose molecules which many robots would be unable to digest.

I betcha a tiger can lash out at an innocent tree and tear to to pieces.  Just like a bull can take out a wolf.  Does not mean they have to be able to digest them :)
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 11:01:44 AM
Quote
Darn it, you are right PY.   :(   More balancing issues  :angry:   I hate these.  Guys from Blizzard have to deal with 3-4 races, I am balancing the whole freaking universe  :help:   And most biochem books go only briefly into the plant metabolism, so I have to find a good book, bleah :blueblob:
Welcome to my own personal hell for the last 3 weeks, schvarz.  I don't think anyone's tried to compile all the reactions together into one place before.  Or if they have it's not widely accessible.

The more I think it over the more I think -1 shots will remain unchanged (that is, they drain energy) but -6 shots, as PY suggested, will shoot enzymes at the bot that digest it a bit and return an energy shot.

That way bots can kill anything they want but can only feed from appropriate sources.  Should stop bots from shooting everything in sight without regard to how tasty it'll be, while still allowing bots to be vindictive if they like.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 11:20:17 AM
So you think that digesting prior to actually feeding may be a good idea?

I think it might make stuff simpler to work with since robots will only actually receive an energy shot instead of a bunch of stuff which might or might not be digestable. More like shooting out a glob of saliva then taking back the digested food. It still isn't going to be easy to work out but it might weel discourage robots from trying to feed on stuff that they just don't get a return from.

As you say the -1 shot can be more of a weapon that a feeding method, giving limited or no food back in return

This really is a minefield isn't it?

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 11:25:34 AM
That's why I keep putting off coding it.  I keep coming up with new things that improve things a little, but drastically change how it works.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 11:54:20 AM
Backward compatability is an issue too.

We really don't want all the old bots to be useless lumps that are unable to survive without massive DNA surgery.

That is why I thought of using the shots to digest the target rather than internal enzyme control.

Never mind what is in the stomach. Just leave that the way it is now. Bots eat energy simple as that.

Just put all available enzymes in the shot and work out the reaction when the shot hits something then send back the appropriate amount of pure energy.

You don't have to worry about regulating the enzymes too much that way.

Same thing applies to e-grid reactions. Just assume that all possible enzymes are present in exactly the right proportions to get the job done. If a bot is capable of making enzymes to metabolise sunlight and CO2 into cellulose, energy and O2 then it just has to do that based on the proportions of those things that are present in the e-grid square that the bot currently resides. Remove whatever needs to be removed from that e-grid square and dump the O2 back into it.

There really doesn't need to be that much complexity.

Keep the present form of internal controls so that a bot can store protein or fat with a simple DNA command. never mind stoichiometrically balancing the chemistry. We simpy don't need it. If a bot wants to convert fat to energy then simply assume that all the necessary balancing has been done and give it the damned energy already!

Complexity is fine but let's not get too carried away here. We don't have to model every electrolyte reaction to know if we are dehydrated or hungry.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Botsareus on March 18, 2005, 11:55:32 AM
"That's why I keep putting off coding it. I keep coming up with new things that improve things a little, but drastically change how it works. "

....I was afraid of that....
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 11:56:44 AM
HUNGRY!

Now there is a thought.

How about we introduce a sysvar that tells us how hungry a bot is.

I know we can model it now from DNA but it might be more fun if we have it directly linked to the size of body or the average energy consumption rate. We could even automate fat spend-down if a robot is very hungry.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 12:09:58 PM
What would hunger be, mathematically speaking?

Maybe it's the percentage of total energy (that includes fats and carbs, etc.) that's left n turns after the last time it ate?

There are some problems with that though...

I like the idea of moving digestion away from inside the bot.  The only point: before I was going to have it so food sat in the stomach a while before getting digested (the enzymes have a fixed amount they can digest per cycle).  That way we could model 'full'.  As in "I'm stuffed.  I couldn't eat another bite...  KABLOOIE!"

In this new system that's a little harder.  Maybe bots still have a set rate at which they can absorb energy per cycle into their bodies.  Then the stomach is just a depository of 'food' awaiting digestion into 'nrg' at a 1:1 ratio.  The rate of that digestion would be something up to the specialization system with muscles instead of the digestion system with enzymes.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 12:32:18 PM
Quote
In this new system that's a little harder. Maybe bots still have a set rate at which they can absorb energy per cycle into their bodies. Then the stomach is just a depository of 'food' awaiting digestion into 'nrg' at a 1:1 ratio. The rate of that digestion would be something up to the specialization system with muscles instead of the digestion system with enzymes.

I like that thought. A secondary energy depository of limited size would be kind of cool. When it gets empty then the robot gets hungry

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 01:04:37 PM
The only question of course is how big is the stomach?  What's the maxiumum it can hold.

Or we can make food degrade in the stomach the longer it's there.  Some kind of half life.
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 01:13:56 PM
Fuller it gets, faster it works?

No I don't really like that.

The size could just be anything initially but it should be mutatable so that some robots can hold a larger reserve than others. Maybe we can just set in in DNA like the enzymes.

Also make the diffusion rate from storage to usable energy, variable and mutatable.

Get the energy faster but lose some. Get it slowly and get all of it.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: shvarz on March 18, 2005, 01:16:02 PM
Guys, guys, don't go away from all these ideas we had!

I had a breakthrough idea, it is all going to work juuuuust fiiiiiineee!
Title: Metabolism part 1: Catabolism in animals
Post by: PurpleYouko on March 18, 2005, 01:21:15 PM
The thing that I really don't want to have to do is to control every reaction directly from the DNA.

I think that would make the whole program extremely cumbersome and would discourage most people from using it at all.

We have to remember that DB needs to appeal to Bot Battle gamers as well as evolution simulators.

I also don't want to lose all the existing bots because they have none of the necessary controls to metabolize the food supply.

I am fine with these new ideas but let's just not get too overcomplicated with the stuff that the DNA files actively handle.

 :D  PY  :D
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 01:29:43 PM
Okay, imagine it's turn 0, your stomach has 100 food, you can digest at 2/cycle (you digest faster by allocating more muscles to the task), and food has a half life of 10.

So, after 10 cycles some food is lost to decay (Less than 50.  I'm not sure of the exact amount, there's some calculus involved, isn't there.) and 20 nrg is digested.  

So if you eat too much, alot of food is just lost because you can't digest it, which means you wasted the effort you spent to get it in the first place.
Title: Metabolism part 1: Catabolism in animals
Post by: Numsgil on March 18, 2005, 01:32:40 PM
I agree with PY.  I'm willing to explore and and all paths, but it must be easily handled by the bot if this is to work at all.
Title: Metabolism part 1: Catabolism in animals
Post by: shvarz on March 18, 2005, 01:49:49 PM
Don't have a cow, it will be easy.  :)

Ideally it should be easy to learn, difficult to master.  We'll have a basic set of genes that would allow bots not to care to much about metabolism, except for the fact that there energy can be converted to stuff with different properties, like fat, carb, protein, muscle, shell, slime, venom, poison, lignen, chitin and so on...

These will be copy-paste genes/enzyme sets.  You just decide:  In my bot I want to have muscle and venom, then choose the set and copy/paste the stuff at the end of your genome.  

if you want to get fancy - evolve stuff or dig in and learn.

Would that work for you?