gametechmods

Robot Arena => Modifications => Topic started by: Clickbeetle on August 04, 2012, 12:52:05 AM

Title: AI Essentials (.py file compilation)
Post by: Clickbeetle on August 04, 2012, 12:52:05 AM
Let's face it:  the current state of AI .py's is a mess.  Even a commonly used .py like Popup is not available anywhere individually; you have to get it in an AI pack, and then you have to hunt down the newest version.  Finding the right .py for the job can be a chore, and this is probably a major obstacle for new people getting into AI'ing.
 
So I gathered 15 of the most commonly used AI's and put them all together in a single download.
 
http://beetlebros.gametechmods.com/files/AIessentials.zip (http://beetlebros.gametechmods.com/files/AIessentials.zip)
 
It's also linked on my RA2 Downloads page.
 
http://beetlebros.gametechmods.com/robotarena.htm (http://beetlebros.gametechmods.com/robotarena.htm)
 
The .py's I included are Omni, InvertOmni, InvertOmni2, EcoOmni, SpinupOmni2, Popup, VertSpinner, FBS_2, FBSPlus, FBSInvertDir, Flipper2, BiDirRam, ElectricHammer, LaserguidedV2, and Tactics.
 
Note:  Flipper2.py is the improved Flipper.py I posted earlier, I just changed the name so it doesn't overwrite the old Flipper.py anymore, since the new one still has some issues.  I also added a customizable setting for how often it fires the srimech, as requested by Sonny Resetti.
 
Note2:  I updated VertSpinner.py with an anti-Troll Dance feature.  You can now put 'TrollDanceZone' in Bindings to make the weapons spin in reverse for a longer time when self-righting, so the bot doesn't end up balancing on its nose.
 
BUT WAIT THERE'S MORE
 
I created templates for every .py that include most of the customizable features (set to default settings) so you can just pick a .py template, copy and paste it into Bindings.py, and tweak the settings as needed.  No more worrying about misplaced commas, typos, or missing parentheses!  I expect this will be a major time-saver for people running tournaments that have to do a lot of mass AI'ing.
Title: Re: AI Essentials (.py file compilation)
Post by: R1885 on August 04, 2012, 12:55:56 AM
THANK YOU CLICK.
i don't know why you're up at an ungodly hour, but I thank you anyway.
Title: Re: AI Essentials (.py file compilation)
Post by: Naryar on August 04, 2012, 01:00:11 AM
So no drum.py and EternalFLame.py, or does your VerticalSpinner makes the same job as drum ?
Title: Re: AI Essentials (.py file compilation)
Post by: Clickbeetle on August 04, 2012, 01:41:53 AM
VertSpinner.py does the same thing as Drum.
 
As for EternalFlame, I KNEW I was forgetting something.  I'll add that in a later update.  We'll see if anyone mentions any other .py's I forgot first.
Title: Re: AI Essentials (.py file compilation)
Post by: Gauche Suede on August 04, 2012, 02:09:50 AM
Let's face it:  the current state of AI .py's is a mess.  Even a commonly used .py like Popup is not available anywhere individually; you have to get it in an AI pack, and then you have to hunt down the newest version.  Finding the right .py for the job can be a chore, and this is probably a major obstacle for new people getting into AI'ing.
 
So I gathered 15 of the most commonly used AI's and put them all together in a single download.
 
http://beetlebros.gametechmods.com/files/AIessentials.zip (http://beetlebros.gametechmods.com/files/AIessentials.zip)
 
It's also linked on my RA2 Downloads page.
 
http://beetlebros.gametechmods.com/robotarena.htm (http://beetlebros.gametechmods.com/robotarena.htm)
 
The .py's I included are Omni, InvertOmni, InvertOmni2, EcoOmni, SpinupOmni2, Popup, VertSpinner, FBS_2, FBSPlus, FBSInvertDir, Flipper2, BiDirRam, ElectricHammer, LaserguidedV2, and Tactics.
 
Note:  Flipper2.py is the improved Flipper.py I posted earlier, I just changed the name so it doesn't overwrite the old Flipper.py anymore, since the new one still has some issues.  I also added a customizable setting for how often it fires the srimech, as requested by Sonny Resetti.
 
Note2:  I updated VertSpinner.py with an anti-Troll Dance feature.  You can now put 'TrollDanceZone' in Bindings to make the weapons spin in reverse for a longer time when self-righting, so the bot doesn't end up balancing on its nose.
 
BUT WAIT THERE'S MORE
 
I created templates for every .py that include most of the customizable features (set to default settings) so you can just pick a .py template, copy and paste it into Bindings.py, and tweak the settings as needed.  No more worrying about misplaced commas, typos, or missing parentheses!  I expect this will be a major time-saver for people running tournaments that have to do a lot of mass AI'ing.
ummmm Click, you have LaserguidedV2 on this py pack, there's already a V3 in phil's AI chart.
Title: Re: AI Essentials (.py file compilation)
Post by: Gauche Suede on August 04, 2012, 02:13:10 AM
Just a question...

Has there ever been a .py made that uses a spin motor as a front and back hammer? Just wondering.
ElectricHammer.py
Title: Re: AI Essentials (.py file compilation)
Post by: yoda9726 on August 04, 2012, 02:25:10 AM
This is awesome.  Would've saved me a boatload of time when I was learning the basics. 


quick question, since I've never seen it.  can I get a description of BiDirRam?
Title: Re: AI Essentials (.py file compilation)
Post by: Gauche Suede on August 04, 2012, 02:30:26 AM
This is awesome.  Would've saved me a boatload of time when I was learning the basics. 


quick question, since I've never seen it.  can I get a description of BiDirRam?
"For rammers with weapons in both front and back.  Dynamically switches directions and attacks with whichever side has more weapons."
Title: Re: AI Essentials (.py file compilation)
Post by: yoda9726 on August 04, 2012, 02:36:31 AM
Thanks, realized a minute ago I could probably open the py itself and there'd probably be a description.   Wasn't thinking at the time.
Title: Re: AI Essentials (.py file compilation)
Post by: System32 on August 11, 2012, 07:27:43 PM
VertSpinner.py does the same thing as Drum.
 
As for EternalFlame, I KNEW I was forgetting something.  I'll add that in a later update.  We'll see if anyone mentions any other .py's I forgot first.

You are missing Bumble.py.
Title: Re: AI Essentials (.py file compilation)
Post by: Resetti's Replicas on September 20, 2012, 10:34:54 PM
This is awesome Click!  Now I can finally stop asking dumb questions about each py.  I love how you've set it up so that I can look back to the .py for the meaning of each variable.
Title: Re: AI Essentials (.py file compilation)
Post by: 123savethewhales on September 22, 2012, 11:36:09 PM
VertSpinner.py does the same thing as Drum.
So what's a good trolldance number for a drum?  And do I need anything other than vertspinner.py cuz I can't find the trolldance script in there.
Title: Re: AI Essentials (.py file compilation)
Post by: Clickbeetle on October 14, 2012, 05:00:38 PM
VertSpinner.py does the same thing as Drum.
So what's a good trolldance number for a drum?  And do I need anything other than vertspinner.py cuz I can't find the trolldance script in there.

The trolldance script is in with the weapon activation.
Code: [Select]
        if enemy is not None and range < self.spin_range and self.weapons and abs(list(plus.getDirection(self.GetID(),0))[1]) < self.troll and not self.IsUpsideDown():
            self.Input("Spin", 0, 100)
        else:
            self.Input("Spin", 0, 0)

Basically it adds another condition that the y-coordinate of the bot's heading must be less than a certain value (self.troll) before the weapon spins normally.  I used a value of 0.7, but I've only AI'd one bot that needed this feature.