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

Offline G.K.

  • *
  • Posts: 12156
  • 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 #780 on: January 04, 2011, 04:06:18 AM »
Thanks.
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 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #781 on: January 09, 2011, 05:19:15 AM »
I need help with an custom AI.  Basically, the chassis spins vertically while moving with torque reaction.  Since the chassis will be spinning vertically, the AI will need to do this

1.  A custom inverted handler that switch it's facing 180 degrees.  (The back is the front when inverted, so the bot moves in the same direction while the chassis spins).

Here's is the bot for those interested.

https://gametechmods.com/Robot_Exchange/DSL_LW/123savethewhales_LWBigWheel.bot

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 #782 on: January 11, 2011, 11:34:25 AM »

Would it be reasonably easy for anyone to hybrid FBS.py and THz.py?
It would be nice if someone could for this bot:
so that when the weapon breaks, it stitches to melty brain (or even just SnS).
Of course, don't bother if its really difficult/ time consuming/ impossible to do. Hope someone can help.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #783 on: January 11, 2011, 09:30:25 PM »
hmm.. it wouldn't be that hard to have it switch from THz to SnS since I used coding from WhipperPlus to make that.. so its all there in the file already IIRC.

Melty Brain on the other hand.. Im pretty sure that would be a much bigger task to run from THz to Melty Brain..

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 #784 on: January 12, 2011, 10:20:23 AM »
OK, if someone could make either it would be nice. Only if you have time/ will power though.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #785 on: January 12, 2011, 11:03:10 AM »
Have neither sorry, will do it for moneyz though :P

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 #786 on: January 12, 2011, 11:04:32 AM »
*Hands over virtual moneyz*
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #787 on: January 12, 2011, 11:07:20 AM »
Sorry the exchange rate for that is awful, $AUD would be better :P

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 #788 on: January 12, 2011, 11:10:51 AM »
Sorry the exchange rate for that is awful, $AUD would be better :P
« Last Edit: January 12, 2011, 11:29:06 AM by JoeBlo »
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #789 on: January 13, 2011, 12:22:00 AM »
I need help with an custom AI.  Basically, the chassis spins vertically while moving with torque reaction.  Since the chassis will be spinning vertically, the AI will need to do this

1.  A custom inverted handler that switch it's facing 180 degrees.  (The back is the front when inverted, so the bot moves in the same direction while the chassis spins).

Here's is the bot for those interested.

https://gametechmods.com/Robot_Exchange/DSL_LW/123savethewhales_LWBigWheel.bot


:O That bot is incredible.


It spins way too fast for the AI to detect when it's "upside down" and when not, so the only way I can think of to possibly AI it is to modify def Throttle and def Turning.


Code: [Select]

    def Throttle(self, throttle):
        # if we're car steering and we're not moving much, throttle up
        if self.bCarSteering and self.last_turn_throttle != 0:
            speed = self.GetSpeed()
            if speed > 0 and speed < self.top_speed / 3: throttle = self.last_throttle + 10
            elif speed < 0 and speed > -self.top_speed / 3: throttle = self.last_throttle - 10


        throttle = min(max(throttle, -100), 100)


        if self.bInvertible and self.IsUpsideDown(): throttle = -throttle


        self.set_throttle = throttle
        self.Input('Forward', 0, throttle)
        self.DebugString(0, "Throttle = " + str(int(throttle)))


Maybe get rid of the line that says


        if self.bInvertible and self.IsUpsideDown(): throttle = -throttle


So then the AI would continue to apply the same throttle when it is upside-down and told to be invertible.  You would do the same thing for turning too.


The only problem is it might mess up the AI's navigation because the nose will be flipping back and forth... but maybe it will be fine with the throttle and turning modifications.  I don't know.  Worth a try, I guess.

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 Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #790 on: January 13, 2011, 12:53:53 PM »
I took a different approach to 123STW's problem. I tried modifying the AI so that the nose switched directions every time the bot flipped. The first problem that I ran into was that the "self.fNoseOffset" was never reloaded by the EXE after the initialization. I then tried sending the NoseOffset directly to the EXE (using "self.__setattr__fNoseOffset__(Radians)") but that didn't seem to work either. My last attempt at changing the nose involved replacing the bindings value and completely reloading the AI (by deleting it before loading it again). Unfortunately, this didn't appear to work either (the bot moved but it was still using the previous nose setting).

I thought about Click's suggestion a few times while I was testing other things but I have no idea if it would work... To test it, just copy and paste the Throttle and Turn sections from __init__.py into a custom PY. Then after commenting out the lines that Click suggested, see if it works ingame (making all the appropriate changes to the bindings (including setting invertibility to True)).

If Click's idea doesn't work, I can make a custom tactic (which was next on my list of things to try).

Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #791 on: January 13, 2011, 08:01:27 PM »
WHAT HAVE I DONE





^That battle was AI'd.  Happened the first time I tried it.


So... as you can see, I made a .py for Big Wheel.  It was actually pretty easy; you just need to delete that line in def Throttle (I was wrong about def Turning though, you need to leave that as is).


*LINK*


Then I just added a feature where you can make it spin continuously when the opponent is in range (so it won't stop dead still when the opponent is right under it).  Also, you can put 'SpinCycle':x in Bindings to make it spin back and forth for x/2 ticks in each direction when the opponent is in range (so in theory, it would drive back and forth over opponents and trample them, but in practice it seems to work better in just one direction).  Just make a new analog control named "Spin" to make the AI do that.


Now I hope I don't regret unleashing this scourge upon the tournament scene...  :frown:

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 JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #792 on: January 13, 2011, 09:50:16 PM »
Now I hope I don't regret unleashing this scourge upon the tournament scene...  :frown:

 :rage

nice work on the py though :P

its just my inspiration to finish Backlash that much faster...

Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #793 on: January 13, 2011, 11:51:01 PM »
Awesome.  Now I will have 17 teams in my AI pack instead of 16 :)

FEAR THE SCOURGE!!!!!!!!!!!!  Maybe scourge should be the name of this bot type.

Edit:  Thanks a lot.  I completely forgot to mention that due to sheer excitement.

Edit2:  Can you show the binding you used for this?
« Last Edit: January 14, 2011, 12:44:13 AM by 123savethewhales »

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 #794 on: January 15, 2011, 06:24:01 AM »
So is/ will someone work on my .py? If not, don't worry.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #795 on: January 15, 2011, 06:31:42 AM »
Edit2:  Can you show the binding you used for this?

open the .py in notepad to see the values you need to add and how they work..

So is/ will someone work on my .py? If not, don't worry.

I will have a crack at THz to SnS... still waiting for my real money though D:

send me the robot too...

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 #796 on: January 15, 2011, 06:35:45 AM »
So is/ will someone work on my .py? If not, don't worry.

I will have a crack at THz to SnS... still waiting for my real money though D:

send me the robot too...
k, thx.
I'm PM you bot.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #797 on: January 16, 2011, 11:23:57 PM »
Edit2:  Can you show the binding you used for this?


Here:


Code: [Select]
    list.append(("LW - Big Wheel","TRFBD",{'invertible':True,'range':5,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':1,'weapons':(0,)}))

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 SteveM4

  • Ultra Heavyweight
  • Posts: 2323
  • Rep: 2
  • Obviously dangerous.
    • https://www.youtube.com/c
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #798 on: January 27, 2011, 11:11:10 AM »
O Hai!

I made a bot and it starts face to the wall, how do I make it face and drive the correct way?

In the bindings, I am not re-building the bot to face the correct direction.
I do those awful YouTube videos.

Offline G.K.

  • *
  • Posts: 12156
  • 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 #799 on: January 27, 2011, 11:17:27 AM »
Post the binding line plz.
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)