gametechmods

Robot Arena => Discussion => Topic started by: J24 on October 12, 2010, 12:46:35 PM

Title: A.I. Tutor?
Post by: J24 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
Title: Re: A.I. Tutor?
Post by: SteveM4 on October 12, 2010, 12:47:39 PM
If anyone's telling, I will also be sticking around!
Title: Re: A.I. Tutor?
Post by: J24 on October 12, 2010, 12:51:50 PM
What?
Title: Re: A.I. Tutor?
Post by: SteveM4 on October 12, 2010, 12:54:19 PM
I need to learn also!
Title: Re: A.I. Tutor?
Post by: Gazea2 on October 12, 2010, 12:54:32 PM
I wouldn't mind helping you guys. :)
Title: Re: A.I. Tutor?
Post by: Squirrel_Monkey on October 12, 2010, 12:56:30 PM
Me neither. Most is just trial+improvement though.
Title: Re: A.I. Tutor?
Post by: SteveM4 on October 12, 2010, 12:57:14 PM
I need to learn the most BASIC!

Flippers are basic right?
Title: Re: A.I. Tutor?
Post by: J24 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
Title: Re: A.I. Tutor?
Post by: Squirrel_Monkey on October 12, 2010, 01:04:13 PM
What do you need to know how to tune?
Title: Re: A.I. Tutor?
Post by: NFX 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.
Title: Re: A.I. Tutor?
Post by: SteveM4 on October 12, 2010, 03:08:02 PM
Most basic moving weapon.
I can Ai a rammer, just.
Title: Re: A.I. Tutor?
Post by: Pwnator 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
Title: Re: A.I. Tutor?
Post by: JoeBlo 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?

Title: Re: A.I. Tutor?
Post by: Clickbeetle 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.
Title: Re: A.I. Tutor?
Post by: Resetti's Replicas 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.
Title: Re: A.I. Tutor?
Post by: Little lost bot 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. 
Title: Re: A.I. Tutor?
Post by: Scorpion 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.
Title: Re: A.I. Tutor?
Post by: NFX on October 18, 2010, 12:48:30 PM
What .py are you using?
Title: Re: A.I. Tutor?
Post by: Little lost bot 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?
Title: Re: A.I. Tutor?
Post by: Clickbeetle 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.