Author Topic: How do you make a bot stop moving?  (Read 7780 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #15 on: December 18, 2009, 04:33:46 PM »
I must be adding the code in the wrong place then, because all I get is a bot twitching with movement vectors pointing in 4 directions, or the code is completely ignored.

I want a bot that moves away a short distance just to get out of the way of a shooting bot and then stop moving.
« Last Edit: December 18, 2009, 04:34:26 PM by Testlund »
The internet is corrupt and controlled by criminally minded people.

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #16 on: December 18, 2009, 04:35:29 PM »
whos piece of code mine or pete's

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #17 on: December 18, 2009, 04:48:58 PM »
This makes the bot move forever:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']start
*.refxpos 0 >
*.refxpos *.refypos angle .setaim store
8 .shootval store
-6 .shoot store
stop
start
*.nrg 16000 >
10 .strbody store
stop
start
*.body 16000 >
50 .repro store
15 .aimdx store
stop
cond
  *.shflav -1 =
  *.shflav -6 = or
start
  *.maxvel .up store
  *.maxvel .dx store
stop

cond
  *.shflav 0 =
start
  *.velup - .up store
  *.veldx - .dx store
stop
The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #18 on: December 18, 2009, 05:00:30 PM »
Don't forget to reset .shflav, it isn't done automaticaly...
.up however is reset automaticaly, so for instance :

*.shflav 0 !=
0 .shflav store
*.aim *.shang sub .setaim store '(This line just aims in the direction you where shot from, I can't remember if aim is adjusted before movement, but I think it is)
*.maxvel .dn store

This should give you full power for one cycle then stop acceleration, if there's no fluid resistance you may keep moving though, otherwise you should stop by yourself.

Countering movement speed is a bit tricky if you're also turning, since you'll keep trying to adjust in every direction.

If you have no fluids and you want to stop fast, you can use 1 .fixpos store to stop completely and lock in place. (Just have .fixpos dec in a gene with no condition at the start of your code)
« Last Edit: December 18, 2009, 05:02:48 PM by Moonfisher »

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #19 on: December 18, 2009, 05:07:21 PM »
Yes! That did it! Here's the complete bot:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']start
*.refxpos 0 >
*.refxpos *.refypos angle .setaim store
8 .shootval store
-6 .shoot store
stop
start
*.nrg 16000 >
10 .strbody store
stop
start
*.body 16000 >
50 .repro store
15 .aimdx store
stop
cond
*.shflav -1 =
start
25 .up store
stop
cond
*.shflav -6 =
start
25 .dn store
stop
start
*.shflav 0 !=
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store
stop

It has a hard time escaping an efficient hunter though, but it's ok.  
« Last Edit: December 18, 2009, 05:08:37 PM by Testlund »
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #20 on: December 18, 2009, 05:20:03 PM »
Actually, now it moves away from ANYTHING it touches, so now it can't feed much. I just wanted it to move away when shot at.  
The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #21 on: December 18, 2009, 05:25:49 PM »
Change this :
*.shflav 0 !=
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store

To this :
*.shflav 0 !=
*.shflav -2 != and
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store
'(And maybe add some counter shots while fleeing if you want that)
-6 .shoot store
20 .shootval store

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #22 on: December 18, 2009, 05:54:46 PM »
Ok, thanks for your help and patience folks! I made it so it will shoot all it's waste at an offender, if it has any.  

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']start
*.refxpos 0 >
*.refxpos *.refypos angle .setaim store
8 .shootval store
-6 .shoot store
stop
start
*.nrg 16000 >
10 .strbody store
stop
start
*.body 16000 >
50 .repro store
15 .aimdx store
stop
cond
*.shflav -1 =
start
25 .up store
stop
cond
*.shflav -6 =
start
25 .dn store
stop
start
*.shflav 0 !=
*.shflav -2 != and
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store
-4 .shoot store
*.waste .shootval store
stop
end

The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #23 on: December 18, 2009, 06:35:21 PM »
Not unlike many animals IRL, some empty bowels while fleeing, makes them lighter and faster and can get in the way of the predator. And I know birds and monkeys will aim it at predators to make them leave the area below.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #24 on: December 18, 2009, 06:39:36 PM »
I was thinking about an octopus when I came up with this idea. Thought I should try it out in IM but I think a virus infected flyfruit came in and whiped all my bots out!  
The internet is corrupt and controlled by criminally minded people.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
How do you make a bot stop moving?
« Reply #25 on: December 19, 2009, 05:33:19 AM »
Didn't know if it was working, tryed activating IM and the teleporter popped up, but if I tried showing the IM pop graph then everything crashed. So didn't actualy think it got out there.
Anyway I won't spread it on IM again if people are trying to run evo sims there. It was mostly because EricL challenged bot coders to hit 9000 bots on IM, and the idea was for the alge to eventualy infect a regular bot with a virus version of FruitFlies and have the infected bot take over the sim. Other than that it spread viruses to get rid of the other alge, and also as part of it's own clever virus defence capable to assimilating new viruses and spread them without taking damage from them. So if everything just died it actualy didn't have the desired effect, it was suposed to make enough fruitflies to freeze your sim
But I'll only put evo bots on IM if that's what people are running atm (Back then it was up against Seasnake3 I think)

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
How do you make a bot stop moving?
« Reply #26 on: December 19, 2009, 07:52:01 AM »
The same happened to me when I went onto internet mode, it showed me the graph for a little while but then when it tried to update it crashed.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
How do you make a bot stop moving?
« Reply #27 on: December 19, 2009, 12:21:55 PM »
Quote from: Moonfisher
Didn't know if it was working, tryed activating IM and the teleporter popped up, but if I tried showing the IM pop graph then everything crashed. So didn't actualy think it got out there.

Yes, these pop up/under graphs are tiresome, especially if you're a perfectionist like me and want all graphs nice and tidy on the screen.
If you minimize them and restart internet mode they tend to get stuck so you can't open them again.

Quote
...the idea was for the alge to eventualy infect a regular bot with a virus version of FruitFlies and have the infected bot take over the sim.

Yes, that is what happend. My touch bot 'PokeMe' exploded into tiny bots all over the screen and dissapeared.

Quote
So if everything just died it actualy didn't have the desired effect, it was suposed to make enough fruitflies to freeze your sim

That's because I run with lots of costs and nrg/body distribution set to zero so the bots have to use their own nrg/body transfer. I think that's more realistic.

Well, I've given up trying to evolve zero bots in my sims which have been my main interest with DB, one of the reasons why I never got into bot designing, but I thought I should give it a try to learn it and see if I can design a few simple bots, preferably based on real unicellular organisms.

Maybe you guys would be interested in running a pure evosim under the Christmas holiday, while being away from the computer celebrating?

Hopefully Nums may be able to fix the saving problem until then so any cool sim don't get lost.  
The internet is corrupt and controlled by criminally minded people.