Author Topic: The amazing Antbot  (Read 23254 times)

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #30 on: May 06, 2008, 01:22:17 AM »
Distance comaprators are a bad idea bacause it'll end up circling one point.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #31 on: May 06, 2008, 10:42:11 AM »
Quote from: bacillus
Distance comaprators are a bad idea bacause it'll end up circling one point.

THat really all depends on hwo weel the author can program. I built Slim Evo to build a swarm, leave, find a veggie, then using a distance comparator it returned to the swarm. Not sure I ever saw them circle around a point. ITs a matter of programing in the right protocols. Really think about this one, it could gve your bot a lot more intelligence, it could evolve to know way more too.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #32 on: May 07, 2008, 02:14:29 AM »
Mu current idea is that as soon as it comes to the target point, it moves to the next one. I think it'll work fine.
Updating the antbot is a priority, but the ones that are taking up most of my time are study, working on DBIII,  running the F1 league, vital bodily functions, and getting others involved in DB (Not neccesarily in that order  ).
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #33 on: May 07, 2008, 05:16:18 PM »
Well if you do decide to create this behavior, let me know, I'll create the thought process for making a decision based on stored points and location.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #34 on: May 08, 2008, 03:21:18 AM »
I had a quick brainstorm at how to make this happen, and hit a solid progress barrier. You can't use variables when making a reference, so the only way to do this is to reference to each location explicitly, which is stupid because it means checking a ton of locations multiple times every cycle.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Trafalgar

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
The amazing Antbot
« Reply #35 on: May 08, 2008, 12:22:34 PM »
Can't you use the * operator, or am I misunderstanding what you're saying?

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #36 on: May 08, 2008, 02:09:49 PM »
One method may be to update certain distance references based on %s of changes in current location. Say your bot sees no more food where it is, once the bot leaves 10% of the area around that point it first foudn the food, have it update its distance vars based on waypoints, and then compare only the distance vars. Also, if you organize the vars right, you could make a multiple cycle reader that checked say 10 nearest points or whatever. I'm guessing you don't use things like shapes, so its not entirely necessary for the bot to remember that much information, other than where food is, where a safe route is, and where enemies most likely are. For the most part, you should only be making very large memory scans when food resources go low, or when the population starts falling off, or when the bot is in real danger of death. Every cycle the bot should simply check to make sure it has some safety point within a set distance, which could be a SYSVAR set distance.

I've managed to produce a simple little waypoint counter, uses 40-50 to store 5 points using a single memloc inc and store

first, set your memloc to 40 or next free location, count by twos though because the 41st is the y-coordinate. you'll need to know the sysvar #s for xpos and ypos

cond
*bluh  *bluh =/!=/?????
start
40 .memloc store
stop

cond
'check for empty space
start
40 2 add .memloc store
stop

cond
'store waypoint for x
start
*.xpos .memval store
stop

cond
'store waypoint for y
start
.memloc inc
*.ypos .memval store
stop

We always know y will go right after the x var, so this works for an easy waypoint creater. TO read from it, its just the same functions only a different order. Start by adding an additional store we can compare locations easier, without messing with a memloc counter, but I still like these because it makes bot though automated, rather than conditional.

Anyways, to read you could do the following:

cond
'decide what to look for, some waypoint type, you should know these based on sysvars loc you used to store them
'I say create sysvars that reference each sysvar for easier access, I set up 10 buffers to make the bot have some RAM, prevents large memory searches using several other vars
'for a simple safety waypioint, using 40-50
start
40 .memloc store
*.memval .buffer1 store
stop

cond
'continue to search until internal swithc or other condition
start
.memloc inc
stop

cond
'compare (*.buffer1 *.memval dist *.d1 >)

Now the easiest way to continue is to use the tmemlocs to push information into another bot's RAM while continuing its own search routines, but that is a little more involve, so you would have to continue by hand storing to each buffer, but the benefit is that your memloc counter could be used for some other use to say update eyes or whatever. But this buffer system will let a single bot multitask after about 10 cycles, depending on how you set up the conditions for reading. Once you've done that, its a matter of running comparisons on each buffer until the bto finds what it is looking for. To make sure it doesnt try to find both the longest distance and shortest distance, it will require clever conditioning, overlaps make the memloc commands not work.

Yes the conditions I gave are vague and make the bots skip location 40, but I didn't want to muddle it with switches and locks, thats something that is left for the designer to decide, for me I'm using 1-3 conditions a gene, and getting genuine results. Currently the tie feed system is too limited and the bots tend to die off from so many stores, but I'm working on improving its basic survival genes. You could run comparisons using a seperate set of memloc counters that activated only once or when necessary, but I've gone with continuous update aproach for now. Again, its the same prinicple as before, only you would use *.memloc and 1 buffer such as the genes I posted above to make the comparison, you would need to use 2 add to count properly, or you might compare a x-coord with a y-coord, which isnt very helpful. Also, you will need to store distance results to actually make any useful comparison, and it would be simple to implement such a comparator. Anytime a distance was found that was shorter or longer, the previous d1 would be overwritten with the most preferred result, this process could be done once on all desired melocs  and would produce a true result. Eventually it may be possible to build a bot that knows what and where within a few cycles, but  at the moment it takes Slim Evo 4 1 waypoint/2cycles, and the comparisons take about 1 waypoint/cycle, so a decision about food or safety can be made in roughly 15 cycles.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #37 on: May 09, 2008, 01:53:23 AM »
Never mind, I just figured out by using my Chester the Tester bot that it is possible to read variable locations  
Sorry that you had to painstakingly extract a long, obsolete piece of code, gymsum, but I greatly appreciate your enthusiasm for helping others.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #38 on: May 09, 2008, 02:35:30 AM »
Here's a prototype of the trail system, although I would still need a way and reason to communicate it:

def minxpos 20
def minypos 60
def count 100
def bearing 101
def mindist 75
cond
 *.count 0 =
start
 1 .bearing store
stop

cond
 *.count 39 =
start
 -1 .bearing store
stop

cond
 *.eyef 0 =
 *.count .minxpos add * 0 =
 *.count .minypos add * 0 =
 *.timer 100 mod 42 =
start
 *.xpos *.count .minxpos add store
 *.ypos *.count .minypos add store
 *.count *.bearing add .count store
stop

cond
 *.eyef 0 =
 .minxpos *.count add * 0 !=
 .minypos *.count add * 0 !=
start
 .minxpos *.count add * .minypos *.count add * angle .setaim store
stop

cond
 .minxpos *.count add * 0 !=
 .minypos *.count add * 0 !=
 .minxpos *.count add * .minypos *.count add * 0 dist .mindist <
start
 *.count *.bearing add .count store
stop
« Last Edit: May 09, 2008, 05:37:38 PM by bacillus »
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #39 on: May 09, 2008, 10:39:18 AM »
Impossible to read var locations???? That shouldn't be necessary, you just set the Var locations with memloc and set memvar.... Is that no longer acceptable with DB? Anyways thanks for the code.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #40 on: May 09, 2008, 05:34:24 PM »
I don't see how your method works, can I remind you that memloc and memval don't read from your bot, they read from the bot in the focus eye?

Quote from: bacillus
I don't see how your method works, can I remind you that memloc and memval don't read from your bot, they read from the bot in the focus eye?
I fixed a mistake, that it reads the X position as both X and Y.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #41 on: May 09, 2008, 10:16:18 PM »
Quote from: bacillus
I don't see how your method works, can I remind you that memloc and memval don't read from your bot, they read from the bot in the focus eye?

Quote from: bacillus
I don't see how your method works, can I remind you that memloc and memval don't read from your bot, they read from the bot in the focus eye?
I fixed a mistake, that it reads the X position as both X and Y.

Oh yeah. We could really use a system to cycle through sysvars.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
The amazing Antbot
« Reply #42 on: May 10, 2008, 06:38:21 PM »
You mean the way I made it, or cycling through in one cycle? I think recursive structures were intentionally avoided so that bots don't go through infinite loops.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
The amazing Antbot
« Reply #43 on: May 11, 2008, 11:40:15 AM »
I see. I meant a system where you could inc or dec through your bots sysvars for things like searching through thoughts, storring to several vars with different values (not necessrly in the same cycle) etc. I do indeed like your method and wish to improve upon it to make it faster and more versitile for my purposes.

Offline harry

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
The amazing Antbot
« Reply #44 on: June 27, 2008, 09:13:02 AM »
pull, guys. pull!