Author Topic: how do i ai  (Read 2185 times)

Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« on: June 14, 2009, 02:20:54 PM »
i am trying to AI my REVENGE OF RAZER! over robot x in DSL 2.1
will this work:
Here is a getting started guide to AIing.

===================

The quick way to dive into AIing your bots is as follows:

1) Find a bot in the Starcore V3 AI pack that is similar in fighting style to your bot. There are 210 of them to choose from. Look for same type of Spinner, Rammer, Pusher, Invertible or not, etc.

2) You will need to tune your bot for AI. Note proper capitalization and spelling is important.

Name your Analog control that goes forward and backward: Forward
Name your Analog control that goes Left and Right: LeftRight
Name your button that spins your spinners: Spin
Name your button that fires your weapons: Fire
If you are using my Omni or OmniRam AI naming your weapon control Fire is all you need
If you are using the Flipper AI for a Flipper bot name the button that flips: Flip
If you have a button for flipping your bot when inverted, name it: Srimech
If you have a spinner, rammer or pusher that does not need to know when to activate its weapons, you are done with this part of AIing
If you have a Poker, Hammer, Flipper, Popup or Hybrid that has these elements you will need to get the Smartzone.cfz that RFS unlocked (or similar) and put it in your Robot Arena 2 main folder to unlock the Smartzone feature. Then you will need to size and place the Smartzone. When you add the Smartzone.cfz and restart RA2 you will find the Smartzone as an option in the Power Catagory. It is a bit tricky to place because it is invisible when being positioned. It does weigh 2Kg so you may or may not want to plan for it in your staying in your weight class (I required all LW, MW and HW Starcore AI bots to stay within wieght class so they would look right on the displays). You will want to size and position the Smartzone to be where your weapons hit or where you want the opponent to be before you activate your attack systems.
If you put in a Smartzone name it: weapon (Note: All lower case)
3) When done (and this is a shortcut) In the Bot Lab name your bot the exact same name as the bot you are wanting to replace for AI testing. Doing this will let you test your bot as an AI without getting deep into writing your own AI for now.

3 alternate) The other choice would be to keep your bot name and edit the Bindings.py file (make a backup first). Copy and paste the AI line you are wanting to use to a blank line in the Bindings.py file. Then change the name of the bot listed in the new AI line to the exact same name as your bot.

4) Export the bot naming it Bot0, Bot1, Bot2, Bot3, Bot4 or Bot5 depending on the position of the bot it is replacing in Starcore AI pack. For example if you wanted to replace Maelstrom in the Spin Doctors, it is in the 3rd position that team and since the game counts up from Zero you would name your bot, Bot2

5) Exit the game and go to your \Robot Arena 2\Robot Designs folder and copy the Bot2 you saved in step 4 and change to the \Robot Arena 2\AI folder and go to the team you wanted to replace a bot of (again the game starts counting at Zero). So in this example for replacing Maelstrom of the Spin Doctors you would go to Team 0 and rename the existing Bot2.bot to something like Bot2.bot.Maelstrom and Paste in your Bot2.bot

6) If you are lucky that your bot faces the same way as the bot you are replacing you are done here and your bot should start fighting with the AI of the bot you replaced. If you didn't make your bot facing the same way as the bot you are replacing you can you will need to edit the Bindings.py file to tell the game which way your bot should face.

To edit Bindings.py to correct facing of an AI bot go to the \Robot Arena 2\AI folder and back up the existing Bindings.py (This is very important. It is easy to induce typos in this file and the game is very unforgiving if you do.)
Open up the Bindings.py with Notepad or your favorite text editor that does not change formatting (i.e. turn off Word Wrap).
Go to the line of the bot you are replacing with your bot. In this example it would be the Maelstrom line in Team #0
Maelstrom does not have a 'nose' command because he is facing the default direction. Depending on the facing of your bot (Trial and error here, hard to describe how to tell which setting to use) you would add to the list.append line for the bot you are replacing (Maelstrom in this example) in the same style of many of the other bot lines in the Bindings.py (Note: Position between the {} is your choice but try to do similar to other lines:
'nose':math.pi/2, or 'nose':math.pi, or 'nose':-math.pi/2,
If you built your bot on an oblique angle there are more exotic settings to adjust for that, but that is a more advanced tutorial about radians. Basically many computer physics models do not use Degrees, they use Radians where 0 (or PI*2) Radians = 0 (360) Degrees, PI/2 Radians = 90 Degrees, PI Radians = 180 Degrees, PI*3/2 (or -PI/2) Radians = 270 Degrees
Save your changes to Bindings.py and if you didn't induce any typos your bot should now start facing the right direction as an AI. If not, you did make the backup of Bindings.py, didn't you? If you need to adjust the nose command again or start over copy the backed up Bindings.py to Bindings.py and try again or edit the one you have been adjusting.
This is a good way to get your Bot AIed by using an existing AI line and get it inserted in a pack for testing
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
how do i ai
« Reply #1 on: June 14, 2009, 02:44:09 PM »
ummm... yes
edit: kinda wrong topic(dsl tech support)
should be in mods and designs under ai
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #2 on: June 14, 2009, 03:13:39 PM »
Quote from: roboman2444;44211
ummm... yes
edit: kinda wrong topic(dsl tech support)
should be in mods and designs under ai

that dosent help at all!:pissd:
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2

Offline cephalopod

how do i ai
« Reply #3 on: June 14, 2009, 03:18:05 PM »
Neither does you pasting the entirety of a AIing guide :mad:
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
how do i ai
« Reply #4 on: June 14, 2009, 03:53:21 PM »
This thread su-



- ALL GLORY TO THE HYPNOTOAD

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
how do i ai
« Reply #5 on: June 14, 2009, 03:53:21 PM »
???
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline Weirdo

  • Middleweight
  • Posts: 318
  • Rep: 0
    • View Profile
    • Awards
how do i ai
« Reply #6 on: June 14, 2009, 04:03:42 PM »
Futurama roboman, Futurama. Get with it.
Good evening.

Offline Madiaba

how do i ai
« Reply #7 on: June 14, 2009, 07:55:29 PM »
LRA2, your effort is appreciated, but is this your work or another's?
There are other tutorials too, so I'll move this thread/post eventually and probably use some of these notes... (unless ACAMS or CB want to handle it...)
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
how do i ai
« Reply #8 on: June 14, 2009, 11:22:49 PM »
This looks like Starcore's AI tutorial....
Any comments would be appreciated. :D

Offline cephalopod

how do i ai
« Reply #9 on: June 15, 2009, 01:44:18 AM »
I think he was trying to check if he's using the right guide.
Quote from: life robot arena2;44204
i am trying to AI my REVENGE OF RAZER! over robot x in DSL 2.1
will this work:
Here is a getting started guide to AIing.
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #10 on: June 15, 2009, 11:19:12 AM »
i could only find the starcore one
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2

Offline DuckRA2

  • *
  • Posts: 1006
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #11 on: June 15, 2009, 11:37:47 AM »
how do I read a tutorial? lol
AI is quite useless to you because I dont think you make super bots, or I dont think any of us could do the tank rotation stuff that Mad and Phil do

Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #12 on: June 17, 2009, 12:10:42 PM »
i have a bot that has spikes on the side, a flipper and a axe.
what type should i put down for the bindings?
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2

Offline R1885

  • *
  • Posts: 2127
  • Rep: 3
  • Forum shopping list generator.
    • View Profile
    • Awards
how do i ai
« Reply #13 on: June 17, 2009, 12:14:55 PM »
Omni.

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
how do i ai
« Reply #14 on: June 17, 2009, 12:26:56 PM »
There is a chart AND A THREAD to help Aiing :
Quote from: philetbabe;44801
here is a new version of the AI chart ....

otherway, create your own showcase thread and there, ask for Aiing.

Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #15 on: June 17, 2009, 12:32:49 PM »
here is the line of the bot:
list.append(("destroyer","Omni",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':/(6,23)}))
 what should i change thats red ignore the blue slash
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2

Offline JoeBlo

how do i ai
« Reply #16 on: June 18, 2009, 04:11:50 AM »
from my understanding it depends on the bot, the drive, power, weapons how many drive motors etc as to what those values are

Offline somestrangeguy

  • *
  • Posts: 2068
  • Rep: 2
  • If you can read this, your monitor is turned on.
  • Awards BOTM Winner
    • View Profile
    • Awards
how do i ai
« Reply #17 on: June 18, 2009, 08:41:00 AM »
If the bot goes too fast for its own good, then reduce 'topspeed' and/or 'throttle'.
If it turns too fast, reduce 'turnspeed' and/or 'turn'.
If you want it to circle around obstacles more, increase 'radius'.
If the bot is invertible, add: 'invertible':True, before 'nose'.
If the bot is facing wrong way at the start of the match, then change 'nose':math.pi to one of these:
'nose':math.pi*2
'nose':math.pi/2
or remove the whole 'nose':math.pi, completly
there are other numbers you can use in place of the 2, I just dont remember wich.

Offline life robot arena2

  • Super Heavyweight
  • Posts: 946
  • Rep: 1
    • View Profile
    • Awards
how do i ai
« Reply #18 on: June 18, 2009, 02:44:09 PM »
here is the line now:
list.append(("destroyer","Omni",{'nose':math.pi,'radius':0.1,'topspeed':106,'throttle':46,'turn':60,'turnspeed':6.5,'weapons':/(6,23)}))

it will not move at all
« Last Edit: June 20, 2009, 04:12:13 AM by life robot arena2 »
im up for life forever!:mrgreen:
ACHEIVMENTS
entered a rookie-bot for clash cubes 2