Author Topic: A.I. Tutor?  (Read 1922 times)

Offline J24

  • Ultra Heavyweight
  • Posts: 1568
  • Rep: 0
    • View Profile
    • Awards
A.I. Tutor?
« on: October 12, 2010, 12:46:35 PM »
Can anyone teach me how to fine-tune A.I. Codes?
I Keep trying to play around with the bindings lines, but i just don't, well, get it really
<<< Stalk me on the Twitter! (... Please... I'm lonely)

4th place in COTT! My word...

Offline SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #1 on: October 12, 2010, 12:47:39 PM »
If anyone's telling, I will also be sticking around!
I do those awful YouTube videos.

Offline J24

  • Ultra Heavyweight
  • Posts: 1568
  • Rep: 0
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #2 on: October 12, 2010, 12:51:50 PM »
What?
<<< Stalk me on the Twitter! (... Please... I'm lonely)

4th place in COTT! My word...

Offline SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #3 on: October 12, 2010, 12:54:19 PM »
I need to learn also!
I do those awful YouTube videos.

Offline Gazea2

  • Ultra Heavyweight
  • Posts: 3670
  • Rep: 9
  • the one and only
    • View Profile
    • Awards
  • Skype: gazea2
Re: A.I. Tutor?
« Reply #4 on: October 12, 2010, 12:54:32 PM »
I wouldn't mind helping you guys. :)


Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7587
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #5 on: October 12, 2010, 12:56:30 PM »
Me neither. Most is just trial+improvement though.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #6 on: October 12, 2010, 12:57:14 PM »
I need to learn the most BASIC!

Flippers are basic right?
I do those awful YouTube videos.

Offline J24

  • Ultra Heavyweight
  • Posts: 1568
  • Rep: 0
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #7 on: October 12, 2010, 12:59:13 PM »
basic is easy km, just look at the tutorial on the main page
i'd like to be able to fine tune my ai's

oh and @S_M, i did trial a lot, but i was rather lacking in the improvement part
<<< Stalk me on the Twitter! (... Please... I'm lonely)

4th place in COTT! My word...

Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7587
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #8 on: October 12, 2010, 01:04:13 PM »
What do you need to know how to tune?
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline NFX

  • *
  • Posts: 14035
  • Rep: 11
  • SliSliSliSliSliSliSliSli(0)
    • AwesomeFish921
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: nfxtreme0992
Re: A.I. Tutor?
« Reply #9 on: October 12, 2010, 01:35:12 PM »
I need to learn the most BASIC!

Flippers are basic right?

The most basic things you can AI are Rammers, SnS and Spinners, basically anything that doesn't fire a weapon, and therefore doesn't require a SmartZone.
Co-creator of The RA2 Randomiser



Offline SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #10 on: October 12, 2010, 03:08:02 PM »
Most basic moving weapon.
I can Ai a rammer, just.
I do those awful YouTube videos.

Offline Pwnator

  • *
  • Posts: 6676
  • Rep: 15
  • Awards BOTM Winner
    • View Profile
    • http://pwnator.tumblr.com
    • Awards
  • See profile for gamer tags: Yes
Re: A.I. Tutor?
« Reply #11 on: October 13, 2010, 02:14:49 AM »
Just get Starcore, then find a bot that acts just like yours and copy/paste the bindings and fix the names. :D
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 JoeBlo

Re: A.I. Tutor?
« Reply #12 on: October 13, 2010, 04:51:51 AM »
The most basic things you can AI are Rammers, SnS and Spinners,

SnS can quickly become one of the more complex to AI... FBS.py and FBS_1.py (and there versions) all use multiple unique values (if AI'd correctly) can be a bit of a handful for newbies

also there seems to be 2 questions going on here...

I heard fine tuned and basics.. erm these are 2 different things?

  • to fine tune correctly you need to know what each value does, the possibilities of each and how they interact with each other too....
  • basics you just need to know how to name stuff  and copy and paste :P

Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: A.I. Tutor?
« Reply #13 on: October 13, 2010, 09:14:55 PM »
The only thing you ALWAYS need to fine-tune on AI is turn and turnspeed.


To get the optimum values, set 'turn' to 100 and 'turnspeed'  to something like 2.5.  Then do a test battle.  Use a human-controlled bot and drive in circles around the bot you're trying to AI.  It will do one of three things:


1. Turn in a slow, jerky way, like turn-stop, turn-stop, turn-stop.


2. Turn smoothly and quickly to face you.


3. Swing back and forth as it tries to face you but overshoots its turns.


If the AI bot does #2, congratulations, turnspeed is optimized.  If it does #1, then turnspeed needs to be higher.  And if it does #3, then turnspeed should be a little lower.  Most of the time, bots will turn too fast and do #3.


If you get down to a turnspeed of 1 and the AI still overshoots its turns, then you need to decrease turn (which is how much throttle the AI applies to turning).  Start at 50 and then repeat the same process you did for turnspeed.  If you set turn low enough, you can increase turnspeed to compensate, which may let the AI make faster turns overall, especially for superfast rammers.  Superfast rammers almost always need 'turn':50 or less (but not necessarily 'turnspeed':1).


There are other things to optimize depending on what .py you're using, but I won't go into those.  Turnspeed is the only one that applies to every bot.  Well, except SnS's I suppose.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline Resetti's Replicas

  • *
  • Posts: 4399
  • Rep: 18
  • Replica King
    • ResettisReplicas
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: A.I. Tutor?
« Reply #14 on: October 18, 2010, 11:53:31 AM »
Thank you Click, that's exactly the kind of information I've been looking for.  Do you think you could do another quick tutorial on some other AI topics?  Specifically "radius," "throttle," and optimal smartzone placement; I've always found those three troublesome.

Offline Little lost bot

  • Heavyweight
  • Posts: 684
  • Rep: -1
  • Apparently jumping onto band wagons.
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #15 on: October 18, 2010, 12:18:07 PM »
When ever I try to AI a hammer bot they always run away from there opponents. Yet I AI a flipper or a hover and they seem to work fine. 

Is taking one challenge request. First come first serve. I'm a bit rusty now but I'm going to try and crank something out for this. MW and up no glitches DSL or Stock.

Offline Scorpion

  • Giga Heavyweight
  • Posts: 5431
  • Rep: 2
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #16 on: October 18, 2010, 12:27:52 PM »
When ever I try to AI a hammer bot they always run away from there opponents. Yet I AI a flipper or a hover and they seem to work fine.
Sounds to me like you've set the nose the wrong way round on the hammer bot.
Look in the bindings of the bot for a part called "nose math pi" if it has a *2 after it delete the *2 part, and if it doesn't, add it, that should probably fix it.

Offline NFX

  • *
  • Posts: 14035
  • Rep: 11
  • SliSliSliSliSliSliSliSli(0)
    • AwesomeFish921
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: nfxtreme0992
Re: A.I. Tutor?
« Reply #17 on: October 18, 2010, 12:48:30 PM »
What .py are you using?
Co-creator of The RA2 Randomiser



Offline Little lost bot

  • Heavyweight
  • Posts: 684
  • Rep: -1
  • Apparently jumping onto band wagons.
    • View Profile
    • Awards
Re: A.I. Tutor?
« Reply #18 on: October 18, 2010, 02:06:39 PM »
I use the stock AI's I can't seem to edit in side files even with not pad ++ (some alone those lines) I do make sure that its facing the right way and so on. Maybe I should try again soon. I haven't tried to AI'd since last winter. I'll let you guys know how it turns out once I'm home and AI'd a hammer. I got several AI'd bots would you guys like to take a look at them?

Is taking one challenge request. First come first serve. I'm a bit rusty now but I'm going to try and crank something out for this. MW and up no glitches DSL or Stock.

Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: A.I. Tutor?
« Reply #19 on: October 24, 2010, 01:31:31 PM »
Thank you Click, that's exactly the kind of information I've been looking for.  Do you think you could do another quick tutorial on some other AI topics?  Specifically "radius," "throttle," and optimal smartzone placement; I've always found those three troublesome.


Most bots work well with a radius of 1.  It's only really huge bots that need a bigger one.  In that case, I just gradually increase the radius in increments of 0.1 or 0.2 until the bot successfully avoids hazards.


Throttle hardly ever needs optimizing.  In fact, I can't even think of any reason you would use any value other than 100.  Topspeed you occasionally may want a cap on, however, if for example you have a fast bot that flips itself if it rams the opponent too fast.  (Why topspeed and not throttle?  Because in a shoving match, a bot with low throttle will not push the opponent with all its power, even if it is moving very slowly.  A bot with low topspeed will apply full power until it reaches the topspeed, at which point it will slow down.  Much better in shoving contests.)  Since you really only need to bother with topspeed on very fast bots, a starting value of about 'topspeed':5 is pretty good.  From there, just do some test battles and make it as high as you can go without the bot flipping itself.


Smartzone placement is a bit hit-and-miss.  There are some general rules though.  For true popups and hammers, the smartzone should be placed so the edge is aligned with the tips of the razors in the down position (or whatever weapon it uses).  For flippers, the smartzone should be placed as far back as is reasonable, so the bot gets maximum leverage on the opponent.  Do a few test battles--if the AI sits under the opponent doing nothing, then the smartzone is too far back.  But if the AI fires its flippers while the opponent is only sitting on the tips, which may cause the flipper to pitch forward, then the smartzone is too far forward.  And for forward-firing popups, the leading edge of the smart zone should generally be aligned with the edges of the razors while they are in the VERTICAL position (halfway between fully extended and retracted).  You want the razors to be like flippers, not little hammers, so you have to make sure the smart zone is not too far forward.  On the other hand, you often have to compromise and put the smartzone further forward than it really should be, because bots may not even reach it if it is too far back.


Also, toggling F12 makes placing smartzones 100000000x easier.  It used to be you had to place it about 20 times to get it right... that wasn't fun.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings