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

Offline somestrangeguy

  • *
  • Posts: 2068
  • Rep: 2
  • If you can read this, your monitor is turned on.
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #200 on: December 04, 2009, 11:25:36 AM »
So the pistons fire in different directions? Then using topknot.py is a good idea but it unfortunately isnt exactly made for rammers since the bot Topknot is a 4 way hammer. So if someone would modify it a little then it would be suitable for rammer, however I belive its a poker bot since it uses pistons.

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #201 on: December 04, 2009, 11:49:12 AM »
Two pistons fire from either side of the bot, but they don't have weapons. The only weapons are a few spikes on the front.
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 Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #202 on: December 04, 2009, 12:03:17 PM »
Use Phil's OmniMultiZone.py (in last AI chart) and change the tactic to Ram rather than Engage. (it explains how can you do that if you open the file)

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #203 on: December 04, 2009, 12:08:08 PM »
Thanks Nary.
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 Madiaba

Re: AI-ing (.py files, coding, R+D, and help)
« Reply #204 on: December 04, 2009, 08:57:07 PM »
#Yea, thanks, Nar, SSG.
 
#We need to write an AI.py in which the builder can control some of the AI.py contents more out in the Bindings.py:
1. Choose AND Change your own AI tactics:
....list.append(("Fabiot","TACTICAL_CONTROL",{ StartTactic: "Engage", NoWeaponsTactic: "Ram", BackUpTactic: "Evade", ....
The 'BackUpTactic' needs some criteri-a/on (maybe 'no weapons'+'higher points' than opponent then scram....)
 
2. A customizable 'Range' that would trigger any 'Controller-name' command:
....'Range_1_command': 'Fire1', 'Range_1': 1.5, 'Range_2_command': 'Spin', 'Range_2': 5.
 
3. Attack during 'Immobilization' option:
....'Immobilization_Attack_Y/N': Y, ....
 
 
These are rough examples.  I've thought of more AI.py 'coding controls' that could be placed in the Bindings.py to facilitate the 'Builders choice', but I can't think of any of them right now.
If any have a suggestion for moving some adjustable parameters inside the AI.py coding out to the Bindings.py, then post it here.  We'll check it out.
 
 
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 G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #205 on: December 05, 2009, 02:39:52 AM »
Another question, is anything wrong with these bindings?

list.append(("Plunderbird 5","Omni",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':100,'turn':30,'turnspeed':5,'weapons':(24)}))

Here is the bot in question and its bindings:
https://gametechmods.com/uploads/files/plunderbird.zip

I have even tried remaking the bot, it still crashes.

This is vital, so a quick response would be greatly appreciated.
« Last Edit: December 05, 2009, 04:42:56 AM by G.K. »
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 Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #206 on: December 05, 2009, 05:10:00 AM »
GK, your problem is that you need a comma after your 'weapons' number if you have only one, that is 'weapons':(24,).

#We need to write an AI.py in which the builder can control some of the AI.py contents more out in the Bindings.py:
1. Choose AND Change your own AI tactics:
....list.append(("Fabiot","TACTICAL_CONTROL",{ StartTactic: "Engage", NoWeaponsTactic: "Ram", BackUpTactic: "Evade", ....
The 'BackUpTactic' needs some criteri-a/on (maybe 'no weapons'+'higher points' than opponent then scram....)
 
2. A customizable 'Range' that would trigger any 'Controller-name' command:
....'Range_1_command': 'Fire1', 'Range_1': 1.5, 'Range_2_command': 'Spin', 'Range_2': 5.
 
3. Attack during 'Immobilization' option:
....'Immobilization_Attack_Y/N': Y, ....

I am going to love this... right now, i am thinking WhipAround tactic when losing a wheel.

If i am not mistaken it should be written in Bindings.py first ?

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #207 on: December 05, 2009, 05:15:13 AM »
 :mrgreen: :mrgreen: Thanks so much Nary, I can't belive it was something that small.
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 G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #208 on: December 09, 2009, 03:10:59 PM »
A new question,

What do I need to add to a .py to make my robot stop attacking other robots that are upside down?
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 Somebody

  • *
  • Posts: 7200
  • Rep: 13
  • CP: +2
    • SomebodyofGTM
    • View Profile
    • My site
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #209 on: December 09, 2009, 03:17:19 PM »
Its impossible unless they`re already being counted out. Thats just the way the game works. It wanted its robots to be savage beasts and keep attacking your robots even though the boxy chassises had made our n00by bots uninvertible and stuck.
I built that big robot on that TV show that time


Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #210 on: December 09, 2009, 03:29:32 PM »
Sorry,
Its impossible unless they`re already being counted out.
Sorry, that's what I meant. I wasn't being clear.
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 Madiaba

Re: AI-ing (.py files, coding, R+D, and help)
« Reply #211 on: December 09, 2009, 08:09:02 PM »
It IS possible. Just use this command:

....plus.isUpsideDown()
 
figure out your conditions, then control your AI bot whatever way you want.
« Last Edit: December 13, 2009, 10:53:12 AM by Madiaba »
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 JoeBlo

Re: AI-ing (.py files, coding, R+D, and help)
« Reply #212 on: December 09, 2009, 08:12:09 PM »
awesome so you can make a flipper.py to turn robots over and leave them ?

Offline Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #213 on: December 10, 2009, 06:11:18 AM »
The problem with the plus.IsUpsideDown is for invertible robots.

I would use a command that detects the speed of the opposing robot, and if it is 0 for an fixed amount of time (yes, i am thinking Tick), ignore the robot.

Maybe this speed detection AND being upside down...

I MIGHT be able to figure and make this sort of .py by my own if i am really motivated.

awesome so you can make a flipper.py to turn robots over and leave them ?

Yes. And IMO it would be relatively easy to write.

Offline Madiaba

Re: AI-ing (.py files, coding, R+D, and help)
« Reply #214 on: December 10, 2009, 06:45:45 AM »
NP.  Just one of the 'conditions' in the equation:
There's:
....self.bInvertible

And if you want to move a bit deeper into the tactics:
....self.ai.bInvertible
 
An AI.py like that might be handy, Nar/Joe.  Go for 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 G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #215 on: December 13, 2009, 03:26:08 AM »
So if I just wanted to make my bot ignore upside down bots completely, do I just add 'plus.isUpsideDown(0-3)' into the .py?
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 Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #216 on: December 13, 2009, 03:46:24 AM »
Nope. Much more difficult than that - as far as i guess, plus.isUpsideDown is just a line which "detects" if a bot is inverted or not.

Offline G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #217 on: December 13, 2009, 03:57:09 AM »
Which line of the .py makes robots that are being counted out be ignored?
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 G.K.

  • *
  • Posts: 12157
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #218 on: December 13, 2009, 04:26:23 AM »
Sorry to DP, but I want to show everyone what I did. I added this to popup.py after the bit about not firing until the enemy hits the body:

        if self.weapons:
            targets = [x.robot for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
           
            fire = False
            for bot in targets:
                if not plus.isUpsideDown(bot) or self.CanDriveUpsideDown(bot):
                    fire = True
               
            if fire: self.Input(self.trigger, 0, 1)
                                   
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn

    def CanDriveUpsideDown(self, bot):
        MOVE_THRESHOLD = 3.0
       
        if bot in self.upTrack:
            t = self.upTrack[bot]
            if t.invertible: return True
            else:
                # check to see if he's moved recently
                position = plus.getLocation(bot)
                time = plus.getTimeElapsed()
                if time - t.last_time > 10:
                    # this record is too old to be reliable
                    t.last_time = time
                    t.last_position = position
                    return False
                v0 = vector3(t.last_position)
                v1 = vector3(position)
                if (v1-v0).length() > MOVE_THRESHOLD: t.invertible = True
                return t.invertible
        else:
            t = UpsideDownTracker()
            t.last_position = plus.getLocation(bot)
            t.last_time = plus.getTimeElapsed()
            self.upTrack[bot] = t
           
            return False


The bot still attacks upside down robots. What have I done wrong?
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 Somebody

  • *
  • Posts: 7200
  • Rep: 13
  • CP: +2
    • SomebodyofGTM
    • View Profile
    • My site
    • Awards
Re: AI-ing (.py files, coding, R+D, and help)
« Reply #219 on: December 13, 2009, 10:15:48 AM »
Is there a possibility of a .py that uses the moving action of the FBS.py to just go to the center of the arena and spin there, instead of chasing the other bot?
I built that big robot on that TV show that time