Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PhiNotPi

Pages: 1 2 3 [4] 5
46
Suggestions / Bot color as output and debugging tool
« on: July 21, 2011, 09:57:36 AM »
Today I was thinking about AI when I wondered how a bot could communicate with the outside world.  It would be easier to observe and debug the bot if you had some sort of indicater as to what the bot is thinking about.  I propose that we add a way for bots to change their color on command.  There are several uses for this:

  • You can have different parts of a multibot change to different colors.  This adds a visual effect, and can be useful to make sure all of the robots are doing the right thing and becoming the right part of the multibot.
  • Have the bot change colors when doing different things.  This also adds a visual effect and is also useful when making sure the robot is in the right "mode" of operation
  • As a debugging tool. You can program the bot so that it turns red if a certain gene activates, for example

Here are two ways to implement this:
  • Create a memory location for the color. The value is the color, with 0 = red and 32000 = purple.  This value does NOT reset after each cycle. There should be a way to turn this feature on and off.
  • Create three memory locations.  They are the red, green, and blue values for the color.  These memory locations do NOT reset after each cycle. There should be a way to turn this feature on and off.
This second option has an advantage over the first option. It is possible to debug/observe three things at once.  You have the bot that turns red if gene 1 activates, green if gene 2, and blue if gene 3.  If it turns black, you would then know that all three genes activated.  The first option, however, will only return blue, and you do not know whether genes 1 or 2 activated or not.

47
Bot Challenges / Re: Blind bot
« on: May 16, 2011, 08:17:12 AM »
This bot seems to do well, as in it destroys the previous entry.  It constantly fires ties, which allows it to capture food from a distance.  The gain of capturing more food most likely outweighs the cost of extra tie firing.  If the bot fires a tie at conspec, it is repelled and deletes the tie.  This has the benifit of sending offspring away to find more food.
Code: [Select]
start
5 .aimdx store
1259 .tout1 store
*.tiepres .tienum store
*.numties 0 =
.tie inc
*.tin1 1259 !=
.tieloc dec
-1000 .tieval store
not
-10 .up store
*.tiepres .deltie store
*.nrg 3000 >
10 .repro store

48
Bot Challenges / Re: Hard bot
« on: May 16, 2011, 07:40:08 AM »
Is the bot allowed to become overly specialized?  The bot on the Shortest Fully Functional Bot challenge became so specialized that it could only eat non-moving veggies with 7 eyes, and I don't know if that sort of thing would be allowed here.

49
Bot Challenges / Re: Shortest Fully Functional Bot
« on: May 15, 2011, 09:25:59 PM »
This should work for a bot with 11 BP (It does in theory, but I haven't tested it). 
Code: [Select]
start
*.refvelup ++ .up store
*.refeye dec
*.nrg 222 floor inc 'possibly replace this with *.nrg .repro ceil inc

As the nrg rises, each sysvar is incremented until it reaches 300, or the repro sysvar.  The energy then becomes less than 300, and the cycle repeats.  The 222 floor is to protect the sysvars below 222.  This only works when the starting nrg is less than 300, because the bot would never reproduce.  I also considered *.nrg 300 ceil inc instead becuase it would reproduce whenever nrg was above 300, and there would be not risk of accidently skipping 300 nrg and not reproducing, but there would not longer be any protection of sysvars less than 222. Which one is better?  Both could have side affects in the bot's behavior.

With the "should be controlled with some sort of condition", I said that only to prevent .repro inc and other things that cause cancerous growth.  I never imagined that it would be possible to have a conditionless function that did not cause cancerous growth or destroy the bot's functionallity, and was shorter than five bp.  But since it may be possible to accomplish this with out a condition, I am going to allow conditionless reproduction as long as it is not cancerous and does not destroy functionality.

EDIT:  I have tested both *.nrg 222 floor inc and *.nrg .repro ceil inc.  Both cause terrible side effects.  The first one malfunctions when the bot accidently skips 300 energy, and does not reproduce and becomes massive, so the bot will never reproduce.  The second malfunctions when the bot triggers .fixpos, and the bot can no longer move.

50
Bot Tavern / Re: Plausible tactic?
« on: May 04, 2011, 08:40:59 PM »
Here is A_Minimalis modified to become a crab.
Code: [Select]
'Animal_Minimalis
'By: Nums
'Modified By: PhiNotPi
'Good for mutation sims and for
'newbies to see how a basic bot works.
'Contains everything necessary for it
'to survive and reproduce.
'Also good to demonstrate a crab-bot.

' Gene 0 Crab Form
cond
*.robage 0 =
start
314 .aimshoot store
314 .eye5dir store
314 .eye1dir store
314 .eye2dir store
314 .eye3dir store
314 .eye4dir store
314 .eye6dir store
314 .eye7dir store
314 .eye8dir store
314 .eye9dir store
stop

' Gene 1 Food Finder
cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .up store
 *.refvelup 30 add .sx store
stop

' Gene 2 Eat Food
cond
 *.eye5 50 >
 *.refeye *.myeye !=
start
-1 .shoot store
 *.refvelup .sx store
stop

' Gene 3 Avoiding Family
cond
 *.eye5 0 =
 *.refeye *.myeye = or
start
 314 rnd .aimdx store
stop

' Gene 4 Reproduce
cond
 *.nrg 20000 >
start
 10 .repro store
stop

end

51
Bot Challenges / Re: Shortest Fully Functional Bot
« on: May 02, 2011, 06:46:36 AM »
The conpec and shooting lines:
Code: [Select]
*.refeye *.myeye !=
.shoot dec
Can be shortened if we knew the enemy's *.myeye. If we knew that the enemy always had 1 eye, we shorten these lines to
Code: [Select]
.shoot *.refeye mult inc
(Even cooler) If we knew that the enemy always had 7 eyes, then we can chnge this to
Code: [Select]
*.refeye dec
Both of these take advantage of the fact that this bot has a myeye of 0.  The second one takes advantage of the fact that the .shoot memory location is 7.

52
Bot Challenges / Re: Shortest Fully Functional Bot
« on: May 01, 2011, 07:09:41 PM »
I have successfully created a bot with a DNA length of 19.  I seem to be entering into my own competition, but I am going to post the bot anyway.
Code: [Select]
start
*.refvelup 1 add .up store
*.refveldx .dx store
*.refeye *.myeye !=
.shoot dec
*.nrg 5000 >
.repro inc
I used a few tricks to make this bot shorter.  It copies the upwards velocity, and adds one. Even when it does not see anything, it will still add one.  This is its active hunting and part of pursuing. The sideways motion is also copied from any bot.  The resultant swarming behavior seems to help the bot, because they are more likely to be closer to food before they spot it.  The bot shoots at  food, regardless of distance.

I am beginning to wonder if it is possible to create a shorter bot. The last five commands (the reproduction) may be impossible to shorten.  Conpec recognition adds 3 at minimum( *.refeye *.myeye != ).  Start adds 1. Shooting adds 2. The motion of searching adds 2. This means that fully functional bots must have at least 13 commands in their DNA.

Also, even though I only count 19, DB says that the DNA length is 20.  I think this is due to the lack of a stop, which DB may count but isn't there.

53
Bot Challenges / Shortest Fully Functional Bot
« on: April 28, 2011, 06:12:02 PM »
How short can a bot be and still be fully functional?  This is a competition to find out.  To be considered "fully functional" the bot must meet these qualifications:
  • Search for prey.  This can be as simple as turning or moving foward.
  • Pursue prey.  This means that the bot actively tries to get the enemy within range of attack.
  • Feed off of prey.  This can be as inefficiant as needed, as long as the bot gains net energy from the attack.
  • Not attack conspecs.  It should not treat conspecs as enemies.
  • Reproduce.  This should be controlled with some sort of condition.
  • Populate the sim in F1 conditions.  It will be released into an environment of Alga_Minimalis (modified to increase *.myeye if needed).
There are various awards for this competition. These are as follows:

PLATINUM- Shortest entry out of all of the entries that meets the above qualifications.
GOLD- DNA length under 25.
SILVER- DNA length under 35.
BRONZE- DNA length under 45.
COPPER- DNA length under 60.
QUALIFIER- Bot meets above qualifications.

It may seem like I set the bar high for the awards, but some are easier than you may think.

54
DNA - General / Help with .timer
« on: April 22, 2011, 11:31:47 AM »
I have been working on a simple, 7 neuron ANN bot.  Instead of changing the behavior of each neuron, the bot changes the connections between neurons.  Instead of learning off of it's past history, the bot copies the connections of conspecs with more nrg.  Each cycle, it chooses a connection using its timer.  It then puts the number into out1.  When another bot (with lower nrg) sees the bot with higher nrg, it takes its in1, and using the timer (modified to compensate for its increase over one cycle), it stores the number in the correct memory location, changing the connection.  The problem is that different bots seem to develop different timers, and this destroys the whole process.  How can I fix .timer to be the same for all of the bots?

I am willing to explain more about my bot if needed.

Here is the code:
Code: [Select]
cond
*.robage 5 =
start
1 50 store 'establish a constant 1
50 rnd 100 store 'shoot threshhold
9 rnd 51 add 61 store 'neuron inputs (adding, constant 1 not allowed)
9 rnd 51 add 62 store
9 rnd 51 add 63 store
9 rnd 51 add 64 store
9 rnd 51 add 65 store
9 rnd 51 add 66 store
9 rnd 51 add 67 store
9 rnd 51 add 71 store
9 rnd 51 add 72 store
9 rnd 51 add 73 store
9 rnd 51 add 74 store
9 rnd 51 add 75 store
9 rnd 51 add 76 store
9 rnd 51 add 77 store
10 rnd 50 add 81 store 'neuron inputs (subtracting, constant 1 allowed)
10 rnd 50 add 82 store
10 rnd 50 add 83 store
10 rnd 50 add 84 store
10 rnd 50 add 85 store
10 rnd 50 add 86 store
10 rnd 50 add 87 store
10 rnd 50 add 91 store
10 rnd 50 add 92 store
10 rnd 50 add 93 store
10 rnd 50 add 94 store
10 rnd 50 add 95 store
10 rnd 50 add 96 store
10 rnd 50 add 97 store
stop

cond
start
 *.timer 36 mod .timer store 'mod timer by 36
 *.refvelup 58 store 'update inputs
 *.refveldx 59 store
 *.eye5 60 store
 *61 * *71 * add *81 * sub *91 * sub 50 ceil -50 floor 51 store 'neuron 1
 *62 * *72 * add *82 * sub *92 * sub 50 ceil -50 floor 52 store '2
 *63 * *73 * add *83 * sub *93 * sub 50 ceil -50 floor 53 store '3
 *64 * *74 * add *84 * sub *94 * sub 50 ceil -50 floor 54 store '4
 *65 * *75 * add *85 * sub *95 * sub 50 ceil -50 floor 55 store '5
 *66 * *76 * add *86 * sub *96 * sub 50 ceil -50 floor 56 store '6
 *67 * *77 * add *87 * sub *97 * sub 50 ceil -50 floor 57 store '7
 *51 1256 mod .aimdx store 'update outputs
 *52 50 mod .up store
 *54 50 mod .dx store
 *.timer 61 add * .out1 store 'select memloc using timer and put in out1
stop

cond
 *.refnrg *.nrg >
 *.refeye *.myeye =
start
 *.in1 *.timer 1 sub 36 mod 61 add store 'update memloc from in1 using timer
stop

cond
 *53 *100 > 'only shoot if above threshhold
start
 -1 .shoot store
stop
end

55
Tips and Tricks / Re: Actual Distance Sensing
« on: April 21, 2011, 06:52:23 AM »
I thought that I had looked all over the wiki for something that told the actual distance.  But it is actually a good thing that I now know about the "advanced commands." It makes programming bots a whole lot easier. 

If you can't tell, I'm a newbie.

56
Tips and Tricks / Actual Distance Sensing
« on: April 20, 2011, 08:55:44 PM »
Here is code to find the actual linear distance between the bot and the bot that it is looking at, not the inversely proportionate number given by the focus eye, which depends on the width of the eye (I think).  It is based off of the Pythagorean Theorem.

def distance 51
*.refxpos *.xpos sub *.refxpos *.xpos sub mult *.refypos *.ypos sub *.refypos *.ypos sub mult add sqr distance store

57
DNA - General / Re: Newbye question
« on: April 20, 2011, 09:15:14 AM »
     Reverse Polish Notation is a system of writing math expressions so that there can be no confusion about the order of operations and no need for parentheses.  Take the expression 2 * 3 + 4, for example.  If you did not know the order of operations (it is surprisingly hard to write a program that uses the order of operations), then it would be impossible to know whether the person meant (2 * 3) + 4 (= 10) or 2 * (3 + 4).  The first one equals 10 and the second equals 14, which are not the same.  Someone could have the program just read from left to right, but this can make simple expressions much more confusing.  Parenthesis are good to avoid in Alife programs, because if the parenthesis mutate to no longer match up correctly, then the math doesn't make sense and this may cause a computer error.

     This is why DB uses Reverse Polish Notation (RPN).  In RPN, the operator (+ - * / or in DB add sub mult div) comes after the operands (the numbers or memory references), instead of in between.  The operator always effects the two operands immediately in front of it, and combines them into one operand.  With these simple rules, any expression can be formed without an order of operations or parenthesis.  (2 * 3) + 4 would be written as 2 3 mult 4 add.  It is clear that mult affects 2 and 3, while add affects the result of (2 3 mult) and 4.  The second expression, 2 * (3 + 4), would be written as 2 3 4 add mult.  It is clear that add affects 3 and 4, while mult affects 2 and (3 4 add).

     I hope that you now better understand RPN.  RPN is very easy to use, but it may take some getting used to.

58
DNA - General / Newbie question about coding behaviors into DNA.
« on: April 19, 2011, 09:53:49 PM »
Even though I understand how to create genes for simple things (when this happens, do this), I am having trouble coding higher level behaviors into DNA.  The hunting strategy that I wanted to implement was a simple hunting in a swarm behavior.  My bot would form in loose swarms, and when one bot sees food, everyone else in the swarm follows.  I can write a gene telling the bot to follow conspecs.  I can write a gene that tells the bot to back away from conspecs when too close.  I even figure out how to get other bots to follow the bot who sees food.  But when I combine them, the end result does not function as I anticipate.  What happens is that, when feeding, all of the bots become to close to each other, and they all end up shooting each other when they try to feed off of the prey.  This allows the prey the opportunity to destroy the entire swarm, which usually happens.  (the code for my bot is saved on a different computer) Besides just this one example, what is some advice to help me code higher level behaviors?

59
Bot Tavern / Re: Plausible tactic?
« on: November 10, 2010, 08:16:42 PM »
I made a crab-like-bot at one point in time.  It was animal minimalis edited so that instead of spinning while looking for food, it moved sideways.  It wasn't a complete crab, because it still moved foward when it found food.  I would think that moving sideways towards food would be difficult because, while sideways, you would not be able to keep an eye on the food.

60
DNA - General / How will DB3 DNA work?
« on: August 17, 2010, 10:13:34 AM »
I have been hearing about how DB3 DNA will be different from DB2 DNA.  I am wondering how it will work and if DB2 robots can still work. Can anyone give me examples or an explanation?

Pages: 1 2 3 [4] 5