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

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #940 on: April 26, 2012, 08:21:15 PM »
omg switchwep help ples


the smartzones are called PrimaryWep (big one) and SecondaryWep (small one)

when i start a battle with it it rolls forward for like 10 seconds and ignores all game rules (i.e. not affected by falling off the tabletop) and then gives me a c++ error
what do i do
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 Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #941 on: April 27, 2012, 04:55:28 PM »
i switched it to flameomni and fixed it thx for the help
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 Virus Bomb

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #942 on: May 25, 2012, 04:58:22 PM »
Does anyone know of or have an AI similar to FBSInvertDir.py that would work for HS/SnS hybrids?

Offline MassimoV

  • I Move Weight
  • *
  • Posts: 8929
  • Rep: 25
  • I make rap for people of Serbia
    • MassimoVTV
  • Awards BOTM Winner
    • View Profile
    • Mourning Glory
    • Awards
  • See profile for gamer tags: Yes
  • Skype: myhandsarefood
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #943 on: May 25, 2012, 05:05:29 PM »
What does Sawzal use?

Offline Badnik96

  • tired of your shit
  • *
  • Posts: 17536
  • Rep: 3
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #944 on: May 25, 2012, 05:19:25 PM »
FBS_2

Offline MassimoV

  • I Move Weight
  • *
  • Posts: 8929
  • Rep: 25
  • I make rap for people of Serbia
    • MassimoVTV
  • Awards BOTM Winner
    • View Profile
    • Mourning Glory
    • Awards
  • See profile for gamer tags: Yes
  • Skype: myhandsarefood
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #945 on: May 25, 2012, 05:24:53 PM »
Then use that  :gawe:.

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 #946 on: May 26, 2012, 11:58:28 AM »
Can anyone get SimpleWeapon.py to work? I need it for Scrap's CW3 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 Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #947 on: May 28, 2012, 11:58:32 AM »
is there a .py that uses ramming spikes on the front, but after those break off to use a spinning weapon on the back ?
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 MassimoV

  • I Move Weight
  • *
  • Posts: 8929
  • Rep: 25
  • I make rap for people of Serbia
    • MassimoVTV
  • Awards BOTM Winner
    • View Profile
    • Mourning Glory
    • Awards
  • See profile for gamer tags: Yes
  • Skype: myhandsarefood
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #948 on: May 28, 2012, 12:02:25 PM »
You probably have to use weapon ID but I'm not too sure what py.

Offline Virus Bomb

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #949 on: May 28, 2012, 01:02:04 PM »
is there a .py that uses ramming spikes on the front, but after those break off to use a spinning weapon on the back ?

You got BBEANS Stock Ai? If so try SwitchDirRam.

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #950 on: May 28, 2012, 01:18:26 PM »
is there a .py that uses ramming spikes on the front, but after those break off to use a spinning weapon on the back ?

You got BBEANS Stock Ai? If so try SwitchDirRam.
but does it support spinning weapons ?

edit: well it worked thx vb
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 Badnik96

  • tired of your shit
  • *
  • Posts: 17536
  • Rep: 3
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #951 on: May 28, 2012, 03:30:17 PM »
Can anyone find a problem with these bindings?

Code: [Select]
list.append(("Raging Inferno","SwitchDirRam",{'nose':math.pi,'ThresholdSpeed':0,'SightRange':0,'radius':1,'range':99,'topspeed':100,'throttle':100,'turn':100,'turnspeed':3.5,'weapons':(2,3,4,5,6,7,8,9,10,11,12,13,),'sweapons':(21,)}))

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 #952 on: May 28, 2012, 03:32:32 PM »
Extra comma after weapon 13?
No 4 spaces, tabbed instead?
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline Badnik96

  • tired of your shit
  • *
  • Posts: 17536
  • Rep: 3
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #953 on: May 28, 2012, 03:34:45 PM »
yeah it was the tab


thanks SM

Offline Badnik96

  • tired of your shit
  • *
  • Posts: 17536
  • Rep: 3
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #954 on: June 02, 2012, 12:31:45 PM »
DP

Can anyone help me with this? I'm trying to edit FBSInvertDir to support a spinning weapon for my new SnS, but in-game the bot doesn;t move for 5 seconds and then the game crashes.

Here's the Py as of now:
Code: [Select]

from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics

class FBSInvertPlus(AI.SuperAI):
    "Spins!"
    name = "FBSInvertPlus"
    #Like FBSPlus, but does not change the direction when inverted.
    #For Melty Brain type SnS/HS that are more efficient when spinning in a certain direction.
    #Brought to you by Naryar and ripped off Apanx's FBS.py
    #Modified by Clickbeetle to reduce lag
#Edited by Badnik96 to support spinning weapons

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
        self.tactics.append(Tactics.Engage(self))
       
        self.spinspeed = 6.0 #Turningspeed to achieve before moving
        self.accuracy = 0.01 #Radians
        self.rampupfactor = (math.pi / 2 - self.accuracy) * (math.pi / 2 - (math.pi - self.accuracy) ) * -1
        self.direction = 1 # 1 or -1
        self.tickFactor = 3.75
       
        if 'direction' in args: self.direction = args.get('direction')
        if 'spinspeed' in args: self.spinspeed = args.get('spinspeed')
        if 'accuracy' in args: self.accuracy = args.get('accuracy')
        if 'Ticks' in args: self.tickFactor = args.get('Ticks')
       
    def Activate(self, active):
        plus.AI.__setattr__tickInterval__(self, 0.125/self.tickFactor)
        print self.rampupfactor
       
        if active:
            if AI.SuperAI.debugging:
                self.debug = Gooey.Plain("watch", 430, 75, 250, 165)
                tbox = self.debug.addText("line0", 0, 0, 250, 15)
                tbox.setText("Throttle")
                tbox = self.debug.addText("line1", 0, 15, 250, 15)
                tbox.setText("Turning")
                tbox = self.debug.addText("line2", 0, 30, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line3", 0, 45, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line4", 0, 60, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line5", 0, 75, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line6", 0, 90, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line7", 0, 105, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line8", 0, 120, 250, 15)
                tbox.setText("")
                tbox = self.debug.addText("line9", 0, 135, 250, 15)
                tbox.setText("")

        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        if AI.SuperAI.debugging:
            speed = self.GetSpeed()
            self.DebugString(4, "Speed = " + str(speed))

            turning_speed = self.GetTurning()
            self.DebugString(5, "TSpeed = " + str(turning_speed))
        if self.weapons:
            # spin up depending on enemy's range
            enemy, range = self.GetNearestEnemy()
           
            if enemy is not None and range < self.spin_range:
                self.Input("Spin", 0, 1)
            elif self.GetInputStatus("Spin", 0) != 0:
                self.Input("Spin", 0, 0) 
 
        return AI.SuperAI.Tick(self)
       
    def LostComponent(self, id):
        #print "Lost Component!"
        return AI.SuperAI.LostComponent(self, id)
       
    def DebugString(self, id, string):
        if self.debug:
            if id == 0: self.debug.get("line0").setText(string)
            elif id == 1: self.debug.get("line1").setText(string)
            elif id == 2: self.debug.get("line2").setText(string)
            elif id == 3: self.debug.get("line3").setText(string)
            elif id == 4: self.debug.get("line4").setText(string)
            elif id == 5: self.debug.get("line5").setText(string)
            elif id == 6: self.debug.get("line6").setText(string)
            elif id == 7: self.debug.get("line7").setText(string)
            elif id == 8: self.debug.get("line8").setText(string)
            elif id == 9: self.debug.get("line9").setText(string)
           
    def StuckHandler(self):
        "This default generator is called when the bot is almost immobile."
        while 1:
            # back up for 2 seconds (will stop once we're not immobile)
            for i in range(0, 16*self.tickFactor):
                pos = vector3(self.GetLocation())
                dir = vector3(self.GetDirection())
                self.NormalDriveToLocation((pos - dir * 3).asTuple(), True)
                yield 0
            # go forward for 2 seconds
            for i in range(0, 16*self.tickFactor):
                pos = vector3(self.GetLocation())
                dir = vector3(self.GetDirection())
                self.NormalDriveToLocation((pos + dir * 3).asTuple(), True)
                yield 0
               
    def InvertHandler(self):
        # fire SRM once per two seconds (until we're upright!)
        while 1:
            self.Input("SRM", 0, 1)
           
            for i in range(0, 8*self.tickFactor):
                yield 0
               
    def Think(self):
        self.Evaluate()
        self.countdownToEvaluation = 8*self.tickFactor
       
       
    def DriveToWaypoints(self, waypoints, in_reverse = False):
        throttle = 0
        found = False
       
        while len(waypoints) > 0 and not found:
            grid = waypoints[0]
            pos = Arenas.currentArena.FromGrid(grid)
            dist = self.GetDistanceTo(pos)
           
            if dist < 1:
                waypoints.pop(0)
               
            else:
                # drive to this point
               
                h = self.GetHeadingTo(pos, in_reverse)
                 
                self.DebugString(6, str(self.GetHeading(False)))
                self.DebugString(7, str(h))
               
                h -= math.pi / 8 * self.direction
                if h > math.pi: h -= 2 * math.pi
                elif h < -math.pi: h += 2 * math.pi
                h = abs(h)
       
                if abs(self.GetTurning()) > self.spinspeed:               
               
                    turnFactor = ((h - self.accuracy) * (h - (math.pi - self.accuracy) ) / self.rampupfactor)
               
                    if (h>1.57):
                        TurnInput = int(max(100 * turnFactor, 0) * self.direction)
                        ThrottleInput = int((100 + TurnInput) * -1)
               
                        self.Turn(TurnInput)
                        self.Throttle(ThrottleInput)
                    if (h<1.57):
                        TurnInput = int(max(100 * turnFactor, 0) * self.direction)
                        ThrottleInput = int((100 + TurnInput))
               
                        self.Turn(TurnInput)
                        self.Throttle(ThrottleInput)
                 

                else:
                    self.Turn(100 * self.direction)
                found = True
        if len(waypoints) == 0:
            self.Turn(100 * self.direction)
            self.Throttle(0)
           
        return found
       
    def NormalDriveToLocation(self, world_location, in_reverse = False, update_path = True, last_path = []):
        if self.GetDistanceTo(world_location) > 1:
            if update_path:
                a = Arenas.currentArena
                a.SetSearchRadius(self.fRadius)
                waypoints = list(a.GetPath(self.GetLocation(), world_location, False))
            else:
                waypoints = last_path
           
            if len(waypoints) > 0:
                return self.NormalDriveToWaypoints(waypoints, in_reverse)
            else:
                return False
        else:
            self.Throttle(0)
            self.Turn(0)
            return False
           
    def NormalDriveToWaypoints(self, waypoints, in_reverse = False):
        throttle = 0
        found = False
       
        while len(waypoints) > 0 and not found:
            grid = waypoints[0]
            pos = Arenas.currentArena.FromGrid(grid)
            dist = self.GetDistanceTo(pos)
            dir = 1
           
            if in_reverse: dir = -1
           
            if dist < 1:
                waypoints.pop(0)
            else:
                # drive to this point
                h = self.GetHeadingTo(pos, in_reverse)
                self.AimToHeading(h, in_reverse)
                speed = self.GetSpeed()

                # slow down if we have to turn sharply
                if dist < abs(speed) and (h > .4 or h < -.4):
                    throttle = 0
                    self.boost_throttle = self.max_throttle
                else:
                    if speed * dir < self.top_speed:
                        h = max(min(h, .4), -.4)
                        # drive slower the more we need to turn our heading
                        mps = dir * (.5 - abs(h)) * self.top_speed

                        # boost throttle if we're not going as fast as we'd like
                        if (dir > 0 and speed < mps) or (dir < 0 and speed > mps):
                            self.boost_throttle += (self.max_throttle * .1)

                        throttle = dir * (.5 - abs(h)) * self.boost_throttle
                    else:
                        throttle = 0
                        self.boost_throttle = self.max_throttle
                       
                found = True
       
        self.Throttle(throttle)
       
        if len(waypoints) == 0:
            self.Turn(0)
            self.Throttle(0)
           
        return found
       
# WIP, convert this into array for support of more wheel sides
       
    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)))
       
    def Turn(self, turning):
        turning = min(max(turning, -100), 100)
        self.set_turn_throttle = turning
        self.Input('LeftRight', 0, -turning)
        self.Input('LeftRight', 1, turning)
        self.DebugString(1, "Turning = " + str(int(turning)))
           
AI.register(FBSInvertPlus)

Offline JoeBlo

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #955 on: June 04, 2012, 09:22:14 AM »
I thought there was already a FBSInvertDrivePlus python kicking around?

Offline Badnik96

  • tired of your shit
  • *
  • Posts: 17536
  • Rep: 3
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #956 on: June 04, 2012, 09:25:44 AM »
there is?

well if there is one I don't have it, it's not in NAR AI or BBEANS AI so I dunno...

Offline mistesanders

  • Antweight
  • Posts: 6
  • Rep: 0
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #957 on: June 08, 2012, 09:51:37 PM »
guys how many events have to play to open new weapons? 18 already played the game and no end. (RA2 and not TSsL)

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #958 on: June 08, 2012, 10:05:03 PM »
theres no unlockable content in ra2
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 mistesanders

  • Antweight
  • Posts: 6
  • Rep: 0
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #959 on: June 08, 2012, 10:14:26 PM »
My flamethrower, cannon and electro magnet are not 18x9 liberados.Ja played 162 games to try and unlock game is not over.