Darwinbots Forum

Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: abyaly on May 04, 2006, 08:49:32 PM

Title: Bot Diffusion
Post by: abyaly on May 04, 2006, 08:49:32 PM
If your bots are all living together in a lump, it makes your species much less likely to find food, no matter how fast you rotate. So because of that you need a system to help scatter your bots accross the field.
For that purpose, I made the 'diffusion' gene present in the bot Turbo.
Code: [Select]
cond
*.refeye *.myeye =
*.eye5 0 >
start
10 .dx store
314 .aimdx store
stop
The down side is that bots surrounded by conspecs will spend a LOT of energy doing this. The up side is that the bots on the far side of the group will move away from its family.

A problem encountered by this gene is that only the ones on the far end of the mass do very serious diffusing. And if you want the bots to space out more evenly, shouldnt the acceleration be based on the distance? Vector's diffusion is based on this concept.
Code: [Select]
cond
*.eye5 0 >
*.refeye *.myeye =
start
314 .aimdx store
*.maxvel *.vel add *.eye5 mult 50 div 15 ceil .dx store
stop

The diffusion now based on current velocity and distance. The 50 scales down the energy spent, and the 15 puts a cap on how much can be spent per cycle in this way. If you put bots with genes like this into an environment where vegs are scarce, this increases the species survival rate immensely.
Title: Bot Diffusion
Post by: Numsgil on May 04, 2006, 09:42:01 PM
Here's my solution to the same problem:

Code: [Select]
cond
*.myeye *.refeye =
*.eye5 0 >
*.velscalar 0 =
start
100 .dn store
stop

The idea is that it will only fire its engines if it stops moving.  Presumably if it's moving it's leaving a clump.
Title: Bot Diffusion
Post by: PurpleYouko on May 05, 2006, 08:50:15 AM
Incidentally why is it that we actually get these clumps in 2.4?
We never did in previous versions.
Did you add some sort of gravity that draws bots together?
Title: Bot Diffusion
Post by: Numsgil on May 05, 2006, 09:26:04 AM
I see no new clumping in 2.4 that wasn't there in previous versions.
Title: Bot Diffusion
Post by: PurpleYouko on May 05, 2006, 10:06:21 AM
It doesn't seem to happen with all species but a few of them form clumps where they didn't in other versions.

Try running a simple sim with Anon Terrifica to see what I mean.

Here is a piccy showing the odd behaviour.
(http://img70.imageshack.us/img70/5364/anonterrificaclumpingin248nt.th.jpg) (http://img70.imageshack.us/my.php?image=anonterrificaclumpingin248nt.jpg)
Title: Bot Diffusion
Post by: Numsgil on May 05, 2006, 10:24:58 AM
I have no idea.