Author Topic: Making robot AI tutorial  (Read 15813 times)

Offline Commando38

  • Antweight
  • Posts: 7
  • Rep: 0
    • View Profile
    • Awards
Making robot AI tutorial
« on: July 30, 2010, 07:22:10 PM »
  Alright, I don't know if there is already a tutorial for this, but I thought I would tell everyone how to AI your robot. I know there is a very small and pitiful tutorial on Wiki, but I don't think anyone should have to learn from that. Alright, to get started, you will need any robot, lets start with a chopping robot. To keep it simple, we will only put one weapon on it, lets just try one with a simple axe in the center. When making the controls on your robot, this is very critical. Bring down an Axis controller, and set the positive to "W", and the negative to "S", and name the control "Forward" (Which is case-sensitive) and allow it to move your bot forward and back, likewise, make another axis control, and set the positive value to "A", and the negative value to "D", and allow it to turn your robot left and right. For the weapon, you will need to make a button control, and name it "Fire", and allow it to fire your weapon, and then you can continue building your bot.

(Remember, when I ask you to open a file, DO NOT open the ".pyc", there should be 2 of every file. One with .PY, and one with .PYC, always open the .PY file)

  Once you are done making your perfect robot, select it in the garage screen, (Or basically just select your team and you will be there), and hit "Export Robot" at the bottom left, you can name it anything you want there, so don't worry about that. And hit "OK". Now that you have successfully exported your robot, I will show you what that means. Exit out of your game, and open the Robot Arena 2 Folder, most people will find the location "C:\Program Files (x86)\Infogrames\Robot Arena 2" (Without Quotes). Once you are there, you may click on the "Robot Designs" folder, when you do, you will probably see a few files come up with names like "XTRA_AtomSmasher", maybe a few others ect. You will see the robot you just made in there. "READ BELOW!"

  (If you were not running the game as administrator when you exported the bot, it will not show up, because the game would need administrator privileges to create a file. It is very easy to run your game as administrator, for the noobs with computers out there, I will tell you anyways.

  To run the game as administrator usually all you have to do is right click on the game icon, and click "Run as Administrator", if you don't see "Run as administrator in the drop-down menu, click on "Properties" instead, from there click on "Compatibility". Then select the box "Run this program as administrator", then click on "Apply". You will now be running the game as administrator, then you can export a robot.)

  Alright, now that your robot has been exported (Or basically moved to the "Robot Designs" folder), go to the "AI" folder. You will see a bunch of other folders named "Team1," "Team2," "Team3" ect. These folders contain the AI's robots, I will show you that later. For now, lets add your AI Team into the game!

  In the "AI" folder, if you scroll down a bit, you will find a file named "Teams", open that with notepad, or some other text editor. You will probably see something like this,

index 0
Red Zone
"Do NOT enter the Red Zone!"
AI\red_zone.bmp
Robots: 0 1 2
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

Well, this here is basically the information the computer needs to print the AI's team into the game, in this case the "Red zone" team. I will fully explain this to you. You will notice the first line says "index 0", do you remember the folders I was telling you about earlier? "Team1," "Team2," "Team3" ect. If you don't, you probably need to see a doctor, aside from that. The "index 0" Basically means "Get a folder with a specific number, and gimme all the robots in it!" Now that you know what the index means, I will move on to the next line, you will see it says "Red zone", That is the name of the team, its pretty obvious. The next line you will see something in parentheses that says "Do not enter the Red zone!", that is the teams Motto, just like when you make your own team in game. Now, the next line you will see "AI\red_zone.bmp". This is the image, the image must be 128 by 128 pixels, and you must place it in the AI folder. Now, the next line might be harder to grasp if your a moron. It says "robots: 0 1 2", this is basically saying how many robots the AI is using, you may have a limit of 6. If you notice a lot of things counting from 0, that's because in programing, everything counts from 0. So get used to it. Everything else is not important, but you do need it for your robot to function properly, so don't delete it.

  With all your knowledge, you might just be able to make your own AI team, copy the example I have up there, and paste it into the last of your teams file. Now, redo it to look something like this:

index 15
YOUR TEAM NAME GOES HERE
"YOUR TEAM MOTTO GOES HERE"
AI\YOUR IMAGE GOES HERE.bmp
Robots: 0
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

  You will notice I left the "robots: 0 1 2" at just 0, that's because you only have one robot, but you may change that later. Be sure to fill everything in with your own stuff. Congratulations, you just made your very own AI team, but now it needs some robots! You will still probably remember what I said earlier about the folders "Team1," "Team2," "Team3" ect. Now, you will need to create a new folder called "Team15", or an increment of the highest numbered folder, your index in the "Teams" file should match this. Now you will need to put your robot in there. Go back to your "Robot Designs" folder, and copy the robot that you want, and paste it in your Team folder. Now that it is in there, you will need to rename it "Bot0". And keep incrementing the number every time you add a new bot, "Bot1", "Bot2" ect.

  Your robot is almost ready, now that its in there, you will have to open a file called "Bindings", you will see a bit of complex looking code, but after you get what it does, its pretty user friendly. Here is what you may see:

list.append( ("Raptor", "Chopper", { 'radius': 1.3, 'nose' : math.pi , 'topspeed' : 12 , 'throttle' : 110 , 'turnspeed' : 1.25, 'weapons': (14, 15) }) )

Alright, all this does is add a robot into the game. The first thing you will need to do is copy one of the lines, (Or the example), and paste it at the very end. After you have done this, you may edit it as you please, I will show you as best I can what these values mean.

  The first thing you will see is the name of the robot, as in the example "Raptor". You will need to insert the EXACT name of your robot, which is case-sensitive. Next, you will see the type of robot, as in the example, a "Chopper", Here is a complete list of all the robot types.

Poker: Self explanatory, it pokes the enemy robot.
Whipper: This robot will spin 360 degrees to whack another robot with an extending weapon.
Flipper: Also self explanatory, it will flip the opposing robot.
Directional Spinner: This is for robots that have some sort of a saw, or spinning weapon in the front of the robot.
Spinner: Unlike the Directional Spinner, Spinner robots have the weapon spin around it, such as the Tornado.
Pusher: This is used for robots with a lot of power, and defense on the front side. It will push robots off things such as table tops.
Rammer: This is almost like the poker, but will back up farther, and continue pushing after it has rammed the robot, pokers will back off.
Chopper: This is for robots with things like Hammers and axes, or anything that's going to crash down on the enemy.

  Choose which one is best for your robot, and insert it there. The rest of the values are optional, they will help your robot fight on the battlefield, you may delete, or add as many as you like. To understand what these do, you will see at the top, there is some commented out instructions, you may read these and figure out for yourself. Now that you have done all this, start the game and do an Exhibition match! Select the Computer team, and have a go at em!

  Uh oh... The robot isn't firing its weapon... What did I do wrong? You are probably asking yourself. Well, you didn't do anything wrong. The developers used something called a smart zone to make weapons fire. The normal users would not know what to do with a smart zone, so they hid it from the game. All you need to do to unlock the smart zone is to download this file,
https://gametechmods.com/Robot_Arena2/Components/Combo_AI_&_SZ.zip
Extract it, and paste all the files into your main folder. As a reminder its C:\Program Files (x86)\Infogrames\Robot Arena 2
Now, restart your game, and you will see the smart zone in the power category while in the robot editor, all you need to do now is place a smart zone in front of the weapon that's going to be firing. Its tricky to palce because you cant see it until you have placed it, and notice it will be created a bit behind your cursor. Now, once you aligned everything perfectly, you will need to click on the smart zone, and name it "weapon" (No capitals), the smart zone will not be visible in game. Note that whenever the smart zone touches an opposing robot, it will react by firing your weapon.

  Now, save your bot, export it, and grab the robot file from the "Robot Designs" folder, put it in your AI teams folder, and name it "Bot0", and then restart your game. And then test it out in an exhibition match.

Thanks for reading, hope you enjoyed it. Please post a comment, and upload your custom AI bots! Tell me if there is something I am missing, and don't forget to PM me if you have any questions!

Offline Sparkey98

  • Giga Heavyweight
  • Posts: 5738
  • Rep: -20
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #1 on: July 30, 2010, 07:30:32 PM »
:D

you learned fast, but there are tutorials already.

Offline Commando38

  • Antweight
  • Posts: 7
  • Rep: 0
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #2 on: July 30, 2010, 07:37:24 PM »
Yeah, but every tutorial I take sucks, I tried to make one of my own, and let others judge to whether it sucks or not XD.

Offline Sparkey98

  • Giga Heavyweight
  • Posts: 5738
  • Rep: -20
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #3 on: July 30, 2010, 07:41:49 PM »
OK, glad your learning!I think we may have another modder on our hands :D

Offline ACAMS

Re: Making robot AI tutorial
« Reply #4 on: July 30, 2010, 08:41:33 PM »
If you add stuff you forgot that is in this tutorial, it would be pretty complete and accurate.
 
https://gametechmods.com/forums/index.php/page,page3951.html

Offline Somebody

  • *
  • Posts: 7200
  • Rep: 13
  • CP: +2
    • SomebodyofGTM
    • View Profile
    • My site
    • Awards
Re: Making robot AI tutorial
« Reply #5 on: August 01, 2010, 10:36:38 AM »
I like the part about editing teams. I was wondering how to do that...
I built that big robot on that TV show that time


Offline Skiitzzox220

  • Heavyweight
  • Posts: 776
  • Rep: 1
  • ⊂(✰‿✰)つ
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #6 on: January 30, 2011, 10:52:29 AM »
I might try this when I have the time
When life give you lemons- Wait I don't like lemons...

Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #7 on: February 16, 2011, 12:26:13 PM »
Doesn't work for me, in NAR AI 1.1

The team just doesn't show up on the teamlist, and I did everything right. This happened before on another tutorial.
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #8 on: February 16, 2011, 12:29:41 PM »
I hate to be Cpt. Obvious but are you sure you did it correctly.

the Teams.txt
the Team* folder
The Bindings.py?
I do those awful YouTube videos.

Offline Scorpion

  • Giga Heavyweight
  • Posts: 5431
  • Rep: 2
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #9 on: February 16, 2011, 12:33:30 PM »
Yep, 95% of the time, if your AI isn't working, it's because of a minor mistake in the bindings, so i'd check there fully.

Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #10 on: February 16, 2011, 01:30:54 PM »
Doesn't work for me, in NAR AI 1.1

The team just doesn't show up on the teamlist, and I did everything right. This happened before on another tutorial.

yeah, forgot to put the index number in.

But now my AI'd Robot drives away from me, how do I fix that?
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #11 on: February 16, 2011, 01:32:06 PM »
What do you mean?
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #12 on: February 16, 2011, 01:42:56 PM »
It drives directly away from me, usually into a wall.
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #13 on: February 16, 2011, 01:43:56 PM »
Does it start the wrong way round?
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline somestrangeguy

  • *
  • Posts: 2068
  • Rep: 2
  • If you can read this, your monitor is turned on.
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Making robot AI tutorial
« Reply #14 on: February 17, 2011, 08:48:59 AM »
Before anyone gets to ask and wonders what the unimportant stuff in the teams.txt is, its the information for singleplayer tournament sessions.
yeah, forgot to put the index number in.

But now my AI'd Robot drives away from me, how do I fix that?

Look at the link ACAMS posted, find and read the part about the 'nose'
That will always be the solution if the bot is not going the right way.

Offline spongebot64

  • Antweight
  • Posts: 12
  • Rep: 0
  • I was struck by etc.
    • spongebot64?feature=mhum
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: UlulatingTripod
Re: Making robot AI tutorial
« Reply #15 on: February 19, 2011, 07:39:59 AM »
My AI robot starts the wrong way round, can anyone fix this? :confused:
If a job's worth doing, make sure you're off sick for it.

Offline Pwnator

  • *
  • Posts: 6676
  • Rep: 15
  • Awards BOTM Winner
    • View Profile
    • http://pwnator.tumblr.com
    • Awards
  • See profile for gamer tags: Yes
Re: Making robot AI tutorial
« Reply #16 on: February 19, 2011, 07:43:18 AM »
But now my AI'd Robot drives away from me, how do I fix that?

Look at the link ACAMS posted, find and read the part about the 'nose'
That will always be the solution if the bot is not going the right way.
Clash Cubes 1 - Grey Matter (Runner-Up)
King of Karnage - Sideshow Freak (Runner-Up, Best Engineered)
Rust In Pieces - Paper Cut 3 (Grand Champion, Most Dangerous Bot)
Wheely Tag Tournament - Ion Thruster (Grand Champion, along with Ounces' DiSemboweLment)
UK vs USA - Dark Striker (Grand Champion)
Rust In Pieces 2 - Claymore (Runner-Up, Favourite Bot)
BBEANS 6 - Infection 4 (Runner-Up)
RA2 Team Championships - Serious Business, Skeksis (Runner-Up, along with Scrappy, S_M, and Badnik)
RA2 Team Championships 2 - The Other Stig (Runner-Up, along with Scrappy, S_M, Badnik, 090901, and R1885)
Replica Wars 3 - Abaddon (Runner-Up, Luckiest Bot)
BroBots - wheebot & yaybot (Runner-Up)
Robo Zone 2 - Dipper (4th place, Survival Champion, & Best Axle Bot)
ARBBC - The Covenant (3rd place, BW Rumble Winner, Most Feared BW)

Offline Enigm@

  • convicted sex offender
  • *
  • Posts: 6616
  • Rep: 5
  • :really_makes_you_think:
    • http://www.youtube.com/us
    • View Profile
    • Awards
  • Skype: uncle_slamm
Re: Making robot AI tutorial
« Reply #17 on: March 18, 2011, 09:47:49 AM »
My robot doesn't move. Help?
(◕‿◕✿) discord: uncle_slamm steam: bigmommaprodz #unbanlra2

Offline TheUnknownRobotics

  • UnknownMartin
  • Heavyweight
  • Posts: 577
  • Rep: -4
  • Sm4sh NNID: Nixtram
    • http://www.youtube.com/ch
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: Making robot AI tutorial
« Reply #18 on: August 08, 2013, 07:12:28 PM »
Hey thanks man! But, um... how do I make a srimech? What button should I use? C, Z, X or what? And I'm using a burst piston thingy, so... what should I do? -TheUnknown

(P.S. In the bindings.ps file, what do I put in? ((Omni, OmniVSpinner?).
Mostly a lurker and Sm4sh Bros. player nowadays. :3

Offline helloface

  • Posts: 3884
  • Rep: -11
  • 090901's cumslave
    • https://www.youtube.com/c
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: helloface199
  • Discord: Helloface#2112
Re: Making robot AI tutorial
« Reply #19 on: August 08, 2013, 07:38:34 PM »
Hey thanks man! But, um... how do I make a srimech? What button should I use? C, Z, X or what? And I'm using a burst piston thingy, so... what should I do? -TheUnknown

(P.S. In the bindings.ps file, what do I put in? ((Omni, OmniVSpinner?).
Welcome to GTM!
Make sure invertible is set to false, and spell it as "Srimech".
Oh I'll be doing some banging.......