Changes

Jump to navigation Jump to search
1,071 bytes added ,  06:33, 10 June 2018
no edit summary
Line 1: Line 1:  
Here is a getting started guide to AIing.  
 
Here is a getting started guide to AIing.  
   −
If people want me to document each of the options for an AI line and my recommendations so you can build your own AI, let me know. I don't want to step on the toes of the RFSHQ tutorial or reinvent the wheel.
     −
===================
     −
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.
+
== Tune your bot for AI ==
   −
2) You will need to tune your bot for AI. Note proper capitalization and spelling is important.
+
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 forward and backward: Forward  
 +
 
Name your Analog control that goes Left and Right: LeftRight  
 
Name your Analog control that goes Left and Right: LeftRight  
 +
 
Name your button that spins your spinners: Spin  
 
Name your button that spins your spinners: Spin  
 +
 
Name your button that fires your weapons: Fire  
 
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 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 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 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.
+
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 weight 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)
 +
 
 +
(edit by [[Naryar]]: if you're using the Flipper or Poker AI, you don't need a [[Srimech]] button. Also for a flipper, you need to name the [[Smartzone]] "flip" and not "weapon")
 +
 
 +
== Preparing your bot's name ==
   −
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
+
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.
   −
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.  
+
ALTERNATIVELY
 +
 
 +
 
 +
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.
 +
 
 +
== Exporting ==
 +
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
 +
 
 +
== Backuping old AI ==
 +
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
 +
 
 +
== Fixing orientation ==
 +
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.)  
 
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.)  
Line 42: Line 62:  
Let me know if there are any questions on these instructions or if there is interest to learn more...
 
Let me know if there are any questions on these instructions or if there is interest to learn more...
   −
Starcore
+
[[Starcore]]
 +
 
 +
 
 +
Also check here: http://gametechmods.com/?do=Guide_to_AIing
 +
 
 +
 
 +
== Sample bindings ==
 +
 
 +
list.append(("BOT","Spinner",{'nose':math.pi,'radius':0.1,'weapons':(8,9)}))
 +
 
 +
Spinner, standard values, but drives over hazards/ignores them due to the radius command.
 +
Will face the other way if you remove the ''''nose':math.pi,''' .
 +
 
 +
 
 +
list.append(("BOTINVERT","Spinner",{'invertible':True,'radius':0.1,'weapons':(8,9,)}))
 +
 
 +
Invertible Spinner that ignores hazards.
 +
 
 +
 
 +
list.append(("BOTNAME2","Spinner",{'invertible':True,'radius':1.7,'weapons':(8,9,)}))
 +
 
 +
Invertible spinner that avoids hazards.
 +
 
 +
 
 +
list.append(("BOTINAME3","Omni",{'radius':0.1,'weapons':(8,9,)}))
 +
 
 +
Bot with more than one weapon system.
 +
 
 +
== AI Bindings ==
 +
 
 +
{| class="wikitable" style="text-align: center;"
 +
|+ Bindings and Usage
 +
|-
 +
! Binding Name
 +
! In Game Control
 +
! Use
 +
|-
 +
! Forward
 +
| Analog || Controls forwards and backwards movement.
 +
|-
 +
! LeftRight
 +
| Analog || Controls turning left and right.
 +
|-
 +
! Fire
 +
| Button || Activates when AI criteria is achieved - Used for hammering weaponry.
 +
|-
 +
! Flip
 +
| Button || Activates when AI criteria is achieved - Used for flipping weaponry.
 +
|-
 +
! Srimech
 +
| Button || Activates when AI is inverted.
 +
|}
 +
 
 +
 
 +
 
 +
[[Category:Modification Tutorials]]
1

edit

Navigation menu