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

Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #140 on: September 26, 2009, 01:38:16 PM »
So after I read the Engage tactic, I am still not sure which line is for weapon firing.

Def Execute is clearly there to control driving behaviors, while Evaluate is there to handle priorities.  Since all I want is for the bot to hold the weapon button from start to finish without modifying the driving behaviors, is there any way to get around that?

Also, are there any guides to modifying AI available on the web?  To be honest I really don't know what a lot of the variables are suppose to do, such as self.priority.  My guess is the priority sets which tactics gets used in a given situation, base on self.target_id (which my guess is determining rather or not an enemy exist).

Aside from the timer shutdown, there's also a weapon "pulsing" problem.  Which is that the weapon turns off and on every second or so (which only becomes noticeable after I used my modded flamer).

My guess is, would it have something to do with the "scheduler" class in __init__.py?

Quote
class scheduler:
    "A 'brain' to schedule a set of actions."
    resume = 0
    done = 1
    abort = 99

    def __init__(self):
        self.actions = []

    def setActions(self, actions):
        self.actions = actions

    def tick(self):
        "Run the top action and pop them off as they're completed."
        if len(self.actions) > 0:
            result = apply(self.actions[0][0], self.actions[0][1])
            if result == scheduler.abort:
                return False
            elif result == scheduler.done:
                # this step is done, move to next
                self.actions.pop(0)
                return len(self.actions) > 0
            else:
                return True
        else:
            return False
« Last Edit: September 26, 2009, 02:01:29 PM by 123savethewhales »

Offline Madiaba

AI-ing (.py files, coding, R+D, and help)
« Reply #141 on: September 26, 2009, 02:44:26 PM »
Quote from: 123savethewhales;68607
... Since all I want is for the bot to hold the weapon button from start to finish without modifying the driving behaviors, is there any way to get around that? ...

Easy to follow method: If you simply want to use the regular AI tactics for AI steering and control, and yet have your weapon(s) fire continuously, then you can:
1. put this line under 'Tick':
 
....def Tick(self):
........self.Input("AlwaysFire", 0, 100) #Analog for flamethrower.

 
2. then name your in-game analog control the same name: 'AlwaysFire'.
 
.
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 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #142 on: September 26, 2009, 03:28:00 PM »
Quote from: Madiaba;68631
Easy to follow method: If you simply want to use the regular AI tactics for AI steering and control, and yet have your weapon(s) fire continuously, then you can:
1. put this line under 'Tick':
 
....def Tick(self):
........self.Input("AlwaysFire", 0, 100) #Analog for flamethrower.

 
2. then name your in-game analog control the same name: 'AlwaysFire'.
 
.

well, I had tried this before (seemed to be the most obvious thing at the time)

Quote
def Tick(self):
       
self.Input("Spin", 0, 100)
           
return AI.SuperAI.Tick(self)

which freezes the game.

My code now (which I posted yesterday), consist of

Quote
def Tick(self):
       
if 1 == 1:
self.Input("Spin", 0, 100)
           
return AI.SuperAI.Tick(self)

Which fires about 99% of the time.  It still has the "pulsing" problem with the AI letting go of the button for a split second (usually in between another command).  When this is combined with how flamethrower requires another motor turn on to start the flame, it creates all kinds of non firing behaviors.  It's not a problem for anything else, but for the flamethrower bug to work the button needs to be held down at all time, or the flame won't remain at full power.  I think this problem lies in __init__.py or somewhere deeper where the game stops all command for calculation so it can reassign a new sets of key it should hold.

If this is true, then the only real way to get around that is to use a custom flamethrower that doesn't use up gas to "imitate" the flamethrower bug (which is what I am using now).  Or better yet, maybe one that has the "fire" command on "switch", which I don't know how to make.
« Last Edit: September 26, 2009, 03:58:29 PM by 123savethewhales »

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #143 on: September 26, 2009, 04:45:30 PM »
yoy all know apanx's sns ai that translated whle it spun...
well i kinda need to know what u put for a bots bindings and controls. for that ai.
a 2 wheel sns would be fine as an example.
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline Madiaba

AI-ing (.py files, coding, R+D, and help)
« Reply #144 on: September 26, 2009, 10:07:36 PM »
-I know that the 'input' command DOES work fine standing alone under 'Tick'..
 
-I've also have seen a difference when enlarging the analog value for a fire. Made a couple cool AI like that, a while ago though.
 
-As far as the flamethower's intermittentness, I did notice sometimes on a few freak AI I made that there were 'lapses', for lack of a better word, of consistant firing. One of the lapses that bugs many, including me, is the lapse in consistent cannon fire. I considered that the 2 (fire lapse and cannon lapse) might be related since they both use the co2 means of simulated power...but I never followed up on it.
« Last Edit: September 26, 2009, 11:20:13 PM 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 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #145 on: September 26, 2009, 11:42:52 PM »
Quote from: Madiaba;68720
-I know that the 'input' command DOES work fine standing alone under 'Tick'..
 
-I've also have seen a difference when enlarging the analog value for a fire. Made a couple cool AI like that, a while ago though.
 
-As far as the flamethower's intermittentness, I did notice sometimes on a few freak AI I made that there were 'lapses', for lack of a better word, of consistant firing. One of the lapses that bugs many, including me, is the lapse in consistent cannon fire. I considered that the 2 (fire lapse and cannon lapse) might be related since they both use the co2 means of simulated power...but I never followed up on it.

Do you mean this?
Quote
   def Tick(self):
        # fire weapon
        if self.weapons:
           
                self.Input("Spin", 0, 100)
           
        return AI.SuperAI.Tick(self)

This works, but the moment I put # in front of if self.weapons it crashes on load.  I can replace if self.weapons with if 1 == 1 though.

Although, since the if statement isn't causing the 'lapses' (as i am using if 1 == 1 on mine), let us not get too caught up in it.

My guess is that everything has this split second lapses, it's just that it is visually impossible to tell on spin motors, burst pistons or burst motors.  It is just on those rare occasions (such as flamethrower or cannon) does this really show any visible symptoms.

Without drawing too much conclusion though, I think it's safe to say that flamethrower pulsing isn't inherently a problem on the specific AI or the tactic, but lies at a lower level.  Too bad I can't really prove anything without looking at the source code (not that I would be able to understand it anyway).

Offline Madiaba

AI-ing (.py files, coding, R+D, and help)
« Reply #146 on: September 26, 2009, 11:53:37 PM »
I have an AI.py I wrote a while back, for a 'Photon Blaster' bot. I'll PM it to you...
Look it over well and let me know of anything needing explained.
 
BTW: Nice to see you diving into the game...
.
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 roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #147 on: September 27, 2009, 09:22:51 AM »
anyone have the bindings/controls for apanx's fbs?
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline JoeBlo

AI-ing (.py files, coding, R+D, and help)
« Reply #148 on: September 27, 2009, 09:59:23 AM »
do you have the .py file ? becasue you should be able to gather most from there, I know controls are easy to find and so are any smartzones

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #149 on: September 27, 2009, 11:33:30 AM »
k ill take a look
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #150 on: September 27, 2009, 01:15:56 PM »
Quote from: Madiaba;68744
I have an AI.py I wrote a while back, for a 'Photon Blaster' bot. I'll PM it to you...
Look it over well and let me know of anything needing explained.
 
BTW: Nice to see you diving into the game...
.


I got it to work, thanks.

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #151 on: September 27, 2009, 03:24:22 PM »
couldnt find enough info in the .py, can someone plz help me?
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
AI-ing (.py files, coding, R+D, and help)
« Reply #152 on: September 30, 2009, 02:26:55 AM »

Offline 123savethewhales

  • *
  • Posts: 2923
  • Rep: 30
  • Friendship is Magic
  • Awards BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #153 on: September 30, 2009, 02:28:07 PM »
Quote
self.Input("Flame", 0, 130)

Lol @ 130

Offline roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #154 on: September 30, 2009, 02:42:59 PM »
so no bindings for the fbs ai?
edit: i need a py file that will play a sound when something passes thru a smartzone. oh and it has to loaded for every bot. not just the ai.
so say its a boxing match, and one of the robots hits the other in a certain area(the smartzone). a sound would play like "bullseye!"
« Last Edit: September 30, 2009, 03:31:04 PM by roboman2444 »
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline Clickbeetle

  • *
  • Posts: 3375
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #155 on: October 01, 2009, 11:51:24 PM »
Well it looks like the melty brain SnS's in the Nar AI just use all default settings, so you can just use regular bindings.  You don't need anything special.

As for your other question, you can make an AI that plays a sound, but you can't make it do it for other bots' smart zones.

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 roboman2444

  • Ultra Heavyweight
  • Posts: 1212
  • Rep: 0
  • Linux, Nexuiz, Quake, and Darkplaces lover.
    • View Profile
    • http://www.freewebs.com/teamrckm
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #156 on: October 02, 2009, 07:58:32 AM »
awwwwwwwwwww...
what about all of your scripts that u made... cant u use them to do that?
Real life robotics team www.teamrckm.tk
Real life game studio www.v2games.tk


Offline Naryar

  • Posts: 23283
  • Rep: 21
  • hybrids oui oui
    • http://www.youtube.com/us
  • Awards BOTM Winner
    • View Profile
    • Awards
  • Skype: TheMightyNaryar
AI-ing (.py files, coding, R+D, and help)
« Reply #157 on: October 02, 2009, 08:11:19 AM »
https://gametechmods.com/uploads/files/Drum.rar

Don't know if Click's VertSpinner works for drums as well. I tried but it didn't, so i made some easy AI for bots that need to spin upwards not inverted AND inverted, like drums.

Will be used for NAR AI v2's WIIIDELOAD... oh and i forgot to put it on Frostbite as well...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #158 on: October 02, 2009, 08:38:57 AM »
the difference between Drum and VertSpinner is that this last one allow Srimech and Fire Weapon.
As explain in the head of drum.py : it is made for invertible bot.

Offline Reier

  • Rieir
  • *
  • Posts: 8579
  • Rep: 8
  • I GOT 3RD IN RAW1
    • https://www.youtube.com/c
  • Awards old BOTM Winner
    • View Profile
    • Awards
AI-ing (.py files, coding, R+D, and help)
« Reply #159 on: October 05, 2009, 12:32:37 PM »
IDK where to put this.



Can't drive or AI it.
ALERT- Another WS coming up...
voted best bot builder two times and counting babayy. the best ra2 builder who has never won an actual tournament match
ReiAI pack for Ironforge
My drawings, and my webcomics
Why online PVP will save RA2
The problem with competitive IRL in RA2
I'm fine with hugging reier