Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: spike43884 on February 22, 2015, 07:50:14 AM

Title: [Request] Body Limiter Code
Post by: spike43884 on February 22, 2015, 07:50:14 AM
I really would love someone to make me a special body gene, I want to keep the bot to have Y body for every X nrg it has...to keep the body and nrg relative...
Its because im making a gender-based multibot.
Title: Re: [Request] Body Limiter Code
Post by: Shadowgod2 on February 22, 2015, 01:39:54 PM
really? i do that quite often. really easy.

cond
start
*.body *.nrg sub 0 floor .fdbody store
*.nrg *.body sub 0 floor .strbody store
stop

this will make the body and nrg =

cond
start
*.body *.nrg 1 sub sub 0 floor .fdbody store
*.nrg 1 sub *.body  sub 0 floor .strbody store
stop

this will make nrg 1 less than body. just modify 1 for your distance away from the other.

cond
start
*.body *.nrg 2 div sub 0 floor .fdbody store
*.nrg 2 div *.body sub 0 floor .strbody store
stop

this will make nrg half of body. just modify 2 for the difference.

move the modifier from the nrg to the body for the opposite effect. move the modifier don't change the nrg to body or body to nrg or you will have a big problem. it will either grow to death or shrink to death.

there you have it, very simple.
Title: Re: [Request] Body Limiter Code
Post by: spike43884 on February 23, 2015, 11:35:45 AM
So -2 will make nrg double of body right? As 2 made nrg half of body.
Title: Re: [Request] Body Limiter Code
Post by: Shadowgod2 on February 23, 2015, 05:03:01 PM
no if you want that change div to mult or do as i said above and move 2 div from nrg to body.
Title: Re: [Request] Body Limiter Code
Post by: spike43884 on February 24, 2015, 12:26:46 PM
no if you want that change div to mult or do as i said above and move 2 div from nrg to body.
OK