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

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7009
  • 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 #1040 on: July 18, 2013, 06:57:19 PM »
Ok, so I need help AIing ty4er's Tusslers 3 robot. The robot refuses to drive when AI'd even though it drives fine in the bot lab, any ideas?
Put the bot and AI line up.
https://gametechmods.com/uploads/files/6512Gaze.zip
Code: [Select]
list.append(("Gaze","Omni",{'invertible':True,'radius':0.1,'topspeed':99,'throttle':130,'turn':60,'turnspeed':2.5,'range':99,'weapons':(0,)}))


Anybody?

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7009
  • 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 #1041 on: July 18, 2013, 07:51:07 PM »
I think the problem is that the arrow that tells the bot which way is facing forward is actually facing up, so the ai gets confused. I think you need a special ai, but I have no idea what would work.
Click had a bot just like this that runs off of Omni, I even tried the binding line from it (courtesy of Fracture) and it still didn't want to work.

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 #1042 on: July 18, 2013, 07:53:08 PM »
Get the bot from Fracture and check the wiring?

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1043 on: July 18, 2013, 08:49:01 PM »
I think the problem is that the arrow that tells the bot which way is facing forward is actually facing up, so the ai gets confused. I think you need a special ai, but I have no idea what would work.
You are absolutely correct. I got it working with an old AI of mine but I am reluctant to release an unfinished AI... I guess I'll send it via PM. I'll work on fixing it when I'm in the mood for doing it (I've been doing a lot on the Bot Exchange today so I don't really feel like messing with this ATM).

Bots that sit on their sides are much more complicated than bots that flip over or are less than 45 degrees from being upright or upside-down.

Offline Hydro

  • Ultra Heavyweight
  • Posts: 3123
  • Rep: 0
  • Lurking. Maybe.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1044 on: July 28, 2013, 01:20:15 AM »
Good evening, gentlemen.

I seem to be having problems with my first AI. I'm running DSL 3. In an Exhibition match, the game loads fine, but when it starts the camera is pointing off somewhere else and the game crashes after 11 seconds.

Here is my team code:
Code: [Select]
index 15
Hydrovian Expeditionary Force
"Nondefeat through denial of victory."
AI\hef.bmp
Robots: 0
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

And my Bindings.py line:
Code: [Select]
    list.append( ("WAHEY","VertSpinner",{'nose':math.pi*2,'invertible':False,'range':50,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'TrollDanceZone':1,'weapons':(0,),'sweapons':(0,)}))

Any ideas?
Hi.

Offline helloface

  • Ultra Heavyweight
  • Posts: 3895
  • Rep: -11
  • 090901's cumslave
    • https://www.youtube.com/c
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: helloface199
  • Discord: Helloface#2112
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1045 on: July 28, 2013, 01:57:10 AM »
It says "sweapons" instead pf "weapons". Also, wtf is "TrollDanceZone". And I'd use Omni instead of VertSpinner. It's easier for me. You don't have to, but it would probably be easier.
Oh I'll be doing some banging.......

Offline Hydro

  • Ultra Heavyweight
  • Posts: 3123
  • Rep: 0
  • Lurking. Maybe.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1046 on: July 28, 2013, 02:13:44 AM »
https://gametechmods.com/forums/index.php/topic,11156.0.html

I downloaded that. I think it's Click's doing.
Hi.

Offline Paranoia

Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1047 on: July 28, 2013, 02:45:47 AM »
Recently made my first custom bindings for a bot on Paranoia AI called "From Russia with Love", here is the code if any of you wish to use it for Clamp/Spinner Hybrids.


Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics


class FRWL(AI.SuperAI):
    "The Clamp/Spin AI for From Russia With Love!"
    name = "FRWL"


    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)


        self.tactics.append(Tactics.Charge(self))
        self.tactics.append(Tactics.Shove(self))
       
        self.spin_range = 3.0
       
        if 'range' in args:
            self.spin_range = args.get('range')


        self.tactics.append(Tactics.Engage(self))


    def Activate(self, active):
        if active:
            if AI.SuperAI.debugging:
                self.debug = Gooey.Plain("watch", 0, 75, 100, 75)
                tbox = self.debug.addText("line0", 0, 0, 100, 15)
                tbox.setText("Throttle")
                tbox = self.debug.addText("line1", 0, 15, 100, 15)
                tbox.setText("Turning")
                tbox = self.debug.addText("line2", 0, 30, 100, 15)
                tbox.setText("")
                tbox = self.debug.addText("line3", 0, 45, 100, 15)
                tbox.setText("")
           
            self.RegisterSmartZone("squeeze", 1)
           
        return AI.SuperAI.Activate(self, active)


    def Tick(self):
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0]
        if len(targets) > 0:
            self.Input("Clamp", 0, 100)
        else:
            self.Input("Clamp", 0, 0)
           
        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 RobotInRange(self, robot_id):
        "Return tuple of (part-of-robot-in-range, chassis-in-range)"
        # GetLastDamage returns:  component damaged, amount, at time, by player, by component
        range = self.GetDistanceToID(robot_id)
        if range < self.spin_range:
            damage = self.GetLastDamageReceived()
            if damage[3] == robot_id and (plus.getTimeElapsed() - damage[2] < 1.0):
                return (True, True)
               
        return (False, False)
       
    def LostComponent(self, id):
        #print "Lost Component!"
        return AI.SuperAI.LostComponent(self, id)


    def LostComponent(self, id):
        # if we lose all our weapons, stop using the Engage tactic and switch to Shove
        if id in self.weapons: self.weapons.remove(id)
       
        if not self.weapons:
            tactic = [x for x in self.tactics if x.name == "Engage"]
            if len(tactic) > 0:
                self.tactics.remove(tactic[0])
               
                self.tactics.append(Tactics.Shove(self))
                self.tactics.append(Tactics.Charge(self))
           
        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)


       
AI.register(FRWL)

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 #1048 on: July 28, 2013, 06:42:02 AM »
Good evening, gentlemen.

I seem to be having problems with my first AI. I'm running DSL 3. In an Exhibition match, the game loads fine, but when it starts the camera is pointing off somewhere else and the game crashes after 11 seconds.

Here is my team code:
Code: [Select]
index 15
Hydrovian Expeditionary Force
"Nondefeat through denial of victory."
AI\hef.bmp
Robots: 0
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

And my Bindings.py line:
Code: [Select]
    list.append(G("WAHEY","VertSpinner",{'nose':math.pi*2,'invertible':False,'range':50,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'TrollDanceZone':1,'weapons':(0,),'sweapons':(0,)}))

Any ideas?

There's a space in your bindings where I have put a 'G' in the quote. Get rid of the space, see if that helps.
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 Hydro

  • Ultra Heavyweight
  • Posts: 3123
  • Rep: 0
  • Lurking. Maybe.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1049 on: July 28, 2013, 09:49:01 AM »
Didn't do jack.

Also

Hi.

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7009
  • 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 #1050 on: July 28, 2013, 11:18:22 AM »
It says "sweapons" instead pf "weapons". Also, wtf is "TrollDanceZone". And I'd use Omni instead of VertSpinner. It's easier for me. You don't have to, but it would probably be easier.
There is weapons in there too. TrollDanceZone was a feature Click added to stop VS from Troll Dancing as much as they normally do.

Offline Lemonism

  • *
  • Posts: 666
  • Rep: 16
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
« Reply #1051 on: September 14, 2013, 04:29:24 PM »
Ok, so I tried to AI a rammer I made, but I ran into some problems. When the robot is the right way up all is well, but as soon as it gets turned over it won't drive correctly. It just drives forward, spins one direction, then spins the other direction, and then repeats this over and over. If it gets flipped back the right way up again it goes back to normal. Any thoughts?

The bindings line for reference:
Code: [Select]
    list.append(("Taurus","Rammer",{'invertible':True,'nose':math.pi,'radius':0.1,'topspeed':160,'throttle':160,'turn':60,'turnspeed':2.5}))I'm using DSL 3 with Wham's Robot Wars 2013 AI Pack beta installed.
Download Mortis.py
Download some of my DSL2.2 Bots

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 #1052 on: September 14, 2013, 04:39:39 PM »
That usually happens if you forget the invertible code on a non-invertible bot. Since you have the invertible in bindings, I don't know what's wrong.

Offline Lightning S.

  • Heavyweight
  • Posts: 439
  • 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 #1053 on: October 02, 2013, 10:30:28 PM »
I'm trying to get stuff done for Strict Battlebots AI and so far most everything has been going smoothly, but when I tried to test team 15 (16), the game crashed when I clicked it from the drop-down menu. Anyone know why this is happening?

Offline Lightning S.

  • Heavyweight
  • Posts: 439
  • 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 #1054 on: October 05, 2013, 07:00:58 PM »
^ Anyone know what's going on here? Also, I replaced the splash, but the old one is still coming up. What do I do to fix that?

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 #1055 on: October 05, 2013, 07:13:56 PM »
Check the Teams.txt file and make sure everything is exactly right.

Offline Lightning S.

  • Heavyweight
  • Posts: 439
  • 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 #1056 on: October 05, 2013, 08:04:21 PM »
I can't spot anything out of place, but I can't think of what else it could be. I'll leave it here in case anyone spots anything.
Code: [Select]
index 15
The Forgotten
"Does anyone remember us?"
AI\who.bmp
Robots: 0 1 2
Robot In Event: -1
0
16
16
0
0
0
0
0
100000
true
0
false
0
-1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0
0

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 #1057 on: October 06, 2013, 05:01:56 PM »
Is who.bmp a 128/128 24-bit bitmap?

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7009
  • 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 #1058 on: October 06, 2013, 05:15:29 PM »
team bindings pls

Offline Lightning S.

  • Heavyweight
  • Posts: 439
  • 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 #1059 on: October 06, 2013, 08:18:54 PM »
Is who.bmp a 128/128 24-bit bitmap?
Just looked that up and no, somehow I overlooked that. Working now, thanks!