Author Topic: Mini-eco  (Read 6336 times)

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Mini-eco
« on: December 19, 2005, 11:14:41 PM »
I want to make a small ecosystem with veggy, herbivore and a carnivore.  Someone tried that before with ursus bots, but it was not a very robust ecosystems, because the guy who made it could not make very efficient bots.  I figured I'll take some good exisitng bots and make "herbi" hunt only "veggies" and "carni" to hunt only "herbi".

I'll disable mutations, so this is specifically about creating an ecosystem, not dong any evolution.

The plan is to have a fairly small system (size 3 field) with about 100-300 veggies, 50-100 herbis and 20-50 carnis.  To make things easier to follow I want to have herbi that feeds only through ties.  And carni that feeds only through shots.  

So, could someone recommend good bots that use only one but not the other?  I wanted to look up in database, but it seems like it went down at some point.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Mini-eco
« Reply #1 on: December 19, 2005, 11:47:54 PM »
I honestly don't think I know of any bots that have ever been made that are exclussivly carnie(there was a SG herbi once). The problem with carnis is that initially there is no real prey to eat. I just barely got a cycle started with Mutbot and mainly only through it's phenotype nature.

It wouldn't be too hard to design one though, the bot just has to eat anything with a refeye greater than zero and not equal to it's own. The herbi would be similar just eat anything with a zero refeye.

You'll need to worry about over hunting by the carnies. Perhaps a faster repro rate would make up for this along with their higher nrg feeding levels.

Probably want to add nrg firing corpses to the mix, this allows a bot to "feed" via proximity(no ties or shots); allowing another rung in the ecosystem ladder.
« Last Edit: December 21, 2005, 09:27:52 PM by Endy »

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Mini-eco
« Reply #2 on: December 19, 2005, 11:57:53 PM »
Yes, I imagine it would be fairly easy to make them hunt a certain species exclusively by using ref commands.  I'm mostly interested in a bot that feeds only through ties.  There are plenty of shot-only bots, but I don't know of any tie-only.  

Reproduction and energy flow is what I'm planning to tweak to make the system stable.  Carnies would have to be pretty tough creautures to be able to survive fairly long periods of starvation.  But then they don't have to go searching for food, as prey will run by them now and then, so they can sit tight and conserve energy.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Mini-eco
« Reply #3 on: December 20, 2005, 12:43:26 AM »
Sharer, Tie feeder, or both?

Sharers would be the easiest from an eco point of view. The carnies could defend against accidental "attacks" easily and the herbi itself could deltie before feeding on a non veggie. Sharers are also generally weaker than shot bots so the relationships should fall into place easier.

I'll see about making some bots. I haven't really tried making anything truly complex recently; mainly just deliberatly simplistic evobots. :)

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Mini-eco
« Reply #4 on: December 20, 2005, 01:44:45 AM »
I thought a bit about this and now I think that with small modifications I can make a sim stable enough even for evolution.  The three species will be:

1. Alga minimalis making a lot of shell, so that it is resistant to shots.

2. Tie-feeding herbivore, unable to shoot.  Runs around eating veggies and reproducing to fairly high numbers.

3.  Shot-feeding carnivore, sits in one place waiting for herbivore to run by.  Can brake ties so that herbi can't attack it.  Very good and efficient bot, reproduces rarely and can survive long periods of starvation.

These three species are in such a relationship that it is very difficult for them to move outside of their ecological niche.  So I think evo-sims are possible.

Endy, if you want to make bots specifically designed for this, go ahead.  I was thinking about modifying some existing ones, but I need advice on which are the good bots and may need some help in modding them to my needs.  

Looks like "hunter 2.3" is the leading bot in F2, but I don't think it uses ties, I think it mostly uses shots.  So that one (if tie-usage is completely removed) can be the predator.  

I can make shell-making alga on my own.

But I need some bot-makers to recommend (or make) a good tie-feeding bot.  Anyone?  Don't be shy :)
« Last Edit: December 20, 2005, 01:47:06 AM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Mini-eco
« Reply #5 on: December 20, 2005, 01:21:15 PM »
Quote
Looks like "hunter 2.3" is the leading bot in F2, but I don't think it uses ties, I think it mostly uses shots. So that one (if tie-usage is completely removed) can be the predator.

Hunter doesn't use ties at all.  that is why he is in F2 where ties are not allowed.

For a good tie feeder, try  using Carnatus Orbis and disable or remove his shot gene. This robot is good because it stores a lot of food as fat and can survive lean times quite well.
Add some kind of control gene to limit him to eating veggies and you will have a good herbivore.

You could also use HDV4 but he is a lot less energy efficient.
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
Mini-eco
« Reply #6 on: December 21, 2005, 04:14:12 PM »
Got it!  

Now, how do I make them go after each other in the right order, so that Carnatus hunts only Alga and Hunter 2.3 hunts only Carnatus?  I know it has something to do with .refeyes, but it would take me forever to figure the details out.

Here are the DNAs as I have them, please advise what I need to change:

Alga Shellular:

Code: [Select]
' Alga shellular
'
' Vegetable
'
' Modification of Alga minimalis
' able to create shell.

cond
  *.nrg
  6000
  >
start
  50
  .repro
  store
  15
  .aimdx
  store
stop

cond
*.shell < 100
start
10 .mkshell store
stop

end

Carnatus Orbis:

Code: [Select]
' Carnatus Orbis (Fat Circle)
' Obese son of HDV4
' By PY.
' Basic F1 tie feeder with body controls

def feed 70
def feedrate 71
def tietag 72

'reproduce
'***********
cond
*.nrg *60 >
*.body *61 >
*.eye5 0 =
start
20 .repro store
2 50 store
150 .aimdx store
stop

'initialize
'*********
cond
*.robage 0 =
start
.shoot .ploc store
2000 60 store
200 61 store
.tie inc
*.myeye .refeye store
.tienum .vloc store
999 .venval store
stop

cond
*.robage 1 =
start
.deltie inc
628 .aimdx store
stop

cond
*60 30000 <
start
60 inc
61 inc
stop

' move forward
'****************
cond
*.eye5 60 <
*.robage 0 !=
*.vel 20 <
*.numties 0 =
start
5 .up store
stop

cond
*.eye5 0 >
*.eye5 50 <
*.refeye *.myeye !=
*.numties 0 =
start
*.maxvel *.vel sub .up store
stop

'turn towards food
'*************************
cond
*.eye5 0 =
*.eye1 *.eye9 !=
start
mult
*.eye9 *.eye1 sub 4 mult
stop

cond
*.eye5 30 <
*.eye2 *.eye8 !=
start
mult
*.eye8 *.eye2 sub 3 mult
stop

cond
*.eye5 40 <
*.eye3 *.eye7 !=
start
mult
*.eye7 *.eye3 sub 2 mult
stop

cond
*.eye5 70 <
*.eye4 *.eye6 !=
start
mult
*.eye6 *.eye4 sub
stop

'avoid conspecifics
'*********************
cond
*.refeye *.myeye =
*.eye5 20 >
*.robage 0 !=
start
mult
280
stop

cond
start
.aimdx store
stop

cond
*.tiepres 0 !=
'*.tietag 0 !=
start
.feed inc
.tietag inc
stop

cond
*.feed 1 =
start
-3 .tieloc store
25 .tieval store
*.tiepres .tienum store
stop

cond
*.feed 1 >
start
-1 .tieloc store
-3000 .tieval store
*.tiepres .tienum store
stop

cond
*.refeye *.myeye !=
*.eye4 *.eye6 =
*.eye5 40 >
*.numties 0 =
start
500 rnd .tie store
'.tietag inc
stop

cond
*.feed 0 >
*.numties 0 =
start
0 .feed store
'0 .tietag store
stop

'shooting genes disabled
'cond
'*.refeye *.myeye !=
'*.eye5 50 >
'*.refpoison 0 =
'start
'-1 .shoot store
'stop

'cond
'*.refeye *.myeye !=
'*.eye5 50 >
'*.refpoison 0 >
'start
'-6 .shoot store
'stop

cond
*.nrg 1000 >
*.poison 5000 <
start
10 .strpoison store
stop

cond
*.nrg 100 >
*.venom 100 <
start
10 .strvenom store
stop

cond
*.nrg 800 >
start
100 .strbody store
stop

cond
*.waste 100 >
start
*.waste .shootval store
-4 .shoot store
1 .backshot store
stop

end

Hunter 2.3:

Code: [Select]
'New generation Hunter bot for V 2.36
'***********************
def newmom 51
def spin 52
def spincount 53
def replevel 54
def heading 55
def venomcounter 56


' Initialize
' *********
cond
*.robage 0 =
start
.tie inc
602 .memloc store
*.aim .heading store
100 .replevel store
.shoot .ploc store
.shoot .vloc store
-2 .venval store
stop

cond
*.robage 1 =
start
.deltie inc
stop

cond
*.nrg 1000 >
start
100 .strbody store
stop

cond
*.nrg 300 <
start
100 .fdbody store
stop

cond
*.eye5 0 =
*.refeye *.myeye !=
*.spin 0 =
start
20 *.vel sub 4 div .up store
stop

cond
*.eye5 60 <=
*.eye5 0 >
*.refeye *.myeye !=
*.vel *.maxvel <
start
*.maxvel *.vel sub 2 div .up store
stop

cond
*.eye5 60 >
*.refeye *.myeye !=
start
*.refvel .up store
stop

'turn towards enemies or food
'*************************

cond
*.eye1 *.eye5 >
*.eye1 *.eye9 >
start
mult 140
stop

cond
*.eye9 *.eye5 >
*.eye9 *.eye1 >
start
mult -140
stop

cond
*.eye3 *.eye5 >
*.eye3 *.eye7 >
start
mult 90
stop

cond
*.eye7 *.eye5 >
*.eye7 *.eye3 >
start
mult -90
stop

cond
*.eye4 *.eye6 >
start
mult 50
stop

cond
*.eye6 *.eye4 >
start
mult -50
stop

cond
*.eye4 *.eye6 =
*.eye3 *.eye7 >
start
mult 20
stop

cond
*.eye4 *.eye6 =
*.eye3 *.eye7 <
start
mult -20
stop

'avoid conspecifics
'****************************
cond
*.refeye *.myeye =
*.spincount 0 =
start
1 .spin store
10 rnd 5 add .spincount store
stop

cond
*.refeye *.myeye !=
*.spincount 0 !=
start
0 .spincount store
stop

cond
*.spincount 0 >
start
.spincount dec
mult 75
stop

cond
*.spincount 1 <
*.spin 1 =
start
0 .refeye store
0 .spin store
stop

cond
*.refeye *.myeye =
*.eye5 60 >
start
mult 628
stop

' Spin back after repro
' ************************
cond
*.newmom 0 !=
start
mult 628
0 .newmom store
stop

'reproduce
'*********
cond
*.nrg 2000 >
*.robage 40 <
*.body 20 >
*.eye5 30 <
start
20 .repro store
1 .newmom store
mult 628
stop

cond
*.nrg 2000 >
*.robage 40 >
*.body *.replevel >
start
50 .repro store
1 .newmom store
*.replevel 4 mult .replevel store
mult 628
stop

'If I get shot
'***********
cond
*.shdn 0 !=
*.shdn -2 !=
start
mult 628
stop

' rotate
' *******
cond
*.heading *.aim !=
start
mult 0
stop

cond
*.robage 0 !=
start
*.heading add .heading store
*.heading .setaim store
stop

cond
*.veldx 0 !=
*.spin 0 =
*.refeye *.myeye !=
*.eye5 0 !=
start
*.refveldx .dx store
stop

'shoot at enemy
'******************
cond
*.eye5 5 >
*.eye5 45 <=
*.refeye *.myeye !=
start
200 *.eye5 div 3 add -1 mult .shootval store
-6 .shoot store
.venomcounter inc
stop

'cond
'*.eye5 45 >
'*.refeye *.myeye !=
'*.refpoison 0 =
'start
'20 .shootval store
'-1 .shoot store
'stop

cond
*.shdn 0 <
start
.backshot inc
stop

cond
*.eye5 55 >
*.refeye *.myeye !=
*.refage 0 >
*.newmom 0 =
start
50 .shootval store
-6 .shoot store
.venomcounter inc
stop

cond
*.venomcounter 20 >
start
-3 .shoot store
50 .shootval store
0 .venomcounter store
stop


cond
*.fixed 0 !=
start
0 .fixpos store
stop

'delete ties
'*********
cond
*.numties 0 >
*.tiepres 1 =
start
1 .deltie store
stop

'Poison
'*********
cond
*.poison 200 <
start
20 .strpoison store
stop

cond
*.venom 200 <
start
20 .strvenom store
stop

'Leach
'********
cond
*.numties 0 >
start
*.tiepres .deltie store
.tieval .tieloc store
'1000 .tieval store
stop

cond
*.heading 1256 >
start
*.heading 1256 sub .heading store
stop

cond
*.heading 0 <
start
*.heading 1256 add heading store
stop

end

Thanks in advance!
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Mini-eco
« Reply #7 on: December 21, 2005, 05:28:47 PM »
Code: [Select]
cond
*.refeye *.myeye !=
*.eye4 *.eye6 =
*.eye5 40 >
*.numties 0 =
start
500 rnd .tie store
'.tietag inc
stop

This is the gene that tells the Fat Circle what to shoot ties at.
Right now it is set to fire at anything that isn't a conspec.

To make it shoot only veggies, change it for this.

Code: [Select]
cond
*.refeye 0 =
*.eye4 *.eye6 =
*.eye5 40 >
*.numties 0 =
start
500 rnd .tie store
'.tietag inc
stop

Since your veg has no eyes this should work fine.

The problem is that it will still chase the carnies unless we change a bunch of other stuff. We need to make him run away from anything with eyes but not a conspec. That will be trickier. Just try it with veggie feeding first. I will see if I can find time to design you a true herbivore in a day or two.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Mini-eco
« Reply #8 on: December 21, 2005, 09:27:28 PM »
I've played around with a fleeing veggie before and got decent results by just reversing the attack genes from Din. Something similar shouldn't be too hard to accomplish.

I'm working on a herbi-carnie duo myself and having some trouble stabalizing the balance between the two. I got the carnie and herbie to hunt appropiatly, but one will still defeat the other.

At first the carnies would repeatedly defeat the herbies. When I moded the herbie to share feed it actually defeated the carnie due to their tied spinning formations.(imagine trying to jump onto a carousel, the bots felt like you would) :lol:

Additional hunting skills might help the carnie but, the main issue that I can see is that one is relying upon the other exclusivly for nrg. The carnies also don't fight each other for food and so will overhunt the herbies. Perhaps adding another carnie and some form of infighting to the mix will help.

I can certainly understand the bot's omnivorous preference better now.

Oh yeah, for a speedy revision of an old bot just use the replace function in notepad. Saved me a ton of time, just double check when changing numbers, I've wound up with some very odd stuff before. :)
« Last Edit: December 21, 2005, 09:32:31 PM by Endy »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Mini-eco
« Reply #9 on: December 21, 2005, 10:54:55 PM »
Notepad really seems the DNA editing environment of choice.

Although if someone invented something with syntax coloring, I might migrate over ;)
« Last Edit: December 21, 2005, 10:55:20 PM by Numsgil »

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Mini-eco
« Reply #10 on: December 23, 2005, 01:14:52 AM »
Thanks for your help guys.  I am almost there.  Yes, I am going to tease you with promises of success, but I won't give out details yet.  Suffice to say the sim's been running for 50,000 cycles and neither species died out yet and their populations are fairly stable.

Need to do some more tweaking...
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Mini-eco
« Reply #11 on: December 23, 2005, 01:39:06 AM »
OK, stupid question: How do I make Carnatus Orbis divide more slowly (at higher nrg levels)?  It has some weird algorithm with custom variables...
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Mini-eco
« Reply #12 on: December 23, 2005, 09:43:00 AM »
Carnatus Orbis is designed to reproduce fast when it is young and to do so more slowly as it ages.

The threshold energy level for reproduction is stored in memory location 60 and the body threshold is stored in 61

Both these memory locations are incremented by one point for each cycle of the bot's life.

The initial values are defined in gene 2
 
Code: [Select]
'initialize
'*********
cond
*.robage 0 =
start
.shoot .ploc store
2000 60 store
200 61 store
.tie inc
*.myeye .refeye store
.tienum .vloc store
999 .venval store
stop

by increasing the values stored initially into mem 60 and 61 you can control the initial reproduction rate.
Incidentally you can delete the .vloc and .venval lines since you have disabled the shooting already. Kind of pointless making venom if you can't shoot it.
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
Mini-eco
« Reply #13 on: December 23, 2005, 01:15:07 PM »
Thanks,  I disabled this strange pattern and replaced it with a straightforward repro gene.

Another stupid question: When it feeds through ties, does it feed just on energy or can it grab some body points as well?
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Mini-eco
« Reply #14 on: December 23, 2005, 04:57:28 PM »
Can't take body through ties.

You can steal poison, venom or waste if you like though.

A good strategy might be to use ties to dump waste rather than firing a poop shot. That way the veg gets a bit of nourishment before it gets chomped and Fatboy gets some extra energy back.

Incidentally, if you replace the repro gene then you will destroy what makes Carnatus Orbis so good.  The way it works he just keep s building body until he can repro. If you take that away then he won't store energy and that means he won't survive lean times, power up his defences or get fat.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D