Author Topic: AIing Trouble  (Read 5854 times)

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« on: November 27, 2008, 11:50:15 AM »
Okay, I have an AI issue I was hoping someone knew how to fix. The issue is that one of my bots, a popup-ish bot, will not self-right when he is in a certain position, even though when human controlled he has no problem doing it. Here is the position he is in:



Here are all the specifics of my problem:

* In the bindings.py, I have him set for invertible, but also gave him a srimech.

* This is in DSL, as you can see.

* When human controlled, I can fire my weapon when in this position, and get in to a verticle position. In this position, my wheels touch the gorund, and I can spin them and self-right the bot.

* When computer controlled, and in the verticle position, the AI can self-right the bot. But when in the bad position, the AI will not fire the weapon to allow the bot back into the verticle position.

If there is any info I have left out that is needed please tell me. Any help would be greatly appreciated. :|
Any comments would be appreciated. :D

Offline Madiaba

AIing Trouble
« Reply #1 on: November 27, 2008, 12:18:59 PM »
Urj, if you can PM me the bot to actually see it working, I'll get to it later today.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #2 on: November 27, 2008, 12:21:54 PM »
Okay, I will. Thanks.
Any comments would be appreciated. :D

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
AIing Trouble
« Reply #3 on: November 27, 2008, 12:40:24 PM »
Quote from: Urjak;22922
Okay, I will. Thanks.

if your bot is invertible this mean you can drive it while inverted. this is not the case.

More over it 's a kind of cheat because many AI continue to fight bot invertible that are inverted (and give them a chance to get back on their wheels) while they let them get immobilized when they are not invertible.

By the way :
- tell you're bot is not invertible
- verify that your Srimech control start with 'S' and not 's'
- at last, verify the AI you use get this code
Code: [Select]
  def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "weapon"
        self.triggers = ["Fire"]
self.trigger2 = ["Srimech"]
 ...

   def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #4 on: November 27, 2008, 12:45:20 PM »
There is one issue though. It does not complelty self-right when it fires. It gets back to a verticle position, and with out thinking it is invertible, it will just stay there and not turn its wheels, thus not allowing to completly self-right.
Any comments would be appreciated. :D

Offline Madiaba

AIing Trouble
« Reply #5 on: November 27, 2008, 12:47:44 PM »
Phil covered most of it; 'Thanks'. You might also check the start/end locations of the bm's.
If there's still probs, PM it.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Madiaba

AIing Trouble
« Reply #6 on: November 27, 2008, 01:26:59 PM »
Urj, even when I removed your upper 'Angled side panel' the burst motors will hardly even flip your bot over past all the wedges stuff on the front of your bot. They would have to lift it allot higher to get past it all. And that after I raised your 2 Mag snappers up higher in the chassis.
You're going to have to redesign the bot to enable it to flip itself easier/better. If you could decrease the length of your wedgies, then it might SRM ok and consistently. Then try it again.
Other than that, nice, fast, effective bot.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #7 on: November 27, 2008, 01:35:30 PM »
Thanks for the help. But I am not trying to flip my bot all the way over. I am trying to get the AI flip it back to the Verticle position, which I know it can do, then turn the bots wheels to self-right. My issue is I can't get it to activate the bots weapon to put it into the verticle position. But if it is in the verticle position, the AI can self-right it.
Any comments would be appreciated. :D

Offline Madiaba

AIing Trouble
« Reply #8 on: November 27, 2008, 01:43:28 PM »
I see.  Unfortunately, neither the SRM nor the driving work well in a vertical position.
If you know how, you could write a py that in an inverted situation, the SRM kicks in and then also actuates the drive wheels to go forward/backward for x number of seconds, to finish the uprighting.
I don't have the time to do it, else I would for you. But I think Phil (and a couple others) might be able to do it for you, if they've time.

Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
AIing Trouble
« Reply #9 on: November 27, 2008, 01:46:04 PM »
Hack the AI (save it before):
add a command to turn your wheels when inverted :
Code: [Select]

   def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
                self.Input('LeftRight', 0, 100)
            for i in range(0, 8):
                self.Input('LeftRight', 0, 100)

and if you want to do it clean, copy your AI under 'myAIName.py'

change the InvertHandler function as above and change also :
Code: [Select]
class MyAIName(AI.SuperAI):
    "MyAIName strategy"
    name = "MyAIName"
...
AI.register(MyAIName)

and if you want to turn the other direction : self.Input('LeftRight', 0, -100)

Well if that works it may be your FIRST AI !

Offline Madiaba

AIing Trouble
« Reply #10 on: November 27, 2008, 01:57:46 PM »
Cool, Phil. It might be better, Phil to divert the wheel 'input' out of "def InvertHandler", back under "def Tick" where the SRM mode would activate a 'Timer', so that when the bot is pointing upward/vertical and the SRM may/may not be activated, that the wheels will still do their spinning for a time, to either (1) finish the self-right, or (2) get back into the "def InvertHandler" mode to try again... and not be left in limbo.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #11 on: November 27, 2008, 02:02:54 PM »
Thanks for all the help guys, I will defianlty try this out. :D
Any comments would be appreciated. :D

Offline WhamettNuht

  • *
  • Posts: 1302
  • Rep: 12
  • Robot Building Drag Queen
    • View Profile
    • Awards
  • Discord: WhamettNuht #1457
AIing Trouble
« Reply #12 on: November 29, 2008, 04:45:52 PM »
I have a bot of a prblem as well.
My Beauty 2 replica selfrights when on its flipper, but when it gets on its back, it wont fire again.
Can someone help me aswell?
Damn I should probably put something fancy in this bit huh?

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
AIing Trouble
« Reply #13 on: November 30, 2008, 08:08:27 AM »
Quote from: WhamettNuht;23048
I have a bot of a prblem as well.
My Beauty 2 replica selfrights when on its flipper, but when it gets on its back, it wont fire again.
Can someone help me aswell?


show picture with explanation and tell what AI you use please.

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
AIing Trouble
« Reply #14 on: November 30, 2008, 10:06:08 PM »
When a bot is on its back ('back' here meaning not upside down, but balanced on the rear end, I'm assuming) the AI doesn't think it's still upside down, so it will try driving.  As far as I know there's no way for the AI to detect this situation (well, there probably is, but I don't know it) short of putting something on the back of your bot so it can't balance there.

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 Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #15 on: January 31, 2009, 12:16:12 PM »
For the sake of not creating a new thread, I have another AI problem.

My AIed sit n' Spin will not stop spinning and move if it is being counted out for staying still, thus it will always lose its matches through immobility. If you have any help or other information for me to specifiy, please post.
Any comments would be appreciated. :D

Offline Sage

  • *
  • Posts: 6179
  • Rep: 11
  • RA2 Wizard & GTM's Favorite Stock Builder 2015
  • Awards Sage's Favorite BOTM Winner
    • View Profile
    • Awards
AIing Trouble
« Reply #16 on: January 31, 2009, 12:55:46 PM »
Quote from: Urjak;27851
For the sake of not creating a new thread, I have another AI problem.

My AIed sit n' Spin will not stop spinning and move if it is being counted out for staying still, thus it will always lose its matches through immobility. If you have any help or other information for me to specifiy, please post.


if you downloaded the RAW bots pack, it came with an FBS.py (or something like that) which i used for pinball. it works a lot better than pillar. try using that.
You got my vote for RA2 Wizard. Always and forever.

Offline Madiaba

AIing Trouble
« Reply #17 on: January 31, 2009, 04:36:10 PM »
Thanks, Sage.
Or here: FBS_1. Almost flawless removal from countdowns, plus a couple other convenient User defined options. Comes with ReadMe very easy instructions too.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
AIing Trouble
« Reply #18 on: February 01, 2009, 11:18:35 AM »
Okay cool. Thanks for the help! :D
Any comments would be appreciated. :D

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
AIing Trouble
« Reply #19 on: February 03, 2009, 06:48:54 PM »
I have an AIing problem too (and yes Mad, I would like to solve it myself)

Anyways, I tried to AI my BBEANS 5 bot on Spin Doctor's AI line (I copied the line and replaced BW-Bird of Prey with it). I then changed the name, and put Bot of 1000 Names into the teams files. The bot shows up in game. The bot will start the battle. But when the battle starts, the bot does not run, and is facing sideways. (to its left, if it matters)

Bot of 1000 Names is a 36 weaponed spinner, with Spin Doctor's drive (but shinies instead of slipperbottoms).

The AI line is only set up for 30 weapons, and uses Omni. What should I do?
I built that big robot on that TV show that time