Author Topic: AI Essentials (.py file compilation)  (Read 3260 times)

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
AI Essentials (.py file compilation)
« 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
 
It's also linked on my RA2 Downloads page.
 
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.

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 R1885

  • *
  • Posts: 2127
  • Rep: 3
  • Forum shopping list generator.
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #1 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.

Offline Naryar

  • Posts: 23267
  • Rep: 20
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: AI Essentials (.py file compilation)
« Reply #2 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 ?

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #3 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.

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 Gauche Suede

  • Ultra Heavyweight
  • Posts: 1229
  • Rep: 1
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #4 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
 
It's also linked on my RA2 Downloads page.
 
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.

Offline Gauche Suede

  • Ultra Heavyweight
  • Posts: 1229
  • Rep: 1
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #5 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

Offline yoda9726

  • Heavyweight
  • Posts: 538
  • Rep: 5
  • You can't really dust for vomit
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #6 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?
Survival of the Fittest Is Finished!  Congratulations 090901

Offline Gauche Suede

  • Ultra Heavyweight
  • Posts: 1229
  • Rep: 1
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #7 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."

Offline yoda9726

  • Heavyweight
  • Posts: 538
  • Rep: 5
  • You can't really dust for vomit
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #8 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.
Survival of the Fittest Is Finished!  Congratulations 090901

Offline System32

  • *
  • Posts: 4663
  • Rep: 4
  • Reality
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #9 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.
Put this onto your signature if you were part of this crappy fad in '03.

Offline Resetti's Replicas

  • *
  • Posts: 4399
  • Rep: 18
  • Replica King
    • ResettisReplicas
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: AI Essentials (.py file compilation)
« Reply #10 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.

Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #11 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.

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: AI Essentials (.py file compilation)
« Reply #12 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.

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