Author Topic: AI-ing (.py files, coding, nose-orienting R+D, and help)  (Read 159461 times)

Offline Lightning S.

  • Heavyweight
  • Posts: 440
  • Rep: 6
  • no one knows except the nose
    • https://www.youtube.com/c
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1160 on: July 21, 2015, 09:19:24 PM »
Few things I've been wondering.
- Is there an AI file that uses drive for a srimech? I've tried just wiring the drive as "Srimech", but once the bot is upright, it's drive stays stuck as if it were still upside-down.
- Is there an AI that uses smartzones to spin a weapon motor?
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it?

Offline RedAce

  • Host of The Award Winning Deathmatch Series
  • *
  • Posts: 3966
  • Rep: 21
  • Yep, I'm that RedAce guy.
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: redaceofsp4des
  • Discord: ThatRedAceGuy#3618
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1161 on: July 21, 2015, 09:27:30 PM »
Few things I've been wondering.
- Is there an AI file that uses drive for a srimech? I've tried just wiring the drive as "Srimech", but once the bot is upright, it's drive stays stuck as if it were still upside-down. Somewhat. BountyHunter.py combines driving and fires whatever weapon (typically popup) to self-right. Probably the closest thing you might get.
- Is there an AI that uses smartzones to spin a weapon motor? I believe EcoOmni does this, and it saves battery life.
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it? Yep, and the I believe the button for the inverter needs to wired as "Invert."
Hopefully I helped out.

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7006
  • Rep: 22
  • :mrgreen:
  • Awards Donated money for site hosting 2019 GTMCS2 Divison Winner GTMCS Division Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1162 on: July 21, 2015, 09:29:30 PM »
1. What do you mean by that? If you mean uses the drive and srimech the bot already has to help flip it over bountyhunter.py may be what you are looking for
2. Yes, it's in NarAI and is called "SZspinner.py"
3. No, it just has the bot drive inverted once the srimech breaks, the newest version of Popup.py supports upside-down driving and I believe it just uses the srimech to flip the bot over, if you want a version of it that also supports spinning weapons I have a version I threw together for one of my bots like a year ago.

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1163 on: July 21, 2015, 09:39:03 PM »
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it?

Do you still have my bot Mockery Of The Whole Concept from your previous tourney a couple of years ago? I'd open that up and see how that was wired. Make sure it's the AI'd version Trov did, because I found the version I had originally sent you the other day in my Robot Designs folder and that was wired all over the place.

As 090901 says, the newest version of Popup.py has a feature which will use the srimech to invert the bot, if you're after something simple.
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline Lightning S.

  • Heavyweight
  • Posts: 440
  • Rep: 6
  • no one knows except the nose
    • https://www.youtube.com/c
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1164 on: July 21, 2015, 11:33:19 PM »
Thanks guys, but I'm still running into stuff. I managed to find a workaround to using drive as a srimech, but SZspinner doesn't spin the weapon motor even though I named the smartzone accordingly and unfortunately I don't still have G.K.'s bot, so idk how to get a bot to upright itself using popup.py. Anyone know this stuff?

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7006
  • Rep: 22
  • :mrgreen:
  • Awards Donated money for site hosting 2019 GTMCS2 Divison Winner GTMCS Division Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1165 on: July 22, 2015, 12:16:20 AM »
From the notes in Popup.py
Code: [Select]
#Set variable 'RunUpsideDown' to 1 for bots that flip over at the beginning of the match and fight upside down.  Such bots must be invertible as well.
# UPDATE 7/4/11: Added support for upside down bots, conditional invertibility, and made AI fire srimech if the bot is stuck on its rear.

I checked and the newest version of EcoOmni does support smartzones, check the .py files for the notes on how to do it.

Offline Lightning S.

  • Heavyweight
  • Posts: 440
  • Rep: 6
  • no one knows except the nose
    • https://www.youtube.com/c
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1166 on: July 22, 2015, 01:53:50 AM »
That second line of code was initially missing from the .py I was using; turns out I had outdated versions of both AI files. Thanks for pointing that out.

Offline RedAce

  • Host of The Award Winning Deathmatch Series
  • *
  • Posts: 3966
  • Rep: 21
  • Yep, I'm that RedAce guy.
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: redaceofsp4des
  • Discord: ThatRedAceGuy#3618
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1167 on: August 08, 2015, 05:15:37 PM »
I'm trying to AI an SnS, but I want it to spin in the opposite direction from normally. What portion of the AI line in FBSPlus.py or FBSInvertDir.py determines the direction of the spin?

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7558
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1168 on: August 08, 2015, 05:18:09 PM »
I'm trying to AI an SnS, but I want it to spin in the opposite direction from normally. What portion of the AI line in FBSPlus.py or FBSInvertDir.py determines the direction of the spin?
'direction':1

1 = clockwise, -1 = counterclockwise
How you make Alarm Clock Pizza is:
Step 1: You buy an alarm clock from the store, and then you have to break it and put it in the sauce.
Step 2: Fold the sauce in 5 slices and put it in the dough.
Step 3: Paint the eggs with a pitcher of a clock showing what time you want to wake up and eat pizza for breakfast.
Step 4: Put the eggs in the dough.
Step 5: Make it flat into a round shape and draw the time you want on it.
Step 6: Put some old steel to prevent other peple from stealing it.
Step 7: Make it flat and cut into 60 slices 1 for each minute in 1 our.
Step 8: Put in the oven set the timer to 30048813.2884 seconds and put the temperature on 'Volcano' setting.
Step 9: If you think it is take to long, then get yor alarm clock and set it to now so that it will ring and you can take it out.
Step 10: Take it out uv the uvin wen it is redy and go to bed. In the morning eat pizza and also eat yor hands bi mistake.

Offline Conraaa

  • Certified Hood Classic
  • *
  • Posts: 3325
  • Rep: 10
  • I like my sugar with coffee and cream
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1169 on: October 23, 2015, 05:00:55 PM »
I need a different AI for one of the robots for Pot Luck 2 (Guess which). What I need is other.py (Littlemetalfriend) but for it to raise a linear actuator up to its max when nothing is in the smartzone.

Any ideas?

Offline Silverfish

  • The Hardest Part of Ending is Starting Again
  • Super Heavyweight
  • Posts: 843
  • Rep: 3
  • Welcome to the quiet before the storm hits...
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1170 on: October 23, 2015, 09:48:32 PM »
well, i'm not the best at aiing, but i think you may have to program your own.  :rage
Tourney stuffs:

"We need a new way to defeat them... Something they haven't seen. Something... no one... has ever seen..."
-Gelorum, Acceleracers: Ignition

Youtube(cuz I can't use the normal link): https://www.youtube.com/channel/UCZ8zJZecbrpqiZK2eLnKLAA

Offline cephalopod

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1171 on: October 24, 2015, 03:37:33 AM »
Could you do something with something like omnimultizone and wire a whole load of other smartzones further out in a ring to rise the actuator? Bit of a dodgy solution, I will admit.
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline RedAce

  • Host of The Award Winning Deathmatch Series
  • *
  • Posts: 3966
  • Rep: 21
  • Yep, I'm that RedAce guy.
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: redaceofsp4des
  • Discord: ThatRedAceGuy#3618
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1172 on: October 31, 2015, 04:46:18 PM »
So I've been trying to AI this Ironforge Kheper style bot, but what I've given it is wonky as hell.  Can someone help out with this bot

Thanks in advance.

Online apanx

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1173 on: November 03, 2015, 12:19:00 PM »
I need a different AI for one of the robots for Pot Luck 2 (Guess which). What I need is other.py (Littlemetalfriend) but for it to raise a linear actuator up to its max when nothing is in the smartzone.

Any ideas?

Don't use smartzones to emulate stuff better handled by code. Make a variant of the Littlemetalfriend.py code You'll figure it out...

From:
Code: [Select]
    def Tick(self):
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0]
        if len(targets) > 0:
            # TODO: squeeze and push? or whip?
            self.Input("Lefthook", 0, -100)
            self.Input("Righthook", 0, -100)
        else:
            # TODO: open arms back up?
            self.Input("Lefthook", 0, 0)
            self.Input("Righthook", 0, 0)
           
        return AI.SuperAI.Tick(self)


To:
Code: [Select]
    def Tick(self):
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0]
        if len(targets) > 0: #When stuff in smartzone. Push Kill trigger
            self.Input("Kill", 0, 1)
        else: #When smartzone empty, Fully raise lineal acutator
            self.Input("RaiseLinAcu", 0, 100)
           
        return AI.SuperAI.Tick(self)

You can also use self.GetPistonPosition(ID of piston) to make the AI not touch pistons when fully raised.
« Last Edit: November 03, 2015, 12:40:05 PM by apanx »

Offline Conraaa

  • Certified Hood Classic
  • *
  • Posts: 3325
  • Rep: 10
  • I like my sugar with coffee and cream
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1174 on: November 08, 2015, 10:22:54 AM »
I'll be honest, ai'ing is not my forte. I plugged the changed code into a copy of other.py and tried to run it with appropriate control name changes (Kill, RaiseLinAcu), and the game just crashed.

Edit: It's semi working now after I changed the AI register names, but if you could tell me how to use self.GetPistonPosition(ID of piston) so it can stop being a walking havok bomb that'd be great.

Offline Lightning S.

  • Heavyweight
  • Posts: 440
  • Rep: 6
  • no one knows except the nose
    • https://www.youtube.com/c
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1175 on: November 14, 2015, 01:34:16 PM »
Anyone know where I can find DirectionalSpinner.py?

Offline RedAce

  • Host of The Award Winning Deathmatch Series
  • *
  • Posts: 3966
  • Rep: 21
  • Yep, I'm that RedAce guy.
  • Awards BOTM Winner
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: redaceofsp4des
  • Discord: ThatRedAceGuy#3618
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1176 on: November 14, 2015, 01:35:42 PM »
Anyone know where I can find DirectionalSpinner.py?
IIRC, DirectionalSpinner is at the bottom of Spinner.py

Offline Lightning S.

  • Heavyweight
  • Posts: 440
  • Rep: 6
  • no one knows except the nose
    • https://www.youtube.com/c
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1177 on: November 14, 2015, 09:37:43 PM »
Anyone know where I can find DirectionalSpinner.py?
IIRC, DirectionalSpinner is at the bottom of Spinner.py
derp
thanks

Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1178 on: February 27, 2016, 04:13:39 PM »
I'm using omni.py and I want my bot to fire its weapon once inverted, in order to self-right. How would I do this?
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7587
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1179 on: February 27, 2016, 04:17:20 PM »
Separate control called srimech?
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything