gametechmods

Robot Arena => Tutorials and Tips => Topic started by: Madiaba on October 12, 2008, 01:51:26 PM

Title: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Madiaba on October 12, 2008, 01:51:26 PM
This thread is to help facilitate modders/builders to learn how to AI. It's fairly easy if one will just invest some time, so no 'cold feet' necessary.
 
There's been an 'AI Chart' that I started and then sent to CB, and is now with SC, (but he's been busy, NP). I'll finish up his part and send it to Goose for any other final tweaks before it goes out. It will be a simple chart of all available AI.pys kinds (Spinner, Rammer,...); their function(s); bot wiring's zone/control naming.
ANY noob can learn and do it in a short time.
Bindings line functions and tweaking, questions or input, are welcome here too.
(BTW: No inquiries or input is too easy or dumb....)
--------------------------
 
 
So to start:
Here's a new FBS AI.py that I just finished. FBS's are notorious for getting counted out while spinning. This py is very reliable to 'stop and move' when the immobilization countdown starts. It has other User-adjustable settings that you can read about for yourself in the ReadMe included. Stock and DSL.
 
FBS_1 (http://www.madiaba.gametechmods.com/FBS_1.rar)]FBS_1 (http://www.madiaba.gametechmods.com/FBS_1.rar)
 
[/color]..[/b][/URL]
 
 
 
 
 
                             Bindings.py
-Bot Nose orientaton:
(Copy+paste this coding to the top of your Bindings.py for a convenient reference)
How to use:
1. Find out where your bot is facing in-game (Exhibition), without any nose bias.
2. Then use this chart to turn it to face forward, NP.
 
 
Code: [Select]
    # nose is "front" of bot-
        #Nose paradigm: All 360 rotational degrees for "math.pi" are represented by the factor '2'.
            #thus:  '2'=360degrees,   '1'=180degrees,   '0.5'=90degrees,   '0.25'=45degrees.
        #The direction of change(CW/CCW)is determined by the "-" or "+" before the statement.
            #thus: '+' causes rotation CCW,  '-' causes rotation CW.
        #Format examples:
            # " 'nose':math.pi*0.25 "  will rotate the bot 45degrees/CCW.
            # " 'nose':-math.pi*0.25 " will rotate the bot 45degrees/CW.
            # " 'nose':math.pi*0.5 "   will rotate the bot 90degrees/CCW.
            # " 'nose':-math.pi*0.5 "  will rotate the bot 90degrees/CW.
            # " 'nose':math.pi*0.75 "  will rotate the bot 135degrees/CCW.
            # " 'nose':-math.pi*0.75 " will rotate the bot 135degrees/CW.
            # (Make sure there is a comma(,)after the the value # (to separate it from the next characteristic and its value).
            #(-----notes-----)
                # Note1:  "math.pi"   AND   'nose':math.pi*1.0 "   AND  " 'nose': -math.pi*1.0 "   will rotate the bot 180 degrees.
                    #   (The first two are the same, and the last two just rotate different directions to get 180 degrees.}
                    #   Thus there is no real reason to have a factor greater than '1',
                    #   since after that you just move into the other half of the circle covered by the other '+' or '-' sign.
                # Note2: "math.pi*0" or "math.pi*2" = the same as no new heading.


 
Again, you might copy this to the top of your Bindings.py for easy reference.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on October 12, 2008, 01:59:16 PM
Starcore done something like that already... and posted it somewhere, with the strengths/weaknesses of all AI's, and it's great.

Anyways this would be welcomed Mad. My ELBITE tabletop bot is decently AIed, but i'm still a beginner (i don't suck at it anymore at least)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on October 12, 2008, 02:09:41 PM
I've not seen and he's not told me of a chart like this; unless he put up the incomplete version?.. which I doubt. This is not a step 1,2,3... on "How to AI" instructions, like on GTM. It's a chart on the necessary AI.py information for choosing the best/appropriate AI.py based upon functioning(s), and then the some information/specs needed to AI it.
I'll put up a snipet later ....
But if you run into it, please let me know...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: infiniteinertia on October 12, 2008, 02:21:29 PM
This is great for me, because I would like to try and make my own "Relentless.py" and well, at least try...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Gigafrost on October 12, 2008, 10:23:01 PM
Woah, that FBS .py is simular to my RA2GE version for the bot Filmore. Anyway, nice tut.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on November 13, 2008, 06:00:08 AM
i wonder how to AI those servo motor and servo piston.

About servo piston,  it is possible to define 2 custom zone and to move (extend/retact) the piston depending of the position of the ennemy (see schema).
sample code :

  def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "weapon"
        self.triggers = ["Fire"]
        #self.trigger2 = ["Srimech"]
        self.reloadTime = 0
        self.reloadDelay = 3    
        self.spin_range = 3.0
        # declare  zone and associated triggers
        self.zone2 = "zone1"
        self.triggers2 = ["Action1"]
        self.zone3 = "zone2"
        self.triggers3 = ["Action2"]
        self.zone4 = "zone3"
        self.triggers4 = ["Action3"]
        self.zone5 = "zone4"
        self.triggers5 = ["Action4"]
       
...
  def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1:
            if direction == 1:
                AI.SuperAI.SmartZoneEvent(self, direction, id, robot, chassis)
        elif id == 2:
            if robot > 0:
                if direction == 1:
                    for trigger in self.triggers2: self.Input(trigger, 0, 2)
        elif id == 3:
            if robot > 0:
                if direction == 1:
                    for trigger in self.triggers3: self.Input(trigger, 0, 3)
        elif id == 4:
            if robot > 0:
                if direction == 1:
...

(https://gametechmods.com/uploads/images/23019servo.png)

But i can't figure how to do it with a servo motor :
 - i can not attach custom zone to extender : If i could, it should be faisable to tell the servo motor to turn until the ennemy is in its attached custom zone( for the custom zone will be turned by the motor).
- an other way should be to know the current position of the servo motor (angle of turn) and to make it turning,  depending of the position of the ennemy. Here again i don't know how to do that.

=========
looking at beetlebros cheatcode, it appears that one can iterate on the components. But how do i identify on (by its name ?), what are the property associated with the components ?

def turbo(id=0):
...
    for comp in range(100):
        damage(id, comp, -500, getLocation(id))
========

Does anyone have any successful experience in this domain ?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on November 13, 2008, 09:35:33 AM
Attaching Smart Zones to (moving) components. I like your ideas, Phil. As far as controlling motors/weapons through attaching SZs, some of us worked through this before. Here's a few pics of initial ideas about this I posted (that someone saved before the old forum went down):
 
(http://img401.imageshack.us/img401/2882/sz1dw0.th.jpg) (http://img401.imageshack.us/my.php?image=sz1dw0.jpg)(http://img401.imageshack.us/images/thpix.gif) (http://g.imageshack.us/thpix.php)
 
Then a better idea came:
(http://img374.imageshack.us/img374/2961/sz2iw1.th.jpg) (http://img374.imageshack.us/my.php?image=sz2iw1.jpg)(http://img374.imageshack.us/images/thpix.gif) (http://g.imageshack.us/thpix.php)
 
Here is the whole dialogue's txt, if you wantto look through it (don't think the hyperlinks in it work any more):
AttachingSZsToComponents (http://www.madiaba.gametechmods.com/AttachingSZsToComponents.rar)]AttachingSZsToComponents (http://www.madiaba.gametechmods.com/AttachingSZsToComponents.rar)[/URL]

 
PM me, Phil, and I'll share with you how to connect SZs to moving components.
 
---------------------
Controlling piston:
Controlling pistons is not consistent, but it can be done. Here's the basic coding for such:
#---------THESE SERVO CONTROLS "WORK" (with 2 BUTTON trigger switches, 1 for each pos/neg input).
# SERVO CONTROL-1 - "Timer" (WORKS with 2 Buttons controling retract/extend. Reads this py's trigger NUMBER [i.e. "self.triggers1"])

self.TriggerTimer1 += 1
if self.TriggerTimer1 == 1:
for trigger in self.triggers1: self.Input(trigger, 0, 1) # Extend
if self.TriggerTimer1 == 5:
for trigger in self.triggers1: self.Input(trigger, 0, 0) # Off
if self.TriggerTimer1 == 6:
for trigger in self.triggers2: self.Input(trigger, 0, -1) # Retract
if self.TriggerTimer1 == 10:
for trigger in self.triggers2: self.Input(trigger, 0, 0) # Off
if self.TriggerTimer1 == 15: # For repeating above
self.TriggerTimer1 = 0
 
# SERVO CONTROL-2 -"Timer" (WORKS with 2 Buttons controling retract/extend. Reads in this py's = trigger NAME (which in-game is a controller Button 'Name').

self.TriggerTimer1 += 1
if self.TriggerTimer1 == 10:
self.Input("Fire1", 0, 1)
if self.TriggerTimer1 == 15:
self.Input("Fire1", 0, 0)
if self.TriggerTimer1 == 20:
self.Input("Fire2", 0, 2)
if self.TriggerTimer1 == 25:
self.Input("Fire2", 0, 0)
if self.TriggerTimer1 == 30:
self.TriggerTimer1 = 0
 
 
 
Finding Piston location:
#--- Get Piston Position -------- (parameters are around '0', unto between '-.2' and '-.6' [depending on length of shaft]).
self.GetPistonPosition(13) # '13' is piston component number.
# Example:
def Tick(self):
self.PistonShaftLocation = self.GetPistonPosition(13)
if self.PistonShaftLocation < -.35:
plus.playSound(self.EMFsound) # or whatever command...
 
---------------------
 
 
Finding Servo Motor Angles(Apanx work):
# component Motor-number set from Bindings. Must add (1) in AI.py under __init__: if 'motor' in args: self.Motor = args['motor'] ; and (2) in Bindings.py: 'motor':19, . Or you can just enter the component number yourself: servoangle = self.GetMotorAngle(19).
 
def __init__(self):
self.Motor = 1
if 'motor' in args: self.Motor = args['motor']
 
def Tick(self):
servoangle = self.GetMotorAngle(self.Motor)

 
Controlling Servo Motors:
 
def __init__(self):
self.Motor = 1
if 'motor' in args: self.Motor = args['motor']
 
def Tick(self):
servoangle = self.GetMotorAngle(self.Motor)
 
# Basic servo control
if servoangle < 1: self.Input("BAF", 0, -100)
elif servoangle > 2: self.Input("BAF", 0, 100)
 
# Open, then cycle within parameters (<1 and >2)
self.weptimerB += 1
if self.weptimerB == 1:
if servoangle == 0: self.Input("BAF", 0, -100)
if servoangle < 1: self.Input("BAF", 0, -100)
elif servoangle > 2: self.Input("BAF", 0, 100)
 
# Timed + Limited open, then cycle within parameters (between <1 and >2)
self.weptimerB += 1
if self.weptimerB == 1:
if servoangle < 0.5: self.Input("BAF", 0, -100)
if self.weptimerB > 1:
if servoangle > 2: self.Input("BAF", 0, 0)
if self.weptimerB >= 20:
if servoangle < 1: self.Input("BAF", 0, -100)
elif servoangle > 2: self.Input("BAF", 0, 100)
 

--------------------
If you want to look through all my Python notes(partially organized):
PYTHON SCRIPTS (http://www.madiaba.gametechmods.com/PYTHON SCRIPTS.rar)]PYTHON SCRIPTS (http://www.madiaba.gametechmods.com/PYTHON SCRIPTS.rar)[/URL][/B]....[/COLOR]
 
...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on November 13, 2008, 09:44:02 AM
Quote from: Madiaba;21440
Attaching Smart Zones ...

quick and smart !

 i read all of this, try some solution, and give you feed back ... or another question.

And there it goes :

What i do not understand is
"
self.Motor = 1
...
servoangle = self.GetMotorAngle(self.Motor)..."

In the first line i declare the Identifier of a motor as '1'
in the second line i ask for the motor angle of the motor  which identifier is '1'.

but, how the system can link the number '1' with my servo motor if my bot have other motors (servo or not) ?

PS : i have not tested this code yet. this is just a 'code reading' question.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on November 13, 2008, 06:31:51 PM
Phil, the first
def __init__(self):
....self.Motor = 1
is just a variable with an integer given to it as a default value.
 
The second line is just to retreive an arg(specific parameter) from the Bindings.py, if one is present. Thus it is coded conditionally:
....if 'motor' in args: self.Motor = args['motor']
meaning that if there is some info in the Bindings.py line called 'motor', then assign this number to self.Motor instead of '1' (the default). That's why the conditional statement is placed after the default setting.
 
def __init__(self):
....self.Motor = 1
....if 'motor' in args: self.Motor=args['motor']
 
def Tick(self):
....servoangle = self.GetMotorAngle(self.Motor)
 
 
------------------
The syntax in the Bindings line will be:
 
......., 'throttle':80, 'range':4, 'motor':2, 'weapons':........
 
where '2' is the component sequential assembly number. Use Apanx's Exporter to find the motor's number, and add it here.
 
 
....
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on November 14, 2008, 01:10:55 AM
Quote from: Madiaba;21539

where '2' is the component sequential assembly number. Use Apanx's Exporter to find the motor's number, and add it here.

My question was mis-formulated : it should have been : how do i know the value of 'motor';

you gave me the answer, thank's.

==== still working on====
your source code is very useful :
i think, to know the component sequential assembly number, i will try to iterate on the components.
that will simplify the task for the futur users of the AI.
 They wouldn't have to 'hack'  the gmf.

here is a 'principe' code to put on the 'activate' function:

  for i in range(0, self.GetNumComponents()):
                test if self.GetComponentType(i) == 'ServoMotor"
                if ok -> memorize i, than break.

now i have to try it.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on November 14, 2008, 03:49:56 PM
double post :-(

Well, i'm near my goal : make a simple AI that may use servo motor to direct the weapon in the 'good direction'. given that the 'good direction' is defined with 2 custom zones.

what i have still to do :
1/ finalize the AI (little problems to stop the servo when itovercomes their 'min angle' if this one is 0)
2/ make a guide to use it
3/ make 3 tutorial bot HS, VS, Poker/rammer to show the potential use of this AI.
4/ give all of this in this thread.

By the way, i effectively search the motor number  by iterating on the components, so the futur user of this AI will not have to use a gmf decompiler.

(https://gametechmods.com/uploads/images/63391omniServo.jpg)
Title: SpinServo AI
Post by: philetbabe on November 18, 2008, 06:32:09 AM
Triple post :-( :-(

HERE is the SpinServo AI
https://gametechmods.com/uploads/files/ServoSpin.rar (https://gametechmods.com/uploads/files/ServoSpin.rar)

This is an AI which control 1 servo motor.

the archive contains a file.rtf which explains how to use it.

hope your enjoy.
Also hope you may contribuate to improve it.

EDITED : I forgot to tell it in the help file : the sample bots are DSL2.1 bot !

===============
futur AI to work on ;
-propose a 'standard' AI that works with up to 4 multi zone (really easy -> topknot does it, it is just a matter of 'standardisation')
-propose a 'radar like' AI : more complex. so be patient.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on November 18, 2008, 06:45:34 AM
looks cool, and effective. Nice work.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on November 18, 2008, 08:36:59 AM
Nice work, Phil.  Allot of this has been done already,... but I like the 'goon' to find the servo.  So to save you from dupping work, look at this AI.py that I wrote specifically for ACAMS Machine-gun mounted atop a self-aiming servo motor, and also has automatic repeating fire.
https://gametechmods.com/uploads/files/D_SMFE_Turret_Machinegun_Spin.rar (https://gametechmods.com/uploads/files/D_SMFE_Turret_Machinegun_Spin.rar)

I'll PM you about the bot details...

Please give feedback, and any ideas for improvement.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on November 18, 2008, 09:06:06 AM
Quote from: Madiaba;22175
Nice work, Phil.

thanks.
Quote from: Madiaba;22175
 So to save you from dupping work, look at this AI.py that I wrote specifically for ACAMS Machine-gun mounted atop a self-aiming servo motor, and also has automatic repeating fire


after a quick look, it seems this code will be very useful for a generic radar-system-like AI. All it there yet with the Tick, AimTowards and Aim function.

by the way, i feel you have a big amount of AI code on your drawers, please, share them.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 70 CUDA on November 18, 2008, 02:39:14 PM
be carefull what you ask for you WILL Get it lol. nice job man i got one to like that before i left but it was not as good.
Title: Laser Guided AI
Post by: philetbabe on November 24, 2008, 03:22:03 PM
Big name for little AI !
https://gametechmods.com/uploads/files/tazbot.rar (https://gametechmods.com/uploads/files/tazbot.rar)

this is a variant of 'SpinServo AI'. it is  based on Madiaba work.

Here the servo must spin horizontaly only, but you may attach it a spin motor or a fired weapon (piston). In both case, no need of custom zone.

Sample shows  TazBot from DSL 2.1

Fixed : the AI seems to crash the game when the bot is inverted !
Title: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on November 24, 2008, 03:33:38 PM
Hey, that would make for a cool bot!
Title: information on binding.py and the Weapon list
Post by: philetbabe on December 04, 2008, 06:28:12 AM
So, what are these numbers in the weapons list contained in binding.py  ?
Code: [Select]
...,'weapons':(1,2,3,4,5,6,7,8,9)}))
This numbers are assumed to be the Identifier of your weapons.
Each time you lost one, it is removed from this list.
By default, when this list is empty the strategy is changed.

This mean
* if your  list is empty, whatever your AI is, the strategy used should be the
one define in 'LostComponent' function.
* if you put number that do not correspond to Weapon Identifier (which is mostly the case if your write 1,2,3,...) you will keep your strategy even if you loose all your weapons for this list will never be empty

Usage of this list :
* to be sure that your list contains the good weapons identifier, you may fill it yourself after having a look at yotur bot with a gmf decompiler. You may also add this code to your activate function, it build a correct list of weapons Id :
Code: [Select]
   def Activate(self, active):
        if active:
              ...
            goon = 1
            i = 0
            self.weapons = []
            while goon == 1:
                if i  == self.GetNumComponents(): break # to verifiy if  i == ... or  i > ...
                currentType =  self.GetComponentType(i)
                if currentType == "Weapon": self.weapons.append (i)
                i = i+ 1
return AI.SuperAI.Activate(self, active)

For instance, here is an usage of this list :
Code: [Select]
   def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
        self.SpinTrigger = "Spin"
        self.ServoTrigger = "Servo"
         ...

    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 len(self.weapons) < 4 :
   # i have 2 motors mounted on a tri-bar extender.
# the last bar contains a hammer.
# my self.weapons list contains the Id of the weapons.
# when  only 3 weapons remains, i swith my controler
# to make my servomotor spin much like a normal motor
                        # so the AI that controls the servo become useless
                        # my bot turn to a 'normal spinner'
            self.SpinTrigger = "Servo"
            self.ServoTrigger = "NOP" # does nothing
            self.SpinSpeed =  100
           
        return AI.SuperAI.LostComponent(self, id)

 Fields of investigation : does the lostcomponent function is called for each component lost or only for weapons ? What happens if one put Id of motors or other components in its self.weapons list ?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 04, 2008, 07:51:03 AM
Quote
Fields of investigation : does the lostcomponent function is called for each component lost or only for weapons ? What happens if one put Id of motors or other components in its self.weapons list ?
I've used lostcomponent function for SRMs, meaning that if it lost it's vertical pole it would try to fire the weapons to self-right. I also did the same for lost armor, changing instead to an basic/crude 'evasive' strategy I wrote.
I would imagine that motors are the same, but not tried it.
Title: Pusher AI +Piston
Post by: philetbabe on December 10, 2008, 07:21:04 AM
for thoses who don't know much about AI, here is a simple Pusher AI that allows to have a piston command by a "Fire" command and a custom zone named "Weapon". It may help some of you for the elbite tourney.

https://gametechmods.com/uploads/files/PusherPiston.rar (https://gametechmods.com/uploads/files/PusherPiston.rar)
Title: Omni Multi zone
Post by: philetbabe on December 17, 2008, 07:18:05 AM
Hello there.

here is a simple written AI that allows to have up to 4 multi zone each attached to a specific controler (much like topknot)

https://gametechmods.com/uploads/files/OmniMultiZone.rar (https://gametechmods.com/uploads/files/OmniMultiZone.rar)

this AI works like Omni except that it allows up to 4 customzone named
weapon1,weapon2,weapon3 and weapon4 that trigger the controlers Fire1, Fire2, Fire3 and Fire4.

use of spin motor is still allowed.
use a normal custom zone named 'weapon' which trigger the controler named 'Fire' is still allowed as much as Srimech.

Extension not much tested yet : you may define your default tactic by specifying
'tactic':"value of tactic" in your bindings.py with
"value of tactic in this set : { "Engage", "Ram", "Charge", "Shove" }

if not specified, the default tactic is like the Omni one : it is "Engage".

Sample in this pack are DSL2.1 SAMPLE. they have no interest by themself except to show the use of the AI
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 04, 2009, 01:02:38 PM
Would anybody happen to have the "Pillar" AI that is used on Speed KING from the RAW bots pack? It won't work and my game doesn't have it.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 04, 2009, 01:14:50 PM
It's on the BBEANS4 AI pack, i think. Haymaker used it.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 04, 2009, 01:42:49 PM
Quote from: Somebody;26146
Would anybody happen to have the "Pillar" AI that is used on Speed KING from the RAW bots pack? It won't work and my game doesn't have it.
SB, you might try the AI.py 'FBS_1' above. I built on 'Pillar' by hacking through the immobilization coding to improve it. This is now more consistent at getting FBS's out of immobilization countdowns, and also has several optional features for custom tweakings.
 
BTW: CB told me that he took some things from 'FBS_1' and improved Pillar into 'Pillar2'. I think he sent me a copy of it, though I haven't had time to look at it yet so I don't know all that he did to it.  But I would see if he's done with it and check it out too, for it may have some things you want.
 
..
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 04, 2009, 06:10:07 PM
Can I just have a copy of it please?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on January 04, 2009, 06:35:08 PM
https://gametechmods.com/uploads/files/Pillar.rar

there ya go.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 10, 2009, 04:12:02 PM
Thanks, it works now.

Also, I really really really want to learn how to AI, and NO I do not have and can not get any IMing devices. The closest I have is Hamachi. I want to host a tourney in the distant future, and I obviously need the ai skills.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 10, 2009, 09:06:21 PM
You don't NEED to DL hotmail, y'know.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 10, 2009, 09:31:19 PM
Seriously, I can barely d/l ANYTHING without pissing them off. And they absolutely HATE it if I am in any direct chat thing. (Like, as in, ground, not let be on internet, Hatred)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 10, 2009, 10:02:47 PM
I'll help you, SB.  You choose the medium, and let me know.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 11, 2009, 05:56:31 AM
I have:
An invertable LW rammer that I want to use Rammer.py for
An invertable MW FS that I want to use the Omni.py for
An invertable HW rammer that I want to use Rammer.py for
A not-invertable (I made a button for the srimech which is just the hammers, and placed the smart zone already) hammer that I want to use the Chopper.py for
And 2 Not Invertable HW HSs that I want to use the Omni.py for.

I also need to AI a bot for Duck's tourney. It is an invertable MW that I want to use the Pusher.py for.
Tell me if you need more info about the bots. I already looked over the AIing guides, and named all of the weapons,srimechs,smartzones,etc.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 11, 2009, 08:58:05 AM
PM, them over...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 13, 2009, 12:41:40 PM
I have a whole list of bots I'd like to AI, but I'm unsure about them. If I have a Popup with 2 HPZs a black, one DDT and 2 snapper 2's in the same chassis as walrus with a a 40CM extender, 2 20CM externders's and 2 Bear paws and 2 irons, would it need a slow speed or a fast one?

And if I used my wheels in the rear, would it be best to have a slower turnspeed? Does weight need to be considered? and what about bots that use RAD drives?

I think we need an in detail AI tutorial...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 13, 2009, 01:19:08 PM
How about you guys just experiment... It's pretty easy to do !
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on January 13, 2009, 01:33:57 PM
Guys, I got a Biii...iiig problem.
Whenever I try to AI anything & try it out in the game, the icon looks just like the bot I was trying to replace.

IE. say I was trying to replace 2nd Sentinel with another bot. I would AI the other one, replace SS AI with it and everything, but when I go into the game, SS's preview is still there! Then I click on it & the game crashes.

Help please? I will do my best to describe the problem further if I haven't been clear enough.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 14, 2009, 03:19:00 AM
Quote from: Reier;26678
Guys, I got a Biii...iiig problem..


Here are the easy step to replace a bot in a team :

1/ memorize which bot in which team you would like to change :


(https://gametechmods.com/uploads/images/878941-select your target team.png)

2/ Create your killer bot. Give it a name, be aware of its nose attitude :
(https://gametechmods.com/uploads/images/784242-create your killer Bot.png)

3/ export your bot : For name give it bot0 through bot5 depending of the bot you would like to change in your target team
(https://gametechmods.com/uploads/images/741473-save your bot.png)

4/ exit RA2. under your AI directory, select your team and save the bot that you will erase :
(https://gametechmods.com/uploads/images/463974-saveoldbot.png)

5/ move the bot you have create from RA2/Robot designs to AI/target team. The system should ask you if you really want to erase the bot with the same name (you will) :
(https://gametechmods.com/uploads/images/942735-copy my bot.png)

6/ add your bindings in AI/bindings.py. It is not necessary to delete the previsous line :
(https://gametechmods.com/uploads/images/634756-addline in bindings.png)

7/ launch RA2, enjoy life and drink ... whatever you want :
(https://gametechmods.com/uploads/images/579257-that's all folks.png)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 14, 2009, 06:43:10 AM
Nice, Phil. This sure helps.
Thanks.  
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on January 14, 2009, 02:30:39 PM
how good/bad is directional spinner ai?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 15, 2009, 03:29:17 AM
Quote from: Scrap Daddy;26716
how good/bad is directional spinner ai?


That's a great question, looking at the code i do not see much difference between spinner and directionnal spinner.  Is there really a difference ? where is it defined ?
(Mad, ai-Guru, any idea ?)

btw there is a AI called VertSpinner which is quiet good : change the direction of spin when the bot is inverted, support Srimech and other fired weapon.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on January 15, 2009, 09:45:48 PM
Quote from: philetbabe;26762
That's a great question, looking at the code i do not see much difference between spinner and directionnal spinner.  Is there really a difference ? where is it defined ?
The only significant difference that I can see is that Spinner uses the RobotInRange function to do something while DirectionalSpinner doesn't.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 15, 2009, 11:12:32 PM
I don't remember and I can't find that AI.py. Don't know who wrote that one, either. Could one of you guys PM it to me please,... though I would trust Phil and Trov's assessment.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 16, 2009, 06:29:58 PM
OK.
1. My computer was infested with viruses, and Hamachi is deleted and gone for a good while.

Mad: I will PM the bots to you as soon as I can.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 17, 2009, 10:15:59 PM
Here it is and I paralleled like sections so you can see for yourselves:
 
(https://gametechmods.com/uploads/images/41160Untitled-2.jpg)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 19, 2009, 02:20:20 AM
Quote from: Madiaba;26934
Here it is and I paralleled like sections so you can see for yourselves:

directionnal spinner inherits from spinner, that mean it does eveything spinner does as long as it dosen't overwrite the function. for instance the 'RobotInRange' function used for directionnal spinner is the same as the one for spinner.


In fact, the only 'add-on' of  directionnal spinner seems to be its capability to rename the trigger with something else than 'Spin'.

am i wrong ?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 19, 2009, 02:43:10 PM
I sent the bots. What do you want to do with them?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 20, 2009, 06:39:16 AM
Quote from: Somebody;27039
I sent the bots. What do you want to do with them?


maybe new hybrids from counter-nature experiments !
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 27, 2009, 11:43:22 AM
Here's a handy AI.py: 'OmniRam_EnergyMiser'. It is a version of 'OmniRam' with an appended energy(Battery) saver. It uses an analog control to switch on/off quick-spin-up weapon motor(s). It turns the weapon motor off whenever the nearest enemy is 'x' (user set) distance away, thus potentially saving significant Bat. energy for when/where it's needed; toward the opponent (maneuvering and weapons). It is ideal for Face Spinners, etc...) with ramming tactic.
 
OmniRam_EnergyMiser (http://www.madiaba.gametechmods.com/OmniRam_EnergyMiser.rar)]OmniRam_EnergyMiser (http://www.madiaba.gametechmods.com/OmniRam_EnergyMiser.rar)
 
It is simple to use and the instructions are in the AI.py, including sample Bindings line. It was written for one of Somebody's bots that was weak on energy. Thought it'd be useful to save energy in general too, because many matches have been won/lost on available energy, for sure.
PM or post any questions or feedback.
 
*Credit to SC for the original OmniRam.py*
 
 
..
[/URL]
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 27, 2009, 12:21:21 PM
I've already used that energy save feature (a great idea) on one of my sawbots.

But rather than a specialized .py, i just use a small 'range' value...

EDIT: Wait, it's "towards the opponent"? It's better than mine then.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 27, 2009, 02:05:52 PM
Quote from: Madiaba;27615
Here's a handy AI.py: 'OmniRam_EnergyMiser'. It is a version of 'OmniRam' with an appended energy(Battery) saver

the economic crisis is felt here too. It is necessary to save energy.
when will one see a bot  with a coal-fired boiler?

Edit :  to avoid any misunderstanding, i did not want to oppose Mad and NAr solutions.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 27, 2009, 02:26:16 PM
I'm gonna guess that it was Pit Viper.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 27, 2009, 03:48:51 PM
-Nar, I used an analog control instead of a button or switch. As you know they don't always act kosher anyway, but the analog has been the most consistent for accurate on/off control of motors, in my coding experience.
 
- Phil, Thanks, for your optimistic perspective of my work/me. But je suis juste une personne, and no more.  Ceci est juste un passe-temps de prendre une 'pause' de travail.  RA2 ne signifie rien dans la vie.  I only like the logic of coding, allot like you too. It's fun to figure out.  And thanks for your help, with the AI stuff, chart and feedback..
 
-SB, it was 'Coral Snake'.
 
...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on January 27, 2009, 04:57:54 PM
1 million times thanks for the AIing. Coral Snake was a little lacking in the battery department.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on February 05, 2009, 08:10:38 AM
Here SB, for you and anyone else.
This is coming out in the "AI-ing Chart" soon:
 
Code: [Select]
    # nose is "front" of bot-
        #Nose paradigm: All 360 rotational degrees for "math.pi" are represented by the factor '2'.
            #thus:  '2'=360degrees,   '1'=180degrees,   '0.5'=90degrees,   '0.25'=45degrees.
        #The direction of change(CW/CCW)is determined by the "-" or "+" before the statement.
            #thus: '+' causes rotation CCW,  '-' causes rotation CW.
        #Format examples:
            # " 'nose':math.pi*0.25 "  will rotate the bot 45degrees/CCW.
            # " 'nose':-math.pi*0.25 " will rotate the bot 45degrees/CW.
            # " 'nose':math.pi*0.5 "   will rotate the bot 90degrees/CCW.
            # " 'nose':-math.pi*0.5 "  will rotate the bot 90degrees/CW.
            # " 'nose':math.pi*0.75 "  will rotate the bot 135degrees/CCW.
            # " 'nose':-math.pi*0.75 " will rotate the bot 135degrees/CW.
            # (Make sure there is a comma(,)after the the value # (to separate it from the next characteristic and its value).
            #(-----notes-----)
                # Note1:  "math.pi"   AND   'nose':math.pi*1.0 "   AND  " 'nose': -math.pi*1.0 "   will rotate the bot 180 degrees.
                    #   (The first two are the same, and the last two just rotate different directions to get 180 degrees.}
                    #   Thus there is no real reason to have a factor greater than '1',
                    #   since after that you just move into the other half of the circle covered by the other '+' or '-' sign.
                # Note2: "math.pi*0" or "math.pi*2" = the same as no new heading.
Take this and paste it to the top of your Bindings.py for easy reference.
 
How to use:
1. Find out where your bot is without any nose bias.
2. Then use this chart to turn it to face forward, NP.
 
.....
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on February 05, 2009, 11:59:40 AM
Quote from: Madiaba;28207
...


Pretty idea to enrich the bindings.py header with all those guidelines. perhaps we may propose a template of bindings.py with other informations.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on February 05, 2009, 04:12:31 PM
Wow that helps. B01000N should be AIed and working soon, after another rebuild.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on March 05, 2009, 06:49:39 PM
> CB tweaked FBS_1 to add a few more features. I think they're useful. Here it is:
https://gametechmods.com/uploads/files/FBS_2.rar (https://gametechmods.com/uploads/files/FBS_2.rar)
(Thanks, CB for your input. And sorry I didn't look at it until now...)
 
 
> Here is the SOW.bot, AI.py, and Bindings line I posted above:
https://gametechmods.com/uploads/files/SOW.rar (https://gametechmods.com/uploads/files/SOW.rar)
This bot is DSL, but you can use this coding in stock too, no prob.
 
..
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on March 06, 2009, 07:39:46 AM
Quote from: Madiaba;30295
>
> Here is the SOW.bot, AI.py, and Bindings line I posted above:


Right, even if you are not interested in SOW, the bindings file starts with a good comment part that everybody should include in its own bindings.py
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on March 13, 2009, 03:13:57 PM
Does anyone know what AI has been used for bots like Inf's Spyguy or Sorrow's Anduril ? (maybe PillarPlus) And how can they be used - i need to AI Corona and i'm clueless about what to do.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on March 17, 2009, 06:23:30 AM
huh?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on March 17, 2009, 10:21:47 AM
Quote from: Naryar;30807
Does anyone know what AI has been used for bots like Inf's Spyguy or Sorrow's Anduril ? (maybe PillarPlus) And how can they be used - i need to AI Corona and i'm clueless about what to do.

use the py madiaba listed above (FBS_2) and just wire it the same as pinball is.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on March 18, 2009, 10:02:43 PM
Quote from: Madiaba;30295
> CB tweaked FBS_1 to add a few more features. I think they're useful. Here it is:
https://gametechmods.com/uploads/files/FBS_2.rar (https://gametechmods.com/uploads/files/FBS_2.rar)
(Thanks, CB for your input. And sorry I didn't look at it until now...)
..


Something that should be added to this.  I just found out that in order for FBS_2 to work properly, you need to identify the correct ID's for the bot's weapons in the 'weapons' part of Bindings.py.  Otherwise it won't register when it gets a hit, and the AI will stop spinning and try to chase the opponent when it's not supposed to.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on April 04, 2009, 11:28:13 AM
Does anybody have suggestions for a True full body spinner( whole entire bot rotates) all the stock ones dont actually move towards the other robot while spinning. Does anybody have a suggestion on how to do this?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 04, 2009, 11:51:02 AM
You're not the only one to search for that...

There is one on beetlebros.gametechmods.com, one on R0B0SH4RK's showcase, also a vid on Youtube contains a pic of a true FBS:Here (http://www.youtube.com/watch?v=IVw-ZyFxrr8)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on April 04, 2009, 01:10:55 PM
What is the one on the beetlebros site?

EDIT: Aaahh I see. never mind.
Title: AI-chart 2
Post by: philetbabe on May 25, 2009, 03:50:03 AM
cleaning my disk, i found a file i've worked on, as many other people did too (and madiaba in particular )  but it seems it has never been published (or i have not seen where).

so here is it : it's another AI tutos.

https://gametechmods.com/uploads/files/3830AI-Chart-2.rar (https://gametechmods.com/uploads/files/3830AI-Chart-2.rar)

for Mad : if this file 'has not' to be published yet (or have been published yet and i haven't seen where)  or if some people's name have to be mentionned do not hesitate to delete this post.

For everyone : If you would like to complete this file, let me know, i will send you the .doc.

future AI i will show here  : "omniInvert" ; for bots that feel better when they are inverted : anti gut-rippers
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on May 25, 2009, 06:44:17 AM
double post yeah !

so here is the 'OmniInverted' AI.

after the countdown, the bot self invert and is happy like that.

this kind of AI may feat bots like 'noble sacrifice' (
Quote from: Clickbeetle;24604
look here
), or in the hand of good builder may be used as anti gut ripper in DSL.

here is a picture and the AI :

(https://gametechmods.com/uploads/images/89151OmniInverted.png)

https://gametechmods.com/uploads/files/Omninverted.rar (https://gametechmods.com/uploads/files/Omninverted.rar)

I will send a movie before the end of the week.
As ever, feed back, self experiment or idea of bots using this or other uncommons AI are always welcomed.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 25, 2009, 06:46:53 AM
Awesome! Imagine an OmniInverted juggler. :O
Title: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on May 25, 2009, 06:56:22 AM
Nice, now we have a whole lot of more freedom in bot building :D
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 25, 2009, 07:46:41 AM
Nice Phil. Thanks for continuing the work.
Just a couple thoughts Phil:
-When you explain Analog commands you might show the parameters are "0-100" (not between 0-1 like a switch).
-You might also utilize the 'Nose' correction chart I wrote (and posted above in this thread). (Maybe also: explain 'radians')
-There are more AI.py than I listed in this document, that should be added eventually, like FBS_1 and FBS_2.
-SOW though more involved should probably be put up as an option for more experienced members.
 
Thanks again for your help. Been too busy to breathe, myself.
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on May 25, 2009, 08:01:31 AM
Quote from: Madiaba;40485
.. Thanks for continuing the work...

Mad, as administrator, do you know if there is way to reference the chart AND  all those .rar (AI + sample bots) somewhere else than on this thread. Thus 'everyone' should find ithem  easily and i, or others, may propose update. -> should it be referenced in the tutorial part of this site (https://gametechmods.com/?do=Tutorials) ? if 'yes', what should be the processus to activate an update ?
==

btw, i will update the document,  its AI list. its 'nose info' and so.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 25, 2009, 09:16:30 AM
That IS the final objective. Shouldn't be a problem.
BTW, you might give at your discretion a 'version #' to this doc., so that when it is updated people can know that they have the latest info.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: infiniteinertia on May 25, 2009, 02:33:27 PM
I wish I understood half of this stuff
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 25, 2009, 02:57:22 PM
Quote from: philetbabe;40453
https://gametechmods.com/uploads/files/3830AI-Chart-2.rar (https://gametechmods.com/uploads/files/3830AI-Chart-2.rar)

^^Awesome. You guys should check this if you haven't already.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on May 25, 2009, 03:36:25 PM
ok i checked it.
what is the thing hat would tell if the desired heading is in front or behind a robot
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on May 25, 2009, 04:34:45 PM
Quote from: roboman2444;40555
ok i checked it.
what is the thing that would tell if the desired heading is in front or behind a robot


do you talk about the value to give to the 'nose' parameter in the binding line (file bindings.py) or do you talk about writing you own AI and testing the position of your bot compare to another bot ?

For the first point, Madiaba talks about the value of 'nose' in the post :
Quote from: Madiaba;28207
...


For the second point, there are few command that give information about  your current position and ennemy position.

i  engage you to have a look at the coding of tactics.py to have usage sample.
here are some command you may use :

range = self.GetDistanceToID(robot_id)
GetPath(self, from_world, to_world)
IsStraightPathClear(self, from_world,to_world)
DriveToLocation(…)
plus.getLocation(IdRobot)

have also a look to SOW AIs, they compare angle position of a servo motor and an ennmy.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on May 25, 2009, 04:57:31 PM
no Im talking in the actual coding for a robot. like if the enemy was in one direction the robot could fire its weapon towards that direction without smartzones
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on May 26, 2009, 02:13:56 AM
Quote from: roboman2444;40563
no Im talking in the actual coding for a robot. like if the enemy was in one direction the robot could fire its weapon towards that direction without smartzones


if you mount your weapon on servo motors, there are AI that make your servo point to the ennemy without the help of smartzone. have a look at this thread :
https://gametechmods.com/forums/showthread.php?t=1492


you should also download a tazbot replica with such a AI or admire the beauty of SOW in action, viewing the Madiaba's bot in Gumba tourney.

http://raw.gametechmods.com/bracket_1.html



if you want your bot to point toward the ennemy, this is more a matter of tactics than of AI.
Almost all tactics tends to move you bot toward your ennemy.

basically :
- tactics.py deals with  the way your bot move
-AIs.py : deals with the way you use smartzone and/or weapons

if you want your bot to change direction to point toward an ennemy, without moving, you must write a tacticts.py.  if you want your bot to move toward an ennemy, just use some tactics ("engage" is almost good for everything).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on June 01, 2009, 07:16:15 AM
No need really to fiddle with the tacitics.py if you want to do your own AI.
Too easy to screw something up.

Just put the instructions in the Tick part and remove the assigned tactics from the AI.

Just remember that the inverthandler overrides the Tick part if you plan on staying immobile for too long
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 01, 2009, 07:49:36 AM
welcome to GTM

philetbabe is one really good AI'er with solutions to some of the most complicated weapon systems I have cooked up

but it is a nice change to find a new person who already has a good knowledge of the game :-D stick around and maybe showcase some of your bots
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 01, 2009, 08:34:14 AM
New person ??? He joined 2 years before me !
Title: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on June 01, 2009, 08:42:04 AM
Wow apanx, thats quite lurking record there, 3 years and only 1 post!
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 01, 2009, 09:20:07 AM
Welcome, Apanx. Nice to see you around. Looking forward to discussing some new py tweaks that are presently being working on by some here. (and I'll appropriate your title)
 
Guys: Apanx is not a noob, by any means. He was on the old forum for quite a while. He is very good with Python and has contributed significantly to this game. (I referenced him for some of his work already on this thread.)
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 01, 2009, 09:30:53 AM
I dont believe I mentioned noob I just said new person (didn't look at the join date) so sorry for that apanx... I still welcome you...back to GTM :) and like I did say before nice to have another person with a good knowledge of the technical aspects of the game :)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: ACAMS on June 01, 2009, 10:51:23 AM
He has made some nice editing programs for RA2, I don't know why he only has 1 post tho, because they should have moved with the new forum.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on June 01, 2009, 06:08:40 PM
Hey Apanx, did you ever finish that battleship?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Flying_Chao on June 01, 2009, 06:48:05 PM
He's the guy that was making the battleship?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on June 02, 2009, 01:23:17 PM
Well, I kind of stopped working on it when it turned out that the game crashed when the huge chassis got damaged. Could have resolved it by using the same method as HoJ, but then med school kind of made me busy. Having exam on Thursday, but after that I will experiment with a Full body spinner AI concept I thought out.
(Apanx: check your email/IM for PW. Mad)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on June 02, 2009, 01:24:12 PM
Battleship?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on June 02, 2009, 01:37:03 PM
Yes, here is a picture (http://img520.imageshack.us/img520/7962/screenshot38.png)
Still got all the files left.
Other crazy thing (http://img520.imageshack.us/img520/8230/screenshot5h.png)
Sadly I cant find the file for this one anymore.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 02, 2009, 01:38:51 PM
Awesomeness.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on June 02, 2009, 01:47:17 PM
AHH I remember the Kremlin one from the old forum!
And I LOVE the battleship.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on June 02, 2009, 01:59:43 PM
oh good a sns that translates.
me and a few others have tried it but no avail.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on June 02, 2009, 04:36:34 PM
here is the video for post #67 : bots that feels better when inverted

[media]https://gametechmods.com/includes/flvfiles/joebloeai.flv[/media]

also featuring a SOW bot (see SOW thread).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on June 02, 2009, 04:38:23 PM
would be good for clicks sacrifice series
Title: AI-ing (.py files, coding, R+D, and help)
Post by: R1885 on June 07, 2009, 05:33:43 PM
Can some one help me please? Each time I try to run a bot, it fails on me. Here is the code I'm using:
Quote
# 22- Exile
    list.append(("Exile Wip","Omni",{'range':99,'radius':1,'topspeed':100,'weapons':(1,2,3)}))
    list.append(("X-ile","Omni",{'invertible':False,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("Exile","Popup",{'invertible':False,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("AW-Birth of Exile","Rammer",{'topspeed':99,'invertible':True,'nose':math.pi,'throttle':130,'radius':0.1,'range':99,'weapons':(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23)}))
    list.append(("BW-Growth of Exile","Rammer",{'invertible':True,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("Exile's Rath","Omni",{'invertible':False,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':180,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 07, 2009, 05:49:05 PM
You have too much spaces...

On Exile, you spelled 'weapo ns'.
EDIT: and Exile's Rath has 1 80 as throttle value.
EDIT2: and ' nose' on Exile
EDIT3: and 'throttle': 130 on Exile
Title: AI-ing (.py files, coding, R+D, and help)
Post by: LiNcK on June 07, 2009, 08:00:37 PM
I dont understand ANY of this...
Scripting looks easier O_________O
Title: AI-ing (.py files, coding, R+D, and help)
Post by: R1885 on June 07, 2009, 08:12:18 PM
Thanks for the help Naryar.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 07, 2009, 09:12:42 PM
R1885, if you still didn't figure it out, just PM it (bot, bindings line, and which AI.py) to me and I'll help you.
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on June 08, 2009, 11:28:13 PM
I have a question to ask. This is for the bots with AGODed weapons.

Is it possible for an AI'ed bot to move its weapons during the intro or the countdown? Because I usually press the pause button before the match starts, and spin the weapons so that the bots return to its natural position without flopping around.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on June 09, 2009, 10:42:19 AM
Quote from: Pwnator;43212
I have a question to ask. This is for the bots with AGODed weapons.

Is it possible for an AI'ed bot to move its weapons during the intro or the countdown? Because I usually press the pause button before the match starts, and spin the weapons so that the bots return to its natural position without flopping around.



AGODed ?

anyway, until the function Activate()  is called we are not sure the our bot is fully build.
And it feels like this function is called just after the countdown. What make me think that, is, if you put bad code in your activate function, it crashes the system after the countdow.

but if any one has another experiment on the domain, i hear  him/her.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on June 09, 2009, 02:04:23 PM
it usually stops the weapons right at 0 for me if i start them before the countdown. almost like it resets Havok.
Title: AI chart 2.3
Post by: philetbabe on June 17, 2009, 07:16:05 AM
here is a new version of the  AI chart
https://gametechmods.com/uploads/files/AI-Chart-2.3.rar (https://gametechmods.com/uploads/files/AI-Chart-2.3.rar)

no much new informations but :

-more standard AIS are referenced (FBS, SOW AIs)

-pictures have been added to illustrate the AI

-the AI.py are joined with the archive (more easy to get)

-chart is given in .pdf and .doc version (thus someone may enriched the.doc).

-all about nose (Madiaba's post in this thread)


For those who don't know it yet, this document explains :
-how to substitute a bot from the Aied ones with one of your own bot
-how to 'bind' (<-> Ai) your bot
-how to create a new Aied team
-some useful information for the creation of your own AI
Title: AI-ing (.py files, coding, R+D, and help)
Post by: The Ounce on July 08, 2009, 04:10:13 AM
Does anyone know where to get the Popup AI.py?  It does not appear to have been included in the AI chart folder.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on July 08, 2009, 04:13:56 AM
As far as I know, I found one in R1's AI pack. But for everyone's convenience, I'll post it here. :D

https://gametechmods.com/uploads/files/PopupAI.rar (https://gametechmods.com/uploads/files/PopupAI.rar)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: The Ounce on July 08, 2009, 05:15:16 AM
Thank you so much Pwnator!
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on July 08, 2009, 05:21:44 AM
hunh I never  knew about that lol I normally use omni.py with smartzone "weapon"
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on July 08, 2009, 01:05:35 PM
We're going to make all of the AI.py available as an appendage to the Tutorial....
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on July 08, 2009, 03:56:33 PM
I really don't get the PillarPlus.py.

I used it for a disc SnS, and i did put 'range2' as an average value (less than 20), but the dang thing spun right on at the beggining.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: infiniteinertia on July 08, 2009, 05:21:00 PM
I like the idea of PillarPlus, but I have the same issue as Nary.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on July 09, 2009, 02:04:12 AM
Quote from: Madiaba;49837
We're going to make all of the AI.py available as an appendage to the Tutorial....


version 2.3 of the archive comes with almost all of the AI.py (but Popup that i did not have, anyway, popup brings nothing more than a standard 'omni' as noticed in a post above).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on July 09, 2009, 03:41:58 AM
Nar, Inf, range2 needs a REAL small number, my Big Bad Brother and Cube Of Pure Evil have something like 2 as far as I remember, I lost their bindings when I found out that my Multiextenders were all 3kgs and I reinstalled DSL clean version.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on July 09, 2009, 03:48:42 AM
Description: - Sits-and-spins in just one direction once opponent is in specified range, and doesn't stop unless immobile counter begins.  For sit-and-spinners that only spin one direction.
Define 2 ranges :
        self.spin_range = 50 -default value- : use to activate the Spin button (parameter “range”)
        self.turn_range = 3 -default value-: if enemy < turn_range and not immobile: turn. (parameter “range2”)
    ir argument “right” == 1 -> turn right, otherwise will turn left.
Bindings  Info/Example(s):
Code: [Select]
   list.append((&quot;Haymaker&quot;,&quot;PillarPlus&quot;,{'nose':math.pi,'invertible':True,'range2':12,'radius':2,'topspeed':100,'throttle':130,'turn':20,'turnspeed':2,'weapons':(11,12)}))
    list.append((&quot;Iron Spaghetti&quot;,&quot;PillarPlus&quot;,{'nose':math.pi*2,'range':99,'range2':6,'radius':1,'topspeed':100,'throttle':130,'turn':2,'turnspeed':0.1,'weapons':(21,25,26,27,33,34,35,36)}))
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on July 09, 2009, 03:51:27 AM
Ok, so Range is the usual spinup range (just like in Omni, Spinner, etc), but i still didn't get Range2... is that something with immobility?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on July 09, 2009, 04:11:48 AM
Right,

a good "PillarPlus" mounts its weapon on motor.
while ennemy in 'range', it spins its motor.
To make more damage, when ennemy is in 'range2' -which must be shorter not to get immobilized- it turns on itself, emphazing so the spin of the motor with it self-spinning (much like a whipper).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on July 09, 2009, 04:23:29 PM
So in other words, range is the maximum distance (defaults to 50) before the weapon motors start spinning while range2 is the maximum distance (defaults to 3) before the bot itself starts spinning. While the bot itself is spinning, it won't stop even if it is being counted out so you don't want to set it too high...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on July 11, 2009, 06:47:21 PM
I have a piston bot and the piston wont fire.

The control is a button named "Fire"

The smartzone is named "weapon"

I am using Omni.py, and have tried Poker.py. Niether work.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on July 11, 2009, 07:24:37 PM
That's weird.

Well... is the control wired to the piston?  Maybe you replaced it and forgot to re-wire it?

Is the smart zone in an easily accessible place?  Maybe try using an overly huge smart zone just for testing purposes.

Does the bot have air tanks?

Also posting the Bindings and maybe a picture of the bot would help.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on July 11, 2009, 07:29:42 PM
list.append(("Stinger","Omni",{'invertible':True,'nose':math.pi,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'range':99,'weapons':(1,2,3,4)}))


(https://gametechmods.com/uploads/images/76967screenshot_1.jpg)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on July 11, 2009, 07:51:37 PM
Try this?  There were some random spaces in your bindings and you don't need range on a poker...

Code: [Select]
   list.append((&quot;Stinger&quot;,&quot;Omni&quot;,{'invertible':True,'nose':math.pi,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'weapons':(1,2,3,4)}))
Also, check for spaces after "Fire" and "weapon" for the control and smart zone names.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on July 12, 2009, 12:04:02 AM
Quote from: Clickbeetle;50655
Try this?  There were some random spaces in your bindings and you don't need range on a poker...

Code: [Select]
   list.append((&quot;Stinger&quot;,&quot;Omni&quot;,{'invertible':True,'nose':math.pi,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'weapons':(1,2,3,4)}))Also, check for spaces after "Fire" and "weapon" for the control and smart zone names.


There was ONE extra space after the weapon. ONE. thanks click.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on September 15, 2009, 05:08:17 PM
Bump, but I need help.

(https://gametechmods.com/uploads/images/23385Broadside.PNG)

What would be a good AI for that? It needs to Ram/push and blast with the flamethrowers. Any help?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 15, 2009, 05:15:13 PM
pretty good but i dont think u need the wedge.
it would probably just get in the way.
edit: for the ai something like a hammer / stock spinner would work well. go straight towards the other bots and when close enough turn on wep.
you should talk to someone more experienced though.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on September 15, 2009, 05:15:52 PM
I need help with the AI, not the bot. Besides, I made it months ago and it's been updated.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 15, 2009, 05:29:44 PM
thats why i edited
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on September 15, 2009, 05:36:21 PM
That didn't help at all.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 15, 2009, 05:39:37 PM
hmmmm i think it did.
oh well no flame wars
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on September 16, 2009, 02:27:32 AM
Quote from: Reier;66326
That didn't help at all.

there is an AI called omniRam that works like a rammer but also support SZ (called weapon) and 'Fire' command.
this AI should be delivered in that AI chart .zip.
 
there is also a AI called RangeOmni that uses the 'engage' tactic (most common one) but that call the 'fire' command when bot is heading ennemy and ennemy is in a given range (no use of SZ there).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on September 16, 2009, 03:11:36 AM
Just wire the flamethrower to the drive (ForwardBack command), so it can use the flamethrower glitch (the flamethrower does not loses strength if it is wired on an analog)

And Omni.py is better for that IMO because a flamethrower bot works better when pinning.

See Red Drake 4.

Edit: However, an AI with a 'Spin' command using an analog control (rather than a button or switch like in the normal 'Spin' command) would be good.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on September 16, 2009, 04:20:57 AM
From chopper.py

Code: [Select]
   
def Tick(self):
        # fire weapon
        if self.weapons:
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
            if len(targets) > 0:
                for trigger in self.triggers: [B][COLOR=Blue]self.Input(trigger, 0, 1)[/COLOR][/B]
           
        return AI.SuperAI.Tick(self)


Change it to

Code: [Select]

def Tick(self):
        # fire weapon
        if self.weapons:
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
            if len(targets) > 0:
                for trigger in self.triggers: [B][COLOR=#0000ff]self.Input(trigger, 0, 100)[/COLOR][/B]
           
        return AI.SuperAI.Tick(self)


Wire positive analog control named Fire to flame thrower.

Bot flames when enemy is in smartzone named weapon
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on September 16, 2009, 06:50:59 AM
In case you get lost easily in the coding in [code] tags because it doesn't show the font formatting well, Apanx is showing how to change the trigger to actuate an analog control, where there was a switch. Switches are either 'off/on' i.e. "0/1", (nothing between). But with the analog it is variable, and so they changed the parameter range to between '0-100' for variable input, i.e. '50' would be 1/2 power.
So he changed,
for trigger in self.triggers: self.Input(trigger, 0, 1)
.........to,
for trigger in self.triggers: self.Input(trigger, 0, 100)
.
On a switch, '1' would be on 100% input, but on an analog it would be only 1% input.
 
(Always thankful for your help and input, Apanx.)
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on September 20, 2009, 08:47:36 PM
My AIed bots refuse to move. They fire their weapons and stuff but just don't move. Here's a pic of my controls and my bindings. whats up?

(https://gametechmods.com/uploads/images/25563screenshot_3.PNG)
   
Code: [Select]
list.append((&quot;Epidemic&quot;,&quot;Poker&quot;,{'invertible':True,'radius':0.5,'topspeed':99,'throttle':130,'weapons':(1,2,3,4,5)}))
Title: AI-ing (.py files, coding, R+D, and help)
Post by: infiniteinertia on September 20, 2009, 08:57:01 PM
Forward
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on September 20, 2009, 09:12:27 PM
GRAAGAHGHGSA

maybe i shouldnt have tried to ai these last night ;P
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on September 20, 2009, 10:04:20 PM
Quote from: Scrap Daddy;67563
GRAAGAHGHGSA


LOL
Title: AI-ing (.py files, coding, R+D, and help)
Post by: infiniteinertia on September 21, 2009, 04:34:30 PM
Quote from: Scrap Daddy;67563
GRAAGAHGHGSA

maybe i shouldnt have tried to ai these last night ;P


I feel ya :P
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on September 25, 2009, 02:20:21 AM
Humm, I took out all the conditions and simply put a permanent if statement for fire, but even so the weapon still shuts off from time to time (example: when the enemy's timer goes on). How come?

Setting analog to 999 is way fun and solve all the problems (yeah flames shooting half screen), but that's sorta like cheating.

Edit: I decide to post the final version of the AI here.  Thanks for all the help.

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

class Omni2(AI.SuperAI):
    "Omni2 strategy"
    name = "Omni2"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "weapon"
        self.triggers = ["Fire"]
       
        if 'triggers' in args: self.triggers = args['triggers']
       
        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(self.zone, 1)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):

        self.Input("Spin", 0, 100)

        return AI.SuperAI.Tick(self)

    def InvertHandler(self):
        # fire weapon once per second (until we're upright!)
        while 1:
            for trigger in self.triggers: self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0

    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:
            self.RemoveTactic("Engage")
           
               
            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(Omni2)

I never thought making the AI hold one button would be so hard.

There's also the option of making a custom component that is exactly the same as the original flamethrower but doesn't use any gas.  So long as we maintain the same design as the non cheat part (retaining the same amount of co2 tanks as you would normally, and not add in any pistons to use the gas), it would bypass the AIing problem without giving the AI any additional advantages.  I will use this along with the omni2.py until someone have a better idea.

bobflamerAI.txt
Quote
name = BFFF Flamethrower AI
preview = bffff_preview.bmp
dir = bob
model = bobflamer.gmf
type = weapons
base = Flamethrower
description = description = A BFFF Flamethrower that uses only 1 gas to bypass AI problems.  For the sake of fairness it is recommanded that you put in the amount of CO2tanks as you would normally need.
attachsound = sounds\cmp_generic.wav
standard = 1
hidden = 2
firesound = sounds\flame_thrower.wav
airmaxinoutrate = -1
hitpoints = 500

Probably just a nitpick, but since AI can have over 100 Throttle on "forward" or "turn", it should be consider cheating to use forward/leftright as the firing mechanism since it will give it extra reach.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on September 26, 2009, 07:31:36 AM
Why the bot turns off weapon sometimes:

This is because immobile bots are not counted to the enemy list, so when the only enemy is immobile, the bot detects no more enemies and the Engage tactic that is selected using
Code: [Select]
self.tactics.append(Tactics.Engage(self))
tells the bot to shut down.

You could replace the Engage tactic with your own tactic that does not shutdown by following thses instructions.
https://gametechmods.com/forums/showthread.php?t=2207

While it may seem that the AI might cheat by inputting values over 100 in turn and throttle. The code shows these strings in the routines for them

Code: [Select]
       throttle = min(max(throttle, -100), 100)
        turning = min(max(turning, -100), 100)


Which caps the input at 100 and -100
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on September 26, 2009, 08:01:03 AM
Well i did put for laughs one of my NAR AI rammer's throttle at 3000 and it DID have an effect...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales 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
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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'.
 
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales 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).
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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...
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 27, 2009, 09:22:51 AM
anyone have the bindings/controls for apanx's fbs?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo 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
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 27, 2009, 11:33:30 AM
k ill take a look
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on September 27, 2009, 03:24:22 PM
couldnt find enough info in the .py, can someone plz help me?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on September 30, 2009, 02:26:55 AM
https://gametechmods.com/uploads/files/FlameOmni.rar (https://gametechmods.com/uploads/files/FlameOmni.rar)

...hehehehe
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on September 30, 2009, 02:28:07 PM
Quote
self.Input("Flame", 0, 130)

Lol @ 130
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 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!"
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 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?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on October 02, 2009, 08:11:19 AM
https://gametechmods.com/uploads/files/Drum.rar (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...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe 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.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on October 05, 2009, 12:32:37 PM
IDK where to put this.

(https://gametechmods.com/uploads/images/91134Whaaaaaat.png)

Can't drive or AI it.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on October 06, 2009, 07:28:47 AM
If you are aing and you want to replace a bot does the weopons numbers at the end matter at all
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on October 06, 2009, 07:33:51 AM
If your bot has the same amount of weapons the one to be replaced has, then it's fine. But the weapon numbers are very important for certain AI (FBS_2, for example). Apanx's bot exporter in the Tools section should help you with that.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on October 06, 2009, 07:39:28 AM
Thanks a lot Pwnator
Title: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on October 06, 2009, 07:41:46 AM
DP: it says that its not correctly registered or something like that
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on October 06, 2009, 08:25:59 AM
IMO the weapons entry barely counts on basic py's - why would changing your current tactic to Engage when all your weapon are gone would matter ?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on October 06, 2009, 08:25:59 AM
The weapons entry barely matters on basic py's.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on October 06, 2009, 08:40:43 AM
Some AI.py have the option of changing tactics if you lose all of your weapons. These numbers at the end of the Bindings line are the component numbers (sequence of assembly) that if all are lost, then the AI.py will change over to the alternate tactic.
Else, they don't really matter.
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on October 06, 2009, 08:52:48 AM
Quote from: Pwnator;70845
If your bot has the same amount of weapons the one to be replaced has, then it's fine.


that is the only thing that matters ^ if I ever use basic .py files when numbers dont mean much I usually use lower numbers to avoid getting one that doesnt exist to a component (eg. 1, 2, 3, 4, 5,)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on October 06, 2009, 04:02:43 PM
Thanks
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 06, 2009, 05:31:44 PM
so no thing for the sound py sript?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on October 13, 2009, 04:29:03 AM
I have a question.  instead of simply changing from one default tactic to the next, is it possible to change from 1 py to the next after all weapon breaks.  For example, suppose I want to start with omni, after all my front weapon breaks, I want to change to FBS_1, how would I approach this problem?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on October 13, 2009, 05:09:06 AM
Quote from: nicsan2009;70843
If you are aing and you want to replace a bot does the weopons numbers at the end matter at all


see also this post :
Quote from: philetbabe;23541
So, what are these numbers in the weapons list contained in binding.py  ?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 13, 2009, 02:00:41 PM
i have a tool that tells u all of the part #s in a .bot file so its easyer to do the weapons line in the bindings

i think its called exporter in the tools dl place on gtm
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on October 13, 2009, 08:38:17 PM
Quote from: 123savethewhales;72362
I have a question.  instead of simply changing from one default tactic to the next, is it possible to change from 1 py to the next after all weapon breaks.  For example, suppose I want to start with omni, after all my front weapon breaks, I want to change to FBS_1, how would I approach this problem?


my guess is

a new .py..

making the robot do the standard actions (like flip or ram, whatever you wanted to do with omni) but dont have it able to use the spin input yet

use the section "def LostComponent(self, id):" with the numbers of the components and make it stop other actions and use spin (which you would then wire to whatever action you wanted

you would also want to add the section from FBS_1 that stops the spin analog when the robot is being couted out

thats just my guess and rough estimation of what you would need to do, it will probably be more complicated then what I said
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on October 14, 2009, 12:22:53 AM
Concerning the Immobile Warning, here's how it works (for those interested in knowing/utilizing it):
 
# Whenever any bot either initiates OR terminates the counting of an "Immobility countdown", a '1-Tick-assessment' of each bot is taken and stored as 'id'.
Code: [Select]

    def ImmobilityWarning(self, id, on):  # Sees anytime the &quot;ImmobilityWarning&quot; is turned ON or turned OFF by a bot.
.
.
# The condition " if on: " limits the assessments to only a bot initiates the "Immobility countdown"; it will not see if there is termination(turning off) of the count.
Code: [Select]

    def ImmobilityWarning(self, id, on):
        if on:   # Only sees when the "ImmobilityWarning" is turned ON by a bot.
 
.
.
# There can only be one bot designated for 'id', at a time. Thus in one 'Tick', it will sequentially look through bots 0-3 and the last immobile bot will retain the 'id'.
# The bot designated 'id', remains there, until: (1) the termination of its countdown, or (2) another bot begins an "Immobility countdown" and thus usurps the previous bot for the single 'id'.
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if on:
                  if id == self.GetID():
 
.
.
# By default the bots are read/checked from lowest to highest number (0-3).
# If 2 bots initiate "Immobility countdown" simultaneously, then the lowest number bot is acknowledged as immobile first, but in the same 'Tick' is usurped by the higher number bot.
# (Thus in a simultaneous "Immobility countdown", the lowest number bot will be eliminated.)
# But you can designate the order by a "if id == 3: ", then put under it "if id == 2: ", then it will look at bot 3 first and 2 last. At the end of the 'Tick', bot 3 is usurped, and bot 2 will be the 'id'.
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if on:
                  if id == 3:  
                  if id == 2:
 
.
.
# In a single 'Tick', it does see the initial bot(s), but as metioned, at the end of a 'Tick' only the last bot's 'id' is retained. But you can still 'tap into' in a single 'Tick', to find each bots status, if you write:
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if on:
                  if id == 0:  a-command
                  if id == 1:  b-command
                  if id == 2:  c-command
                  if id == 3:  d-command
                  if id == self.GetID():  e-command
 
.
.
# Here, a '1-Tick-assessment' of all bots for INITIATION or TERMINATION of Immobile countdown is taken.
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if id == 0:  a-command
            if id == 1:  b-command
            if id == 2:  c-command
            if id == 3:  d-command
            if id == self.GetID():  e-command
 
.
.
.
# ------
# Dead certain 100% ImmobileWarning system (# 1):
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if id == self.GetID():
                  if on:
                        self.Turn ON Immobile system...
                  if not on:
                        self.Turn OFF Immobile system...
.
# Dead certain 100% ImmobileWarning system (# 2):
Code: [Select]

      def ImmobilityWarning(self, id, on):
            if id == self.GetID():
                  self.Counter += 1
                  if self.Counter == 1:
                        self.Turn ON Immobile system...
                  if self.Counter == 2:
                        self.Turn OFF Immobile system...
                        self.Counter = 0
 
.
.
Pardon any type O's since I don't belong up at this hour...
.
.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 14, 2009, 02:13:57 PM
so still no thing to help me w/ the sound thing?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on October 14, 2009, 04:43:04 PM
Quote from: roboman2444;69768
... 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!"
I thought CB answered your question....  
Ok. So,
Is this an Arena.py or AI.py?
What will the SZ be attached to?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 14, 2009, 04:45:31 PM
no not really...
i was wondering if u could do it like cbs script pack. have it auto load when the match starts
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on October 14, 2009, 08:06:26 PM
Is there a way to make an AI for flail spinners that would use something along the lines of Melty brain to move? i know that I can drive those spinners but AI doesn't work for it.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on October 14, 2009, 08:48:03 PM
If by "cbs script pack", you mean the beetlebro's "RA2 Cheat Mode Pack" then I can already say that you can't have something load automatically when the original coding goes into or is loaded from the FPS window. As Click has already stated, smartzones can't be checked unless the bot is an AI so therefore unless you plan on using something other than smartzones to regulate a sound effect (such as in an Arena.py or AI.py check the distance and directions towards each opponent and activate the sound when an opposing bot meets criteria).

If by "cbs script pack", you mean something like Click's SFTW easter egg for the BBEANS AI Pack, that was done with completely different programming and wouldn't help the SZ issue.

Just a guess but it sorta sounds like your planning something involving human controlled cannons but I can already say that I've made an AI (not for human controlled bots but keep reading) that operates a vertical cannon but it isn't accurate because as the CO2 dwindles, the distance declines (at a currently unknown rate).

No offense but I would have posted a response sooner if Click hadn't already answered everything. If there was a way to get the smartzone thing to work, he would have stated it instead of the actual facts. When you asked why he couldn't do something like what he had done for his scripts (which is way to general to help us know what your talking about), I don't see how the facts would have changed. Then when you asked us repeatedly about it (and other questions), you always started with "so no" which IMO is kinda rude. If you really want another answer, you should be providing more details so that we can give you a more in-depth response. Again, I mean no offense but please take this into consideration for next time.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 14, 2009, 09:05:18 PM
there might be a way without coding...
just have the smartzone not a smartzone, but an actual component. and the sound that the components would make when something hits it or it hits something would be said sound.
is this practical?

the only problem is that i need it to do damage to the chassis when it gets hit... because the smartzone would just let the bullet thing through and hit the chassis.
oh this is for rdma2 and i need some good gunz(shotgun sniper machinegun, and maybe roket launcher, grenade launcher....)
i also want the robots to respawn when they die, but it would also put +1 pt for the robot who hit it last and -1 to the robot that died.

is there any way to do this in the arena py? or is there a different way.

plz,  need all the help i can get so rdma2 can be released sooner.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on October 15, 2009, 12:45:10 AM
Ah, this is quite interesting. Is it possible to turn the SZ into a 'weapon' instead of 'power' and still have the 'passthru' capability working? If it does, just amp up the HPs to a high value and add a 'damagesounds' line. :D
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on October 15, 2009, 01:03:49 AM
I have a feeling (and I plan on testing it soon for my new anti ballast) the pass through ability is in the "base" smartzone inside the text file, Smartzones are just colored GMF boxes that are turned partially transparent if im not mistaken.

Edit: On second thought it might be possible with

passthru = smart_zone

I might try that out for you roboman
Title: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on October 15, 2009, 01:19:38 AM
it doesnt work,

smartzones need the "base" smartzone to be attached anywhere they want, which doesnt handle the damage sounds line in the txt file



another idea though.....

making a tiny component that can be wired to a control and when the control is hit it plays the noise, (seen it done before)

then add a smartzone to the robot with a name written in a .py to trigger that control

when the "projectile" goes through the smart zone it will trigger the control that will make the component play the noise

:-D
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on October 15, 2009, 05:51:21 AM
https://gametechmods.com/uploads/files/SZSpinner.rar (https://gametechmods.com/uploads/files/SZSpinner.rar)

Omni.py that uses a smartzone rather than a range value for activating it's spinning weapon.

Doesn't works :pissd:
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on October 15, 2009, 05:54:30 AM
I tried using that to AI Magnetar before I used FBS_1. I won't stop spinning. XD
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on October 15, 2009, 12:20:27 PM
Quote from: Somebody;72957
Is there a way to make an AI for flail spinners that would use something along the lines of Melty brain to move? i know that I can drive those spinners but AI doesn't work for it.
So you want a SnS AI that can rotate its weapons and chassis while still moving toward the opponent... I think all you would need to do is add these (don't repeat things if they are already there, though). Later if I have time, I'll do some actual testing and uploading but I'm pretty sure I have everything you need listed below: (I took it directly from Omni.py so it could be optimized a little better but it should work like this)
Code: [Select]
   def __init__(self, **args):
        self.triggers = [&quot;Fire&quot;]
        self.spin_range = 3.0

    def Tick(self):
        # fire weapon
        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(&quot;Spin&quot;, 0, 1)
            elif self.GetInputStatus(&quot;Spin&quot;, 0) != 0:
                self.Input(&quot;Spin&quot;, 0, 0)


Quote from: roboman2444;72975
there might be a way without coding...
just have the smartzone not a smartzone, but an actual component. and the sound that the components would make when something hits it or it hits something would be said sound.
is this practical? This would be completely possible. All that I think you would need to do is include 'damagesounds = sounds\Whatever.wav' in the text file (although, I've never tried do this with cannons, I'm pretty sure it would still work).

the only problem is that i need it to do damage to the chassis when it gets hit... because the smartzone would just let the bullet thing through and hit the chassis. I'm not sure exactly but I think by removing the collisions (from either the GMF or the text file) would result in damagesounds, piercing and concussion to not work.

If you were to add a little bit of possibly laggy programming to the Arena.py, I think you could make any damage done to the other components (could be made to work with only specific components, too) result in damage to the chassis or both the chassis and the component.


oh this is for rdma2 and i need some good gunz(shotgun sniper machinegun, and maybe roket launcher, grenade launcher....) If you haven't already, take a look at Megaturdbomb's cannons and use the resizer that I made and linked to somewhere on these forums (or one of the other two component resizers) to manipulate/distort them into new shapes and sizes that would resemble any of the components that your asking for. Just be sure to change the folders, names, and text files so that it doesn't cause problems for other people...

i also want the robots to respawn when they die, but it would also put +1 pt for the robot who hit it last and -1 to the robot that died. Madiaba and I have been looking for coding that could respawn bots back into their original positions but, currently, it looks like it is coded within the EXE and is only available to the Practice Arena. You could make bots drive/get pushed back or towards a location but just be aware that it is very difficult to flip/turn a bot back into the upright position. Adding and subtracting points is completely possible from within the Arena.py or the AI.py using 'plus.addPoints(BotID, Points)'. To subtract points, just use a negative number.

By checking headings and coordinates between bots, you could make the Arena.py generate the sounds and do the damage but it may get a little laggy at times.

Hope this helps.

Edit: For those of you listing AI stuff (above), he also wants it work with human controlled bots so anything that has to do with using a SZ wouldn't work because, to my knowledge, none of the codes in my notes are capable of reading the contents of a SZ attached to a human controlled bot. Also, for an AI bot to play a noise you wouldn't need a custom component with a button to activate a sound because there are codes that allow you to play sound files from within the .py file.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 15, 2009, 01:57:17 PM
thanks... i am not good at coding in py but ill try.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 16, 2009, 04:39:29 PM
dp!!!!!
weeeeel i think i have a simpler solution(and it will also help w/ the character animations)
can a bots ai take keyboard input? if so i can just have the bots be aied and have keyboard input for all of the control stuff.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on October 16, 2009, 05:53:28 PM
If you have a chopbot and want to replace a spinner how would that work?
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on October 16, 2009, 09:53:30 PM
Keyboard input is currently not accessible via python in RA2. You can read up on the subject if you would like here (https://gametechmods.com/forums/showthread.php?t=2200), though... Currently, the closest things to it would be to use the practice arena buttons (which are only available to the practice arena) or some python coding from within the FPS window...

@nicsan2009: I'm not sure I know what you mean...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 17, 2009, 08:53:37 AM
the main.py imports all of the c++ commands... hmmm can we make a c++ script that gets imported? if so we might be able to even have explosions in it!(for rokets and grenade launchers)
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on October 17, 2009, 09:15:43 AM
Quote from: Trovaner;73318
Keyboard input is currently not accessible via python in RA2. You can read up on the subject if you would like here (https://gametechmods.com/forums/showthread.php?t=2200), though... Currently, the closest things to it would be to use the practice arena buttons (which are only available to the practice arena) or some python coding from within the FPS window...

@nicsan2009: I'm not sure I know what you mean...


what i think he means is that in Bindings.Py, if you have an axebot under Chopper.Py and you want to replace it with a spinner that uses Spinner.Py.

I wish to know too because I have been curious about this for AGES.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on October 17, 2009, 10:44:20 AM
Several of us have been looking for a way to facilitate keyboard input. But so far no one's found a practical, worth-while way. And yes, there are MANY things that could be done if this became possible. Would be nice.
Title: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on October 17, 2009, 12:29:30 PM
what about the main.py if that imports scripts, then we could just have it import the needed scripts for the headshot, respawn, character animation...
Title: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on November 16, 2009, 10:53:13 AM
https://gametechmods.com/uploads/files/FBSPlus.rar (https://gametechmods.com/uploads/files/FBSPlus.rar)

Yes, that's the AI that supports my last showcased bots. FBS.py with supported spinning weapon.

I am confident it can improve the movement of a shell spinner if wired right.

Last note: make sure both the spinner and the bot spin in the same direction or you'll ruin everything.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 01, 2009, 02:32:17 PM
what .py should I use for a robot that is primarily a rammer but also has a spinning disc? Help would be much appreciated. Thanks.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on December 01, 2009, 02:33:33 PM
I say OmniRam because that atleast supports smartzones, i dont remember if it suppoerted spining weapons aswell.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 01, 2009, 02:38:18 PM
Thanks SSG.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 04, 2009, 10:54:39 AM
Another problem, can topknot.py be used for a rammer?
(It uses four pistons, but I'd rather not give too much away about my bot, I'm going to soon showcase it)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar 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)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 04, 2009, 12:08:08 PM
Thanks Nary.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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.
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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 (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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar 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 ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 05, 2009, 05:15:13 AM
 :mrgreen: :mrgreen: Thanks so much Nary, I can't belive it was something that small.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 09, 2009, 08:12:09 PM
awesome so you can make a flipper.py to turn robots over and leave them ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba 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...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar 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.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 13, 2009, 03:57:09 AM
Which line of the .py makes robots that are being counted out be ignored?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. 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?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody 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?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 13, 2009, 10:21:17 AM
Im going to say its possible as Mad and Trov got robots to do that for Whams WRL arena didnt they ?

there is not one already in existence as far as I know
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on December 13, 2009, 10:24:53 AM
I was thinking that that type of py may be the best way to go for my CC3 bot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 13, 2009, 10:25:34 AM
Does anybody know what went wrong with my .py?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on December 14, 2009, 03:15:10 PM
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?


Yes it is possible. You have to make a custom tactic for it though that has the target set to 0,0,0. I made a thread before about how to integrate custom tactics in the AI python files.
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 <- Tried increasing that to make it less sensitive to random movments?
       
        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?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 14, 2009, 03:17:19 PM
Apanx! I've heard a lot about you. Thank you so much for that bot exporter, it's really useful. I'll try your suggestion out now.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 14, 2009, 03:26:16 PM
DP. Unfortunately it still goes after upside down bots.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 14, 2009, 05:26:42 PM
Created a new AI:
 
Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics
class Popup(AI.SuperAI):
    "Like Plow, but waits for chassis contact before firing the weapon.  If chassis is not found by a certain time, then fires anyway."
    # Use variable 'NoChassisTime' in Bindings.py to set the amount of time in seconds the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.
    name = "CheapPopup"
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "weapon"
        self.triggers1 = ["Fire"]
        self.triggers2 = ["Srimech"]
        self.botinzone = 0
        self.compinzone = 0
        self.comptimer = 0
        self.NoChassisTime = 8
        if 'zone' in args: self.zone = args['zone']
       
        if 'triggers' in args: self.triggers1 = args['triggers']
        if 'triggers' in args: self.triggers2 = args['triggers']
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4
        self.tactics.append(Tactics.Engage(self))
        self.tactics.append(Tactics.Charge(self))
        self.tactics.append(Tactics.Shove(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(self.zone1, 1)
           
        return AI.SuperAI.Activate(self, active)
    def Tick(self):
        # fire weapon
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
       
        # if a component is in the smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            for trigger in self.triggers1: self.Input(trigger, 0, 1)
                       
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn
    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.triggers2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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 Disable(self,btarget):
        # Disables opponent by charging it at an angle
        # we use a different angle (depending on the size of the opponent!)
        # if target is equal in size, the plow weapon charges are more direct
        if btarget > self: self.Turn(79)
        else: self.Turn(-79)
        if btarget < self: self.Turn(35)
        else: self.Turn(-35)
        if btarget == self: self.Turn(90)
        else: self.Turn(-90)
        if self.target: self.Turn(360)
       
        return AI.SuperAI.Disable(self, btarget)
               
    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)
    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone = 1
                    if chassis:
                        self.botinzone = 1
                if direction == -1:
                    self.compinzone = 0
                    if chassis:
                        self.botinzone = 0
        return True
   
AI.register(CheapPopup)

Problem: Crashes RA2, and I don't know how. Help?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: apanx on December 14, 2009, 11:57:56 PM
Created a new AI:
 
        return AI.SuperAI.LostComponent(self, id)
    def Disable(self,btarget):  <- Seems to be a space too little, try changing to def Disable(self, btarget):
        # Disables opponent by charging it at an angle
 
Problem: Crashes RA2, and I don't know how. Help?

Check that part, there seems to be a space missing. What I see immediately. Might discover something more later.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 15, 2009, 12:17:08 AM
those making .py's what program are you using ?

if you are making them in notepad I will ask you to stop right now :P

Get Python and edit them with IDLE (comes with python) it has a feature that will check your py for errors and tell you whats wrong  ;)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 15, 2009, 12:22:25 AM
What will that popup do? Attack from the rear?

Oh and Joe, when I download python, how do I get the .exe and where is IDLE?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 15, 2009, 12:32:10 AM
if python is installed then right click on a .py and you will see in that list that comes up "Edit With IDLE"

when in IDLE you can hit "Ctrl + X" to check for errors

it makes it a lot easier, my mentor showed me it :P (wonder who that is ?)

as for PopUp.py as far as I know it will only fire weapons if a chassis is in the smartzone, useful for fighting HS robots
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 15, 2009, 12:36:52 AM
I downloaded it and extracted the files but cannot find an installer.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 15, 2009, 02:09:18 AM
http://www.python.org/download/

first link, then just run the msi file  ;)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 15, 2009, 10:20:08 AM
I can't download that link, but

I downloaded this one: http://www.python.org/ftp/python/3.1.1/Python-3.1.1.tar.bz2
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 16, 2009, 09:23:09 AM
Yeah there were quite a few errors. I fixed them (I think...).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 16, 2009, 11:41:50 AM
New problem: Won't turn!
 
Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics
class Cheap(AI.SuperAI):
    # "Like Omni, but waits for chassis contact before firing the weapon. If chassis is not found by a certain time, then fires anyway. it also attacks from the side, like the Plow AI."
    # Use variable 'NoChassisTime' in Bindings.py to set the amount of time in seconds the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.
    name = "Cheap"
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "weapon"
        self.triggers1 = ["Fire"]
        self.triggers2 = ["Srimech"]
        self.botinzone = 0
        self.compinzone = 0
        self.comptimer = 0
        self.NoChassisTime = 4
        if 'zone' in args: self.zone = args['zone']
       
        if 'triggers' in args: self.triggers1 = args['triggers']
        if 'triggers' in args: self.triggers2 = args['triggers']
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4
        self.tactics.append(Tactics.Shove(self))
        self.tactics.append(Tactics.Charge(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(self.zone1, 1)
           
        return AI.SuperAI.Activate(self, active)
    def Tick(self):
        # fire weapon
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
       
        # if a component is in the smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            for trigger in self.triggers1: self.Input(trigger, 0, 1)
                       
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn
    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.triggers2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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 == "Charge"]
            if len(tactic) > 0:
                self.tactics.remove(tactic[0])
               
                self.tactics.append(Tactics.Shove(self))
           
        return AI.SuperAI.LostComponent(self, id)
    def Disable(self, btarget):
        # Disables opponent by charging it at an angle
        # we use a different angle (depending on the size of the opponent!)
        # if target is equal in size, the plow weapon charges are more direct
        if btarget > self: self.Turn(79)
        else: self.Turn(-79)
        if btarget < self: self.Turn(35)
        else: self.Turn(-35)
        if btarget == self: self.Turn(90)
        else: self.Turn(-90)
        if self.target: self.Turn(360)
       
        return AI.SuperAI.Disable(self, btarget)
               
    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)
    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone = 1
                    if chassis:
                        self.botinzone = 1
                if direction == -1:
                    self.compinzone = 0
                    if chassis:
                        self.botinzone = 0
        return True
   
AI.register(Cheap)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 16, 2009, 11:48:04 AM
How do you make code appear in the code scroll box thing?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 16, 2009, 12:09:51 PM
Magic.

That, and the # button in reply mode.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 16, 2009, 12:10:58 PM
Thanks. I'd definitely be interested in using your .py if you can fix the problems it has.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 16, 2009, 04:31:38 PM
Heh, the problem was in the test bots!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 22, 2009, 10:41:19 PM
GK,
Sorry, but haven't had time still to go through this completely, but here's how to at least code to recognize the situation you're inquiring about:

Code: [Select]
            targets = [x.robot for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
            for bot in targets:
                if plus.isUpsideDown(bot) and not self.CanDriveUpsideDown(bot):
                    xxxxxxxxxxxxxx



Looks like Apanx is on top of it, thankfully. 
-----
 
Nar, S-32, GK,... glad to see you guys jumping in...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 23, 2009, 02:18:36 AM
Thanks so much Madiaba, and I'm fine waiting until you have the time you need to go though this.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 23, 2009, 02:30:32 AM
I was talking with Mad about achieving a similar goal with my own .py


Try looking in flipper.py it has coding for the robot to leave its opponent already
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 23, 2009, 03:03:27 AM
After getting up to try 12, none of my attempts have worked.

Here's the bit of code in particular that is causing problems:

Code: [Select]
    def Tick(self):
        # fire weapon

        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
            and not plus.isDefeated(x.robot)]
        for bot in targets:
            if not plus.isUpsideDown(bot) or self.CanDriveUpsideDown(bot):
                    fire = True
       
        # if a component is in the smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            for trigger in self.triggers1: self.Input(trigger, 0, 1)

        if self.weapons:
            targets = [x.robot for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
                           
            if fire: self.Input(self.trigger, 0, 1)
                                   
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn
       
    def CanDriveUpsideDown(self, bot):
        MOVE_THRESHOLD = 4.0
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 23, 2009, 06:26:06 AM
So what IS the problem specifically in this section, and how do you know it's here?
 
BTW...I couldn't get this coding to work well either, but haven't looked into just why yet. So I just threw together some relavant commands (which, look closely, are not the same as those you posted above...) since I was 'starting from scratch'.

And no prob, I only throw in my 2 cents because I know Apanx has school work (and a py project...hehe).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 23, 2009, 06:27:36 AM
Ah okay.

@S32: Was it just the test bots that gave you trouble since you last posted CheapPopup.py?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 23, 2009, 09:45:30 AM
DP.

Mad, the problem is that the py causes a C++ runtime error whenever I start a battle, and I know it's there because I simply added it to a working popup.py.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on December 23, 2009, 08:31:37 PM
Well first of all you have "targets =" in there twice.  You only need it once.

Second thing is, you might need to put "fire = False" in def __init__.  You usually need to do that with new variables.  I always use values of 1/0 for true/false though.  Maybe try replacing the True and False with 1 and 0?  I know I had problems because of that at least once.

And there better be more in def CanDriveUpsideDown than what you posted, because that will for sure cause a crash as is.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 24, 2009, 02:52:45 AM
The numbers bit confused me, but I'll try it in a minute.

Here's the whole py as it currently looks. I bet I've got fire=false out of line in the init section.

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

class IgnorePopup2(AI.SuperAI):
    "My special popup py that will ignore upside down bots."
    # Use variable 'NoChassisTime' in Bindings.py to set the amount of time in seconds the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.
    name = "IgnorePopup"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "weapon"
        self.triggers1 = ["Fire"]
        self.triggers2 = ["Srimech"]
        self.botinzone = 0
        self.compinzone = 0
        self.comptimer = 0
        self.NoChassisTime = 8
       
            fire = false       

        if 'zone' in args: self.zone = args['zone']
       
        if 'triggers' in args: self.triggers1 = args['triggers']
        if 'triggers' in args: self.triggers2 = args['triggers']
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4

        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(self.zone1, 1)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon

        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
            and not plus.isDefeated(x.robot)]
       
        # if a component is in the smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            for trigger in self.triggers1: self.Input(trigger, 0, 1)

        if self.weapons:
       
            if fire: self.Input(self.trigger, 0, 1)
       
        for bot in targets:
            if not plus.isUpsideDown(bot) or self.CanDriveUpsideDown(bot):
                    fire = True
                                   
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn
               
    def CanDriveUpsideDown(self, bot):
        MOVE_THRESHOLD = 4.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

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.triggers2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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)

    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone = 1
                    if chassis:
                        self.botinzone = 1
                if direction == -1:
                    self.compinzone = 0
                    if chassis:
                        self.botinzone = 0
        return True
   
AI.register(IgnorePopup2)

It still isn't working.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 24, 2009, 08:05:59 AM
GK, what program are you using to edit this py?
I just tried to select and paste your coding into a py and the formatting was corrupted. Your comp cannot read this file like it is, and thus crashes.

I would suggest you use 'Python' itself for editing pys. There are MANY advantages to using Python over another program.  Foremost of which would be a basic error checker, which would help you with your 'indenting', as you mentioned above.

Just google it, and it's easy to install and not a large program at all to take up disk space.
 
If you need help here, PM or IM me.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 24, 2009, 08:10:48 AM
I tried to download python, but my computer rejected the proper install and only let me download the source stuff, which I can't make head or tail of.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 24, 2009, 08:38:40 AM
Try this: Python (http://www.madiaba.gametechmods.com/python-2.5.2.rar)

It's one I had uploaded on an FTP account. Not sure if it's the very latest version, but what I'm using and good enough for now.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 24, 2009, 09:28:41 AM
Cheers Mad. I've run it through IDLE and fixed some indentation errors. However, there's still something wrong. I've tried with both true/false and 1/0 like Click suggested. IDLE can't find anything else wrong with it.

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

class IgnorePopup2(AI.SuperAI):
    "My special popup py that will ignore upside down bots."
    # Use variable 'NoChassisTime' in Bindings.py to set the amount of time in seconds the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.
    name = "IgnorePopup"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "weapon"
        self.triggers1 = ["Fire"]
        self.triggers2 = ["Srimech"]
        self.botinzone = 0
        self.compinzone = 0
        self.comptimer = 0
        self.NoChassisTime = 8
       
        fire = 0       

        if 'zone' in args: self.zone = args['zone']
       
        if 'triggers' in args: self.triggers1 = args['triggers']
        if 'triggers' in args: self.triggers2 = args['triggers']
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4

        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(self.zone1, 1)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon

        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
            and not plus.isDefeated(x.robot)]
       
        # if a component is in the smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            for trigger in self.triggers1: self.Input(trigger, 0, 1)

        if self.weapons:
       
            if fire: self.Input(self.trigger, 0, 1)
       
        for bot in targets:
            if not plus.isUpsideDown(bot) or self.CanDriveUpsideDown(bot):
                    fire = 1
                                   
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn
           
    def CanDriveUpsideDown(self, bot):
        MOVE_THRESHOLD = 4.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

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.triggers2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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)

    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone = 1
                    if chassis:
                        self.botinzone = 1
                if direction == -1:
                    self.compinzone = 0
                    if chassis:
                        self.botinzone = 0
        return True
   
AI.register(IgnorePopup2)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 24, 2009, 09:31:30 AM
is it crashing the game or just not correctly responding to what you want it to do ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 24, 2009, 09:38:03 AM
Crashing it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on December 24, 2009, 11:05:28 AM
Anyone notice how Omni.py does not support flippers?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 24, 2009, 11:19:29 AM
It does. Just wire your flipper like a normal poker (do NOT use Flip for control and smartzone)

However and unlike Flipper.py, it will need a separate srimech command.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on December 24, 2009, 11:48:20 AM
Yeah, but with bots like Cassius 2, how do you wire the flipper and spike separately?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 24, 2009, 11:52:44 AM
Omnimultizone.py

Check page 2 of the thread.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 24, 2009, 11:14:00 PM
ACAMS: I don't know if it's just my comp, but I doubt it.  If I select already posted 'code', when I paste it into a py, it is pasted all on the same line #1 at the top of the py.  Seems as though it loses its 'Returns'.
 
Guys: It would be appreciated if a couple of you guys could try this out to confirm, and perhaps also isolate the issue...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on December 25, 2009, 12:38:40 AM
I been thinking about how to AI this thing

http://s895.photobucket.com/albums/ac159/123savethewhales/bait0.jpg (http://s895.photobucket.com/albums/ac159/123savethewhales/bait0.jpg)

I think I need
front back invertible (maybe one involving smart zone and alternating the radius back and forth?).
Fire weapon (another smart zone), by alternating between left and right on half second interval (probably using analog), so the flails moves back and forth dealing damage.

The problem is I am not sure how to do any of those things.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 25, 2009, 01:09:11 AM
@Mad: Into python itself?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 25, 2009, 04:26:25 AM
I been thinking about how to AI this thing

http://s895.photobucket.com/albums/ac159/123savethewhales/bait0.jpg (http://s895.photobucket.com/albums/ac159/123savethewhales/bait0.jpg)

I think I need
front back invertible (maybe one involving smart zone and alternating the radius back and forth?).
Fire weapon (another smart zone), by alternating between left and right on half second interval (probably using analog), so the flails moves back and forth dealing damage.

The problem is I am not sure how to do any of those things.

Whipper.py ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 25, 2009, 06:27:24 AM
Yea, GK.
Can you select some posted text and then simply paste it into a py doc (preserving the formatting)?  Might be a prob on my end,... though I can't see how.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 25, 2009, 06:53:31 AM
Give me a minute...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 25, 2009, 06:57:20 AM
I've copied S32's cheap popup stuff. It seems to be formatted fine, but i'll test it out now on the game.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 25, 2009, 07:01:30 AM
It works fine ingame. Must be something your end Mad.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 25, 2009, 07:07:32 AM
Huh.  Thanks for help isolating the issue, GK.
In the mean time, just PM me your py and I'll look at it in an open slot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 25, 2009, 07:11:36 AM
No problem.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on December 25, 2009, 01:34:37 PM
I have a SnS that uses FBS_1. It usually works fine, but every so often it just stops and spins the other direction for a second or 2. It's very annoying because 1. It only works when spinning CW, and 2. because it slows the spinning down obviously.
Any ideas to make it spin CW all the time without it turning CCW at random moments?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 25, 2009, 01:42:28 PM
I had a few similar issues with Cataclysm when it was using FBS_1 as well.

Just use PillarPlus or my beloved FBS.py with a high 'spinspeed' value.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on December 26, 2009, 09:36:51 AM
FBS_1 has a very efficient 'immobile' detector that will sometimes stop the bot before you see the immobile countdown start.  IF this is the case then it's just doing what it is supposed to.  I've not seen any other behaviors in it for it is a basically a simple FBS AI.py with the first bullet-proof immobility solver, that was sometimes a problem in the Pillar.pys. 

IMHO: I think Apanx's FBS is the best FBS AI.py I've seen so far, because, while it doesn't eliminate totally the chance of immobility, it almost does in proactively seeking the enemy bot.
Yet for only a few FBSs, one of the 'Pillar', my 'FBS_1' or CB's 'FBS_2' might still be the best option.

Nar, I've not looked through your mod of FBS, yet...


Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 26, 2009, 09:51:58 AM
Of course FBS.py is the best :mrgreen:

Nar, I've not looked through your mod of FBS, yet...

Well, i've done 2 mods of FBS.

First is FBSPlus (FBS.py with incorporated spinning weapon support, now used by a few of my NAR AI HS). I just copypast'd a part of Spinner.py in FBS.py and made the necessary additions for it to work.

And the other one is just a slightly modded FBS.py that changes spinning direction when inverted - i think i posted in in the RAW 2 thread (since i made it for Iron Storm 5 so the maces spin the right way). I just removed a line that handles the spinning direction if the bot is inverted.

Now the next logical step would be implementing both setups in a single .py, so FBSPlus with an optional bindings entry that makes it spin one way or another when inverted .
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 26, 2009, 10:07:00 AM
I made a verson of FBS_1 that was designed to help Gyratory Reborn preform its second glitch when being counted out as a means of moving to break count.  :mrgreen:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 26, 2009, 10:31:02 AM
Hax !
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on December 28, 2009, 08:50:22 PM
Nary, can I see your FBSPlus.py?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 29, 2009, 02:42:56 AM

https://gametechmods.com/uploads/files/FBSPlus.rar
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on December 29, 2009, 03:00:58 AM
And the other one is just a slightly modded FBS.py that changes spinning direction when inverted - i think i posted in in the RAW 2 thread (since i made it for Iron Storm 5 so the maces spin the right way). I just removed a line that handles the spinning direction if the bot is inverted.
Can you send me a copy of this version?  I think my SnS can benefit from always spinning at the razor side.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 29, 2009, 03:12:47 AM
FBSInvertDir? It's in this RAR i sent to Sage.

https://gametechmods.com/uploads/files/IronStorm5new.rar
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on December 29, 2009, 03:23:44 AM
Thanks.  I will send you the update for my second team as well as my third team after some testing (FPSInvertDir instantly made all my SnS better).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 29, 2009, 03:30:03 AM
if it uses the same controls as normal FBS might pay off to use that python for my 3 SnS robots in NARAI Naryar
 
Hax !

 :p  lol its not python hax like mads toys, it was just designed to cause the glitch the same way I did it when controling myself. 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 29, 2009, 07:28:42 AM
Hax !

like you and STW's BFE overuse or HAX LOL DON'T UNDERSTAND LOL?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 30, 2009, 04:58:33 AM
PokerPlus - Poker.py with a few tweaks... not really finished.

https://gametechmods.com/uploads/files/PokerPlus.rar (https://gametechmods.com/uploads/files/PokerPlus.rar)

Needs some beta testing and if my additional functions do really work...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: mondebankale on December 30, 2009, 06:59:02 PM
Hi there,
i made a bot  :bigsmile:  but it doesn't work.   :dead:

the bot is an hybrid between a chopper and a flipper so i spent 12 hours straight to do the merge between chopper.py and flipper.py without success.

so here are the thing i know :
my bot works with chopper.py and also it works with flippper.py but it doesn't really suits my needs.

i made 2 smartzones : 1 named flip the other named weapon
I made 2 push buttons on the remote : Flip and Fire.
Then i made a copy of flipper.ai renamed it SuperFlip.ai.

So after several hours i keep failing mostly at the same parts : 2 weapons and 2 smartzones.
I don't know any python or perl so i can't really debugg it myself

also i read your OmniMultiZone, Top_Smasher_2R and Topknot but this is rocket science to me.

Any help please
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on December 30, 2009, 07:09:13 PM
I got a nice chuckle from that.

Just use chopper. There isn't much of a differance in the AI for both of them anyway.

Nice try though, good to see some would be AIers.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 31, 2009, 04:44:11 AM
Chopper isn't really good due to some self righting glitch.

OmniMultiZone isn't really hard to use. For your design, you just need to use 2 different smartzones called weapon and weapon1, and 2 different buttons for your weapons called Fire and Fire1.

You might want to download NAR AI and have a look at Rabid Grisly Bear.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 31, 2009, 04:47:00 AM
OmniMultiZone has a 'spin', right?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on December 31, 2009, 04:48:36 AM
Yes since it's an Omni.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 31, 2009, 04:50:35 AM
Doog. One of my second NAR AI team will work then.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on December 31, 2009, 03:14:32 PM
DP. I've just looked in the .py, and there's no spin in it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on December 31, 2009, 08:32:03 PM
spin tends to be a little hidden in omni, are you sure its not there ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 01, 2010, 03:07:50 AM
Phew, it is there.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 03, 2010, 01:29:44 PM
DP, I've got a query.

I'm AI'ing a team for NAR AI, but whnever I try to select the team in exhibition, the game crashes.

Here are all the bindings:

Code: [Select]
    #45 - srezinwP
    list.append(("ymgyP","Spinner",{'range':40,'radius':1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(24,25,26,27,28,29,30,31)}))
    list.append(("ecivoN","Rammer",{'invertible':True,'radius':1.5,'range':50,'topspeed':100,'turn':50,'turnspeed':3,'weapons':(10,12,14)}))
    list.append(("75.5 ?iouQ tE","Omni",{'radius':1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(32,33,34,35,36,37,38,39,40,41,48,49)}))
    list.append(("2 pergE","Omni",{'invertible':True,'radius':1.5,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3,'weapons':(15,16,17,18,19,20)}))
    list.append(("2 esallikoboR","Rammer",{'invertible':True,'radius':1,'topspeed':100,'throttle':100,'turn':70,'turnspeed':3,'weapons':(10,11,12)}))
    list.append(("SHW - 2 niarT niarreT llA","FBSPlus",{'invertible':True,'direction':1,'spinspeed':20,'radius':0.1,'range':50,'topspeed':100,'turn':70,'turnspeed':5,'weapons':(26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,61,62,63,64)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on January 03, 2010, 03:54:10 PM
All seems fine on the bindings, prehaps check the teams.txt? Could be a mispelled team picture or wrong index number.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 03, 2010, 03:57:27 PM
Thanks SSG. It must have been the picture.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on January 03, 2010, 06:36:12 PM
maybe try the .bot files and see if any are misspelled. and the picture wouldn't crash the game, the place where the pic would be would be white if it's misspelled.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 03, 2010, 10:16:54 PM
double spacing is a annoying and common issue, so is space's after the name. I export the bots and copy and paste the bot file name to be sure


also I will post up THZ.py soon  :mrgreen:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on January 03, 2010, 11:01:22 PM
So I got a crawler that has no trouble move forward/backward, but how do I AI it?

All I need it to do is move toward the guy, start spinning at 3 range, stop spinning when it gets out of 3 range, and move toward the guy again.

I tried Omni, but it wouldn't stop spinning after it get in range, even if the other bot end up outside of range later.  I know it's been done before with bumble bee so thanks if anyone can help.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 03, 2010, 11:14:46 PM
you want PillarPlus or WhipperPlus  :mrgreen:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on January 04, 2010, 12:36:08 AM
Thanks.  I tried them, don't really like the way they turn out though, I think I will stick to FBS_1 for now.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 04, 2010, 12:53:10 AM
PillarPlus uses range and WhipperPlus can use SZ's


I played around with Whippers last night there is lots of small tweaks you can do to it to changes actions  :mrgreen:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on January 04, 2010, 01:02:11 AM
The problem I am having with PillarPlus is that the front is absorbing too much impact.  I wanted the damage to be distributed more evenly on all 4 side (making it harder for a chassis kill).

I can sent you to bot if you want to take a look at it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 04, 2010, 02:42:04 AM
maybe try the .bot files and see if any are misspelled. and the picture wouldn't crash the game, the place where the pic would be would be white if it's misspelled.

Well I changed the picture and nothing else and it worked.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 04, 2010, 04:35:15 AM
I can sent you to bot if you want to take a look at it.

I would love to help but with 34+ robots asking for AI in CC3 I really cant at this stage sorry

could always do it with whipperplus and a whipzone SZ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 06, 2010, 12:48:09 PM
I've just written Tractor.py, a Plow variant based of Spinner.py

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

class Tractor(AI.SuperAI):
    "Spins in plow style"
    # - Works just like Spinner.py but with plow incoroporated into it.
    # - Correct weapon ID numbers will help.
    # - No extra stuff needed in the bindings.
    name = "Tractor"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
       
        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("")
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        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)
           
    def Disable(self,btarget):
        # Disables opponent by charging it at an angle
        # we use a different angle (depending on the size of the opponent!)
        # if target is equal in size, the plow weapon charges are more direct

        if btarget > self: self.Turn(79)
        else: self.Turn(-79)
        if btarget < self: self.Turn(35)
        else: self.Turn(-35)
        if btarget == self: self.Turn(90)
        else: self.Turn(-90)
        if self.target: self.Turn(360)
       
        return AI.SuperAI.Disable(self, btarget)
   
AI.register(Tractor)

Tested on one of my spinners and one of S_M's, and seems to work fine.

Download Link (https://gametechmods.com/uploads/files/Tractor.zip)

Any bugs/opinions appreciated.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 06, 2010, 05:37:16 PM
damn, I must be really bad at coding then.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 07, 2010, 02:49:34 AM
Why?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 07, 2010, 02:56:29 AM
here is my THZ.py

its the Frenzy Strategy + The robot will move to avoid count out (Frenzy.py doesn't do that)

https://gametechmods.com/uploads/files/THZ.rar (https://gametechmods.com/uploads/files/THZ.rar)

I will put it up on my website shortly
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on January 07, 2010, 08:17:21 PM
Lets play a game...Spot the error in the AI lines!



Code: [Select]
    # 42 - Dark Factory of Mass Production "We don't have a motto yet"
    list.append(("Revelation","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("Blind Destruction","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("Abyssal Designator","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("AW-The Prodigy","Omni",{'nose':math.pi*2,'invertible':True,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,13)}))
    list.append(("BW-Byter","Omni",{'nose':math.pi*2,'invertible':True,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,13)}))
    list.append(("Evil Intent","FBS_1",{'PreSpinEntrance':5,'SpinDirection':1,'ReMobilizeRoutineTime':20,'nose':math.pi*2,'radius':0.3,'range':99,'topspeed':100,'throttle':130,'turn':90,'turnspeed':4,'weapons':(22,23,24)}))


I can't find it and it might not be something wrong with the AI. It doesn't crash like it usually does when there is an AI mistake. It stops loading when the screen gets to 3/4 of the bar on the loading screen of NAR AI. I can't even get out of it either, I have to restart my computer.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 07, 2010, 11:25:53 PM
SD, if you can't visually find the prob:

1. Use the syntax checker in Python.

2. Cancel (number sign '#') out all, but only one of the lines. Then, try to load that bot. 
Then un-cancel 1 line at a time, and start each time to find the bad line.
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on January 07, 2010, 11:26:45 PM
or cancel them all out to see if that's actually the problem.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 08, 2010, 06:04:18 AM
I was trying to make tractor compatable with a srimech, but there's something wrong, and I can't see it.

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

class Tractorright(AI.SuperAI):
    "Spins in plow style with srimech"
    # - Works just like Spinner.py but with plow and srimech incoroporated into it.
    # - Correct weapon ID numbers will help.
    # - No extra stuff needed in the bindings.
    name = "Tractorright"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
       
        self.spin_range = 3.0
    self.trigger2 = ["Srimech"]       
       
        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("")
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        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 InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0       
       
    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)
           
    def Disable(self,btarget):
        # Disables opponent by charging it at an angle
        # we use a different angle (depending on the size of the opponent!)
        # if target is equal in size, the plow weapon charges are more direct

        if btarget > self: self.Turn(79)
        else: self.Turn(-79)
        if btarget < self: self.Turn(35)
        else: self.Turn(-35)
        if btarget == self: self.Turn(90)
        else: self.Turn(-90)
        if self.target: self.Turn(360)
       
        return AI.SuperAI.Disable(self, btarget)
   
AI.register(Tractorright)
I think the proble is with the line defining the trigger or this bit
Quote
    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0     

Edit: I've given up for the time being as it isn't working.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 08, 2010, 08:43:26 AM
what are you getting the robot not preforming the srimech or something else ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 08, 2010, 08:44:13 AM
Game crashing as I try to start battle
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 08, 2010, 08:59:08 AM
and you have narrowed down the issue to that section ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on January 08, 2010, 09:13:01 AM
Lets play a game...Spot the error in the AI lines!



Code: [Select]
    # 42 - Dark Factory of Mass Production "We don't have a motto yet"
    list.append(("Revelation","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("Blind Destruction","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("Abyssal Designator","Kheper",{'nose':math.pi*2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))
    list.append(("AW-The Prodigy","Omni",{'nose':math.pi*2,'invertible':True,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,13)}))
    list.append(("BW-Byter","Omni",{'nose':math.pi*2,'invertible':True,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,13)}))
    list.append(("Evil Intent","FBS_1",{'PreSpinEntrance':5,'SpinDirection':1,'ReMobilizeRoutineTime':20,'nose':math.pi*2,'radius':0.3,'range':99,'topspeed':100,'throttle':130,'turn':90,'turnspeed':4,'weapons':(22,23,24)}))


I can't find it and it might not be something wrong with the AI. It doesn't crash like it usually does when there is an AI mistake. It stops loading when the screen gets to 3/4 of the bar on the loading screen of NAR AI. I can't even get out of it either, I have to restart my computer.


Try opening it using Notepad++ and check if your bindings have these:
(https://gametechmods.com/uploads/images/62198bindings.PNG)


This has happened to me on various occasions. What I do is just backspace the automatic indent before list.append and type space one by one until it's indented properly. :D
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on January 08, 2010, 03:00:06 PM
I was trying to make tractor compatable with a srimech, but there's something wrong, and I can't see it.

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

class Tractorright(AI.SuperAI):
    "Spins in plow style with srimech"
    # - Works just like Spinner.py but with plow and srimech incoroporated into it.
    # - Correct weapon ID numbers will help.
    # - No extra stuff needed in the bindings.
    name = "Tractorright"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
       
        self.spin_range = 3.0
        self.trigger2 = ["Srimech"]        #There's your problem right there; this line needs to be indented once more.
       
        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("")
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        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 InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0       
       
    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)
           
    def Disable(self,btarget):
        # Disables opponent by charging it at an angle
        # we use a different angle (depending on the size of the opponent!)
        # if target is equal in size, the plow weapon charges are more direct

        if btarget > self: self.Turn(79)
        else: self.Turn(-79)
        if btarget < self: self.Turn(35)
        else: self.Turn(-35)
        if btarget == self: self.Turn(90)
        else: self.Turn(-90)
        if self.target: self.Turn(360)
       
        return AI.SuperAI.Disable(self, btarget)
   
AI.register(Tractorright)
I think the proble is with the line defining the trigger or this bit
Quote
    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0     

Edit: I've given up for the time being as it isn't working.


Fixed.  The line defining trigger2 needs to be indented more.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 08, 2010, 03:37:59 PM
space or tab?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on January 08, 2010, 05:40:25 PM
Indents in Python are always four spaces.  Just copy what I did in my post.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: S.T.C. on January 08, 2010, 08:57:53 PM
I don't know if I should post this here but

my SHW (which is in my showcase) keeps turning while moving forward and back and I can't seem to make it stop doing that.How do you make it so it won't keep doing that?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 09, 2010, 01:29:20 AM
Have you wired the controls correctly?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: S.T.C. on January 09, 2010, 08:58:22 AM
yeah, I did
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 09, 2010, 10:06:26 AM
I dunno then.

Edit:The edit to the .py isn't working, might be the test bot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 12, 2010, 12:57:06 PM
I was AIing a batch of Stock bots, when suddenly... Nothing.

I mean it, I wire the bindings correctly and NO AI works.

They just drive, no weapon movement at all. It's freaky.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on January 12, 2010, 08:13:43 PM
Someone help please?

I'm trying to AI those servo bots. On the left is my bot and below is Click's Kheper. Wired and named exactly the same yet they don't act the same way. My bot trys to move the servo down at the beginning of the match instead of up which is bad...

(https://gametechmods.com/uploads/images/94168revAi.PNG)
(https://gametechmods.com/uploads/images/46843khep.PNG)

and my bindings and Kheper's.

Code: [Select]
    list.append(("Revelation","Kheper",{'nose':math.pi*2,'invertible':False,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))

    list.append(("Kheper","Kheper",{'nose':math.pi/2,'invertible':True,'radius':1,'topspeed':99,'throttle':100,'turn':100,'turnspeed':2,'ServoID':7,'NoChassisTime':4,'weapons':(32,33,34,35,36,37)}))

This is really the only thing keeping me from sending my bots to finish for NAR AI. Tomorrow is the latest I want to send the bots so if I cant figure it out I will just send new bots to replace them...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 12, 2010, 09:23:02 PM
I haven't looked though the py but should the ServoID be the same ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on January 12, 2010, 09:26:15 PM
I haven't looked though the py but should the ServoID be the same ?
Well, Click said ServoID is what tells the .py where to get the motor angle from and since they are the same they SHOULD be. Unless im misunderstanding what its supposed to do.

Edit: WAIT I think i know whats going on. I forgot to edit the motor angles in the py >.<
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on January 12, 2010, 09:38:38 PM
Ah.  It's because your servo is mounted on the baseplate, while Kheper's is mounted sideways on a drum piece.  Your servo is also facing in the opposite direction.


The '0' angle on the DSL servo is in the +Y direction.  So for your bot, 0 is straight up.  But I wrote Kheper's .py based on a '0' angle in the +Z direction, because that is how the servo is oriented on Kheper.


Fix that requires some rebuilding: rotate your servo so it is exactly like Kheper's.


Fix that requires some Python edits: Go through Kheper.py and redo all the angles.  Doing a search for "GetMotorAngle" should find all of them for you.


To clarify:


Servo angles on Kheper=
(https://gametechmods.com/uploads/images/53725anglesk.jpg)
Servo angles on your bot=
(https://gametechmods.com/uploads/images/91595angleso.jpg)

Edit: WAIT it looks like you figured it out.  Well those diagrams should still help.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 16, 2010, 03:11:50 PM
What does EcoOmni do?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 16, 2010, 03:33:33 PM
I still have issues with my SZSpinner.py

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

class SZSpinner(AI.SuperAI):
    "Like Omni, but does not use a range value for a spinning weapon ; instead uses a smartzone"
    name = "SZSpinner"
   
    #IMPORTANT NOTE: This is a WIP and it might not work properly.
    #Just like said, this is an Omni AI that activates it's spinning weapon via a smartzone (that you need to name "spinner") rather than a range value.
    #For very short spinup time robots (jugglers, drums, face spinners, etc) that only really need to spin their weapons when the opponent is on them.
    #Brought to you by Naryar and inspired by Madiaba's Arrowhead.py.
   
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "weapon"
        self.zone1 = "spinner"
        self.triggers = ["Fire"]
        self.trigger2 = ["Srimech"]
        self.reloadTime = 0
        self.reloadDelay = 3
        self.botinzone1 = 0
       
     
        if 'triggers' in args: self.triggers = args['triggers']
        if 'reload' in args: self.reloadDelay = args['reload']
       
        self.triggerIterator = iter(self.triggers)
 
        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(self.zone, 1)
            self.RegisterSmartZone(self.zone1, 2)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon
        if self.weapons:
            # spin up if enemy is in smartzone.
            if self.botinzone1 == 1:
                self.Input("Spin", 0, 100)
            else:
                self.Input("Spin", 0, 0)
           
           
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
           
            # slight delay between firing
            if self.reloadTime > 0: self.reloadTime -= 1
           
            if len(targets) > 0 and self.reloadTime <= 0:
                try:
                    trigger = self.triggerIterator.next()
                except StopIteration:
                    self.triggerIterator = iter(self.triggers)
                    trigger = self.triggerIterator.next()
               
                self.Input(trigger, 0, 1)
                self.reloadTime = self.reloadDelay
           
        return AI.SuperAI.Tick(self)

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    def LostComponent(self, id):
        # if we lose all our weapons, stop using the Engage tactic and switch to Shove (absolutely worthless, that said)
        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(SZSpinner)



The .py in a whole works, but the spinner doesn't spins ! Any help ?

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 16, 2010, 11:09:05 PM
I see a couple probs, Nar.  But please expound on all of your desired characteristics, first please.
1. SZ triggers spin?
2. _____________
3. _____________
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Trovaner on January 16, 2010, 11:56:56 PM
Right now, self.botinzone1 isn't getting changed so the bot won't spin.

Things you can do:
1. Add a SmartZoneEvent section to the bottom -- you would probably want to move the "Fire" command down, too; if you choose to do this
2. Do what was done for the "Fire" command -- the only problem with this would be that the two smartzones could interfere with each other
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 17, 2010, 03:35:19 AM
@Mad: Yes, it's just an Omni that only spins it's spinning weapon as long as the bot is in a smartzone.

Right now, self.botinzone1 isn't getting changed so the bot won't spin.

*Slaps self in face* I thought self.botinzone1 was automatically detecting the bot but obviously it's just a constant that has to be modified...

Right, i'll try to get how SmartZoneEvent works and implement that.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 17, 2010, 08:14:11 AM
Yea, "self.botinzone1" isn't a command.  "Spin" never saw the light of day. That was one of the probs. 
But still, Nar, what is your objective as a whole? ...Or is that all?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 17, 2010, 08:26:20 AM
Yes, just an Omni.py supporting a spinner with a smartzone switching the spinner on/off (<= not with a switch command of course, but with an analog). Might be useful for a few jugglers and top spinners, including my last Backyard Grinder... also i think Reier's Hot Rod needs this to work.

But no, I can't figure what are you trying to make me think of and what greater purpose do you seem to see under this.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 17, 2010, 08:36:00 AM
if you have power saving in mind why not take a look at EcoOmni ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on January 17, 2010, 08:39:43 AM
if you have power saving in mind why not take a look at EcoOmni ?

It's not the only thing i have in mind.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 17, 2010, 09:15:16 AM
Ok. Just trying to get a 'whole picture' of things....
So yea, just add a SmartZoneEvent section that controls "Spin".  If you need help, just ask.
BTW, Really glad you're getting into the coding, Nar. Some cool stuff can be done...
 
 
 
Thanks, Trov. for helping out so much...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 17, 2010, 03:14:35 PM
Recently finished AIing a batch of Bots.

And... Crash.

I can't remember what does this, I edited the bindings and AI folders, if that helps.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 17, 2010, 03:19:30 PM
Where's the crash? Startup? Did you forget teams.txt?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 17, 2010, 03:29:25 PM
During startup.

No warning at all.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 17, 2010, 03:30:08 PM
Post the bindings here
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on January 17, 2010, 03:32:15 PM
You might have a false index number in teams.txt
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 17, 2010, 04:12:55 PM
didn't even mouse over the teams TXT

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 17, 2010, 04:13:26 PM
I see. Post the bindings anyway.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on January 17, 2010, 06:07:24 PM
    list.append( ("Locktite","Poker",{'nose':math.pi\2,'topspeed':12.0,'throttle':110,'turn':80,'turnspeed':4.5,'weapons':(1,)}))
    list.append( ("Snow plow", "Rammer",{'nose':math.pi,'topspeed':20.0,'throttle':140,'turnspeed':6.0,'weapons':(1,)}))
    list.append( ("EMERGANCY 2", "Spinner", {'radius':0.4,'topspeed':20.0,'throttle':110,'weapons':(1,)}))

(Sparky...)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 17, 2010, 07:53:06 PM
    list.append( ("Locktite","Poker",{'nose':math.pi\2,'topspeed':12.0,'throttle':110,'turn':80,'turnspeed':4.5,'weapons':(1,)}))
    list.append( ("Snow plow", "Rammer",{'nose':math.pi,'topspeed':20.0,'throttle':140,'turnspeed':6.0,'weapons':(1,)}))
    list.append( ("EMERGANCY 2", "Spinner", {'radius':0.4,'topspeed':20.0,'throttle':110,'weapons':(1,)}))

In this coding there's '\' that should be '/'. 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on January 19, 2010, 02:37:26 AM
Topspeed @ 20?!?! :O

Just put it at 99, even if it can't reach it, it can still run as fast as it could. :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on January 19, 2010, 02:52:48 AM
reminds me of some of the stock AI going slow despite having fast drive
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 26, 2010, 12:08:24 PM
I was AI'ing a bot with LaserGuidedV3 but whenever I test it, the servo spins away from the bot

Here's the bot:
(https://gametechmods.com/uploads/images/65402sowaibot.png)
And bindings:
Code: [Select]
    list.append(("Sowobot","LaserGuidedV3",{'servonose':-1,'range':80,'radius':1,'servospeed':60,'topspeed':99,'mayFire':True,'throttle':130,'weapons':(20,21,22,23)}))
I have also tried servonose:1, nothing really changes.

Help would be appreciated.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on January 26, 2010, 05:23:51 PM
I'm no expert...but maybe wire it the other way?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 12:12:31 AM
What do you mean? The servo?
Edit: I tried that and it still doesn't work.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on January 27, 2010, 06:33:23 AM
SOW, cool.
Gk, the servos in stock and DSL actually point in start (default) at 3.14 radians from each other(they all points the opposite directions).

So that may be the issue, on your SOW bot..

Send me your Bot, AI.py and Bindings line, and I'll look it through...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 11:37:32 AM
Thanks Mad. I'll do that.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 27, 2010, 12:38:50 PM
I was AI'ing a bot with LaserGuidedV3 but whenever I test it, the servo spins away from the bot

Here's the bot:

And bindings:
Code: [Select]
    list.append(("Sowobot","LaserGuidedV3",{'servonose':-1,'range':80,'radius':1,'servospeed':60,'topspeed':99,'mayFire':True,'throttle':130,'weapons':(20,21,22,23)}))
I have also tried servonose:1, nothing really changes.

Help would be appreciated.

you may try with 'servonose':-0.5 or 0.5
another problem may be due to the fact that servo motor are very weak : they cannot support heavy weight and are quickly unable to move. Use the 'biggest' servo available.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 12:41:14 PM
I'll try that, thanks Phil. It is using the largest Servo I can use.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 01:10:31 PM
DP. Unfortunately with both numbers it still rotates the piston away from the opposing bot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on January 27, 2010, 01:11:42 PM
Could you rotate the component attached 180degrees?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 01:12:34 PM
I don't see how that would help.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: philetbabe on January 27, 2010, 01:34:50 PM
you've got another parameter called delta; it is used to say that an angle is corerct even if does not really aim the good direction.
the higher, the more tolerance

here are sample use of delta :
Code: [Select]
   Line 973:     list.append( ("head on", "LaserGuidedV3",{ 'servonose':1, 'range':80, 'radius':2.5, 'servorange':2.8,'delta':0.25, 'servospeed':50, 'topspeed':99, 'mayFire':True, 'throttle':130,'weapons':(1,2,3,4,5,6,7,8,9)}))
   Line 974:     list.append( ("BJM servo", "LaserGuidedV3",{ 'nose':math.pi,'range':80, 'radius':3, 'servorange':2,'servonose':-1,'delta':0.15, 'servospeed':60, 'topspeed':99, 'mayFire':False, 'throttle':130,'weapons':(1,2,3,4,5,6,7,8,9)}))

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on January 27, 2010, 01:49:21 PM
I see. I'll try that.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 02:57:11 AM
DP

Click sent me his TT entry with AI, but it crashes my game after the 3-2-1 and a bit of time. Could someone who knows how to AI with VertSpinner look at it please?

https://gametechmods.com/uploads/files/VATBH.zip
Bindings line:
Code: [Select]
    list.append(("Verbal Abuse to Bodily Harm","VertSpinner2",{'radius':1.2,'turnspeed':2.5,'topspeed':99,'turn':75,'throttle':100,'range':99,'weapons':(32,33,34,35,36,37,38,39),'sweapons':(30,31)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on February 06, 2010, 03:04:18 AM
what arena ? have you tried others ? could be an arena issue

if not the copy of VertSpinner2 could be it .. sounds like a tick issue ? possibly immobile handler
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 03:07:20 AM
Tried Electric Arena 2, Octagon and Combat Zone.

I used the copy of the py that Click sent with the bot. Should I try with the one from BBEANS AI?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on February 06, 2010, 03:13:41 AM
yes

always try and trouble shoot these things so you can locate the area of the problem.. makes problem fixing so much easier 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 03:36:09 AM
Tried the newer .py, and there still is the same problem with the different arenas.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on February 06, 2010, 07:20:45 AM
That's funny, I AI'ed it with no trouble, and it works!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 07:21:22 AM
That very bot?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on February 06, 2010, 07:22:09 AM
yes.

Edit: I used a clean copy of Stock RA2 and the BBEANS AI pack to AI it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 07:22:53 AM
Strange.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on February 06, 2010, 07:24:15 AM
check the import section of the python.. I dont have a copy in front of me right now but make sure you have those files it imports
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 07:35:33 AM
For bindings or vertspinner?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on February 06, 2010, 07:41:49 AM
the python itself

or just put them onto BBEANS AI to make sure you have it all
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 09:56:27 AM
I've Ai'ed it sucessfully with Omni, will test in BBEANs shortly.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 06, 2010, 11:09:25 AM
DP. Testing in the BBEANs AI folder made it work, so I copied the stuff into my other AI folder and it worked there too. Thanks Joe and Badnik for helping.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on February 12, 2010, 10:41:48 PM
Whups, I think I know what your problem was.  VertSpinner and VertSpinner 2 both use 'sweapons', which requires an updated __init__.py in order to work.  That __init__.py has been floating around for so long I just forgot about it and assumed you had it.


If you copy/paste __init__.py from the BBEANS AI AI folder into whatever AI folder you were using before, it should work.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 13, 2010, 03:20:53 AM
Yeah, that's what the problem was. A quick steal from my BBEANS folder got it working.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on February 16, 2010, 06:56:59 AM
Is there an AI to switch disc direction when upside down?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: The Ounce on February 16, 2010, 06:58:33 AM
^^Drum.py
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 16, 2010, 07:01:17 AM
Did Nary release that?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: The Ounce on February 16, 2010, 07:04:24 AM
It was included in Nar AI v2
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 16, 2010, 07:05:29 AM
Was it? *wacks self in face* So it was?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on February 16, 2010, 07:25:46 AM
Is it just me or does it ignore upside down bots?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on February 16, 2010, 08:37:29 AM
You just need to wire the spinner with an analog... CW for upwards spinning and CCW for downwards.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on February 16, 2010, 08:43:33 AM
I've done that and it works fine. But if the bot it's against is upside down it won't attack.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: d-lark on February 16, 2010, 09:48:56 PM
Alright, so, I am just trying to get into this AI thing, so using a HS and NAR pack, i used the tutorial here on GTM to replace the 6th bot on the prehistoric team which is a HS like mine. As far as I can tell, I did everything right, but everytime I attempt to put it into actuion, the game crashes with a c++ runtime error. What am I doing wrong?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on February 16, 2010, 10:26:39 PM
Did you check the bindings?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: d-lark on February 17, 2010, 12:04:07 AM
here's the part where I get confused, I literally have no clue what Im doing, I just followed the tutorials. I have been reading this thread but none of its making sense, is there another tutorial that will help me understand the processes and the bindings and all that good stuff?

Dare I ask if there is someone out there who will take a few minutes to teach me?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: The Ounce on February 17, 2010, 12:09:46 AM
Philetbabe's AI chart.  He has a download of it on page 7 of this thread I believe.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: d-lark on February 17, 2010, 03:21:45 AM
Thanks that helped alot, I must have been making a mistake in the bindings.py but i think I fixed it.

Just a suggestion, why dont we put a link for that on the first page of the thread, it would probably make things easier, like I said I started reading but nothing made sense after the 4th page so I didn't think there would be anything worthwhile for me later on.

Just a thought.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 17, 2010, 04:50:14 AM
What nose value should I use for this bot?

(https://gametechmods.com/uploads/images/70058nosehelp.png)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on February 17, 2010, 04:54:05 AM
It does look like it's 5/6*pi.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 17, 2010, 04:55:26 AM
So I write math.pi*5?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on February 17, 2010, 04:58:42 AM
math.pi*5 equals math.pi, so no. Just write math.pi* 5/6 or math.pi*0.825.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 17, 2010, 04:59:08 AM
ok
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Scrap Daddy on February 17, 2010, 08:11:37 PM
Has anyone written a guide to AIing with pictures and stuff? I'm willing to do one similar to the picture taking thread(which not a lot of people use).

I was thinking something similar to SC's guide with pics and how to make a new team instead of replacing a bot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: System32 on February 17, 2010, 09:54:15 PM
SC's AI tutorial was cluttered and formatted poorly. Stagfish could do better.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Stagfish on February 18, 2010, 07:00:01 AM
i can AI you know, how do you think i AI'ed the bots for ROBONOVA?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on February 18, 2010, 07:00:43 AM
The point is you are one of the newest AI'ers and some consider you a n00b.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Stagfish on February 18, 2010, 07:02:09 AM
:(
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: S.T.C. on March 21, 2010, 07:10:56 PM
For some reason when I AI a bot, it won't move at all, plz help

btw, this is the first time this has happened to me.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on March 21, 2010, 07:12:08 PM
Are the controllers named Forward and LeftRight?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: S.T.C. on March 21, 2010, 07:20:44 PM
Are the controllers named Forward and LeftRight?
Yeah
 
I figured out what happened, Sparkey has a weird way of controlling bots.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on March 22, 2010, 02:39:53 PM
Does anybody know where I can get a download of the latest AI Chart?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Stagfish on March 24, 2010, 03:11:25 PM
Are the controllers named Forward and LeftRight?
Yeah
 
I figured out what happened, Sparkey has a weird way of controlling bots.

how does he control them?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on March 24, 2010, 03:19:32 PM
Like that other game goose posted about.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 027 LB on March 26, 2010, 06:19:08 PM
Thanks to Badnik96, I have a new AI!
https://gametechmods.com/uploads/files/MultiPiston.rar (https://gametechmods.com/uploads/files/MultiPiston.rar)
It allows you to fire 6 different pistons wired to different controls. The buttons have to be wired Fire1, Fire2 etc and the Smartzones have to be named Piston1 (with caps), Piston2, etc.

Will get a video on how it works soon.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on March 26, 2010, 06:29:14 PM
Yeah, I did make it. It will be implemented in his RA2 Trials bot.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sparkey98 on March 26, 2010, 08:47:46 PM
That's not "weird". I have a diferent drive style. You're all "weird" beacuse you build unrealistic in stock.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on March 26, 2010, 09:44:09 PM
 :idea2: Or are you weird because you don't...
*The fabric of space tears releasing waves of philosophy*
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on March 27, 2010, 03:47:07 AM
@Badnik/027: Does it have a srimech?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on March 27, 2010, 06:54:29 AM
It has "def InvertHandler(self):" for weapon trigger names 'Fire1', 'Fire2', 'Fire3', 'Fire4'.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on March 27, 2010, 07:14:17 AM
hmm, I will add a srimech later.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: powerrave on March 27, 2010, 06:50:55 PM
:idea2: Or are you weird because you don't...
*The fabric of space tears releasing waves of philosophy*

i build realistic in stock if i build there too, but i consider myself decently normal.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Somebody on March 27, 2010, 08:12:23 PM
Problem is that I just remembered that sparkey does build unrealistic in stock  :ouch:

hmmm...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on March 28, 2010, 10:48:11 AM
interesting python Badnik/027

was it built off a whip python or did you add the back and forth whip motion to it ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: yoda9726 on April 02, 2010, 10:31:40 PM
Hoping you guys can help me out here.  pretty new to ai'ing, but getting the hang of it.  However, i can't seem to figure out how i can ai my Ka'Dargo bot correctly ( https://gametechmods.com/forums/index.php?topic=3572.15 (https://gametechmods.com/forums/index.php?topic=3572.15) ).  I've gotten it to where it fires the hammer at the right time, no problem.  The problem is getting the piston attached to it to fire at the right time.  I want it to fire just after the hammer swings, and only fire once per hammer swing.   As it stands now, they both fire at the same time, and the piston constantly fires the whole time the other bot is in the smart zone, which keeps the hammer from retracting quickly. 
 
Any ideas? and thank you in advance.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on April 03, 2010, 10:11:12 AM
Couple ideas:
1. You can code your py to fire the piston a short interval after the burstmotor (hammer).

2. You can attach a SZ to the piston that will move/swing with the arm, and fire only when an enemy is under it's pointytips. (BFE)
 
3. You can see if you can get a legit return from "self.GetMotorAngle(CompID)" - This returns the angle of a motor in radians, but I've never tried it on a 'burst' motor so not sure what you'll get back.  If you get a valid return, then since the angle of the BM is adjustable, you'll also have to play around to find out where you have the parameters of the burstmotor set for your bot's application (start position, and fired position [in radians: 0-6.28]).
Here's some basic coding adapted from a servomotor:
 
    self.burstangle = self.GetMotorAngle(Component ID) #Find angle of burst motor.
    if self.burstangle > ?: #If angle of burst motor is beyond it's 'start' position (by whatever amount),
        self.Input("Fire_1", 0, 1) #Then fire the piston.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: yoda9726 on April 04, 2010, 05:12:44 AM
Couple ideas:
1. You can code your py to fire the piston a short interval after the burstmotor (hammer).

2. You can attach a SZ to the piston that will move/swing with the arm, and fire only when an enemy is under it's pointytips. (BFE)
 
3. You can see if you can get a legit return from "self.GetMotorAngle(CompID)" - This returns the angle of a motor in radians, but I've never tried it on a 'burst' motor so not sure what you'll get back.  If you get a valid return, then since the angle of the BM is adjustable, you'll also have to play around to find out where you have the parameters of the burstmotor set for your bot's application (start position, and fired position [in radians: 0-6.28]).
Here's some basic coding adapted from a servomotor:
 
    self.burstangle = self.GetMotorAngle(Component ID) [/color]#Find angle of burst motor.
   if self.burstangle > ?: #If angle of burst motor is beyond it's 'start' position (by whatever amount),
        self.Input("Fire_1", 0, 1) #Then fire the piston.

uhmm...whew...i'll try and figure it out.  thanks for the input.  Should've pointed out that i'm currently at the state of feeling an accomplishment when i choose the correct py to go on the bot lol.  Talk to me like i'm 5 maybe?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 04, 2010, 05:47:38 AM
that will teach you for spending more time in the arcade then the forum itself :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: yoda9726 on April 04, 2010, 05:49:30 AM
lol.  too true
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on April 04, 2010, 09:29:20 AM
Ok, Yod..., NP.
If you send me your bot, I'll BFE a smart zone onto it's extender so that it moves with the arm. Thus it will always remain right in front of the swinging piston so that if a bot is within the piston's reach, only then will it fire.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: yoda9726 on April 04, 2010, 04:37:44 PM
Thank you.  That'd definately help out.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 06:55:31 AM
Can anyone see what's wrong with this AI line?

Code: [Select]
    list.append(("Kikeroga","Pillar",{'invertible':True,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'range':99,'weapons':(27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:00:47 AM
Can anyone see what's wrong with this AI line?

Code: [Select]
    list.append(("Kikeroga","Pillar",{'invertible':True,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'range':99,'weapons':(27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46)}))

does the robot have 46 components ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on April 05, 2010, 07:01:30 AM
It's missing 33, but I'm not sure whether that causes the problem or not.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:02:29 AM
Yes, it has 46. 33 is an extender.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:18:31 AM
It's missing 33, but I'm not sure whether that causes the problem or not.

that doesnt effect it.. only tells the AI which components it needs to loose in order to change strategy

---------------

I dont have a copy of Pillar myself but Pillarplus requires a 'range2' attribute
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:20:33 AM
I've tried swiching to  FBSPlus too. Neither work. Is it the bot file at fault?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:32:34 AM
copy and paste a binding line from a robot you know works as a method of isolating the problem
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:33:26 AM
I have.

Joe, check your PM's.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 05, 2010, 07:36:50 AM
Once again, the weapons entry do not matter on such an AI.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:38:41 AM
Once again, the weapons entry do not matter on such an AI.

again I dont know about pillar but pillarplus will change to shove is it looses weapons
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 05, 2010, 07:42:05 AM
Once again, the weapons entry do not matter on such an AI.

again I dont know about pillar but pillarplus will change to shove is it looses weapons

Like nearly all of the AI.

I think pillar did not supported a spinning weapon system, but not sure...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:43:59 AM
I've tried FBS_1 too.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:45:32 AM
I think pillar did not supported a spinning weapon system, but not sure...

nope I am pretty sure it doesnt.. thats what PillarPlus was for  ;)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:46:17 AM
Oopps. It still doesn't like FBSPlus or FBS_1 though.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 05, 2010, 07:58:51 AM
what about omni if its a spinner?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 05, 2010, 07:59:36 AM
It's an SnS. And I tried a working AI line.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on April 06, 2010, 08:50:23 PM

Can someone please tell me what's wrong with this binding line?
Code: [Select]

list.append(("USS Enterprise","Spinner",{'nose':math:.pi,'range':100,'radius':1,'topspeed':100,'throttle':130,'turn':70,'turnspeed':5,'weapons':(1,2,3,4,5,6,7,8)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 06, 2010, 08:59:12 PM
once thing that can trip up a lot of people is ensure there are no extra spaces in the bot name

I know some people in CC put a space at the end of the name by mistake which casues headaches
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on April 06, 2010, 09:02:49 PM
No extra spaces in the name, show I'm not sure what's up with it.
I only have one other bot AIed and that was my BBEANS6 entry..


*Edit* Duh, I put a : after math
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 06, 2010, 09:26:35 PM
lol didnt see that :P damn stupid eyes
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on April 06, 2010, 09:27:54 PM
lol didnt see that :P damn stupid eyes
lol, I looked over it a couple times before I noticed it too.
Back to AIing the rest of my team now.
Also what's the nose math on this bot?
(https://gametechmods.com/uploads/images/56693untitled.PNG)

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 06, 2010, 09:34:36 PM
either math.pi/2 or -math.pi/2 I think ? hehe I forgot which I usually plan out my robots to use pi*2 :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on April 07, 2010, 01:02:10 AM
Is there an AI that flicks a switch at start and leave it on?  It is important that it uses a switch so it doesn't stop at any time.  I wanted to use it for this

(http://s895.photobucket.com/albums/ac159/123savethewhales/yoda0.jpg)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 07, 2010, 01:11:50 AM
put it as a button name it spin and omni ?

I dont recall omni stops spinning in the case of a count out
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on April 07, 2010, 01:49:26 AM
So if I want it to start spinning right away (rather than after the 3 ticks), how would I do it?

So far my code looks like this

Quote
    def Tick(self):

        self.Input("Spin", 0, 1)

        return AI.SuperAI.Tick(self)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 07, 2010, 02:02:10 AM
if you set a large enough range omni should spin straight away ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on April 07, 2010, 02:09:06 AM
if you set a large enough range omni should spin straight away ?
It spins once the 3 ticks countdown end.  But prespin helps keep this bot balance.  I wanted the switch to be turn on before the match starts (during the countdown).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 07, 2010, 02:18:19 AM
but the game stops this motion before match starts anyway ?

but still you will have to consult mad and he knows how to break the RA2 rules in python :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 123savethewhales on April 07, 2010, 02:58:15 AM
but the game stops this motion before match starts anyway ?

but still you will have to consult mad and he knows how to break the RA2 rules in python :P
I would think so too.  But the result varies from the AI to when I manually flicking the switch before the timer starts.  I am not sure what it is though.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: yoda9726 on April 07, 2010, 10:59:29 AM
When i made Doom Dreidel, a friend of mine was here with me.  We were joking that it'd probably be the easiest bot in the world to AI.  Now, I come here and see a question about AI'ing his offspring (and mega upgrade).  Thanks for ruining my joke, 123 :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 14, 2010, 07:50:09 AM
Where did Click release Kheper.py?

And where's that handy picture of all the different math.pi?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 14, 2010, 07:56:39 AM
I dont know.. Scrap used it in a NarAI bot if I remember.. if not I can send you a copy

I dont know about the existence of this either.. I scribbled up one for HA but that's about the extent of my knowledge
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 14, 2010, 08:01:11 AM
@GK: For the math.pi thing, that depends of the heading ruler. Extreme left is 'nose':0, middle is 'nose':math.pi, extreme right is 'nose':math.pi*2 (=0) .

I dont know.. Scrap used it in a NarAI bot if I remember.. if not I can send you a copy

He should have, but didn't since he fell on problems with the .py having problems with servo being attached to the baseplate or not and changed his servo clamping VS team to a FS team.

So no, i don't have Kheper.py... but i am really looking towards getting it  :bigsmile:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 14, 2010, 08:03:14 AM
I don't particularly need it, but I just wondered how Scrap got it.

I think Nary was the one who posted it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 14, 2010, 08:06:00 AM
Ask Click.

All the servo VS py's i have in NAR AI are LittleMetalFriend.py (that is 7 years old), Phil's InMyArms2.py (that i can't get to work) and the SOW AI (that i didn't even touched yet).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on April 18, 2010, 12:11:44 AM

I gave Scrap Daddy Kheper.py for his bots.  However, it is hard to use because the angles in the .py are specific to Kheper, and because of the way GetMotorAngle works I don't think they could be easily customizable.  For non-Kheper bots you probably need to make a copy of the .py and change the angles.  Be forewarned.


https://gametechmods.com/uploads/files/Kheper.zip (https://gametechmods.com/uploads/files/Kheper.zip)

if you set a large enough range omni should spin straight away ?
It spins once the 3 ticks countdown end.  But prespin helps keep this bot balance.  I wanted the switch to be turn on before the match starts (during the countdown).


Put self.Input("Spin", 0, 1) in def __init__ or def Activate?  Nothing in def Tick happens until after the countdown.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 18, 2010, 03:35:59 AM
*Pounces on the download*
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on April 18, 2010, 08:45:58 PM
Though I didn't look at it yet, Click, why would it be too difficult to assign a variable to the desired parameter(s) of 'GetMotorAngle' and pipe it out to the Bindings line for particular-bot adjustments?

I'll check it out...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on April 24, 2010, 02:24:35 PM
Is there a way to stop weapon motors from reaching max speed using the AI code. I have a bot that works really well but wobbles because the motors are spinning too fast. Can you slow the max speed down just a little bit?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 24, 2010, 02:34:48 PM
LOL, I was just about to ask that myself.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 24, 2010, 02:38:44 PM
Yes there is. You need to mod a spinner AI.py (or anything that supports spinning weapons) with an analog control rather than a button for the spinner, and when the function that makes the spinning is called, just put self.Imput("Spin", 0, X) where X is the spinner's throttle (for button controls X is 0 or 1). Default 100, so technically if you get it lower than 100 the spinner will be less powerful.

I think.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on April 24, 2010, 02:54:43 PM
Nice job there, Nar. I now know why Joe has an affinity toward you... ;)    That can be done quickly and easily.  And Nar is becoming a coder...

Also, you might try CB's RPM monitoring AI and code the top R's like a rev-limiter.
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on April 24, 2010, 02:55:09 PM
Great.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 24, 2010, 03:00:23 PM
I now know why Joe has an affinity toward you... ;)

Should i conclude you believe in the lies that are circulating about me and Joe ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on April 24, 2010, 03:04:51 PM
How would I AI a full body popup?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 24, 2010, 03:08:29 PM
the same as a regular one.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 24, 2010, 03:10:05 PM
Yup. It might drive badly because the chassis moves a lot, but still it's the simpler way to do this.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on April 24, 2010, 07:12:24 PM
Could I use Timber.py to make the bot drive better?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 25, 2010, 01:10:28 AM
Ask Click. I don't know.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on April 25, 2010, 05:25:45 AM
How would I AI a full body popup?
Been there, done that. I just used popup.py.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on April 25, 2010, 06:39:52 AM
I tested it with Timber, works pretty well.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on April 29, 2010, 11:57:16 AM
(https://gametechmods.com/uploads/images/32652wpcts.PNG)
I AI'ed this with Omni but it drives backwards in KotH matches sometimes.
Also, is there a version of pinner with a spinning weapon allowed?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: somestrangeguy on April 29, 2010, 12:24:47 PM
Yes, in KotH matches robots do drive backwards just to be in the zone, so you need to build your KotH AI bots with that in mind.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on April 29, 2010, 01:00:11 PM
I've never seen other bots do that, anyway what about a (s)pinner.py?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: S.T.C. on April 29, 2010, 06:02:12 PM
I'd try to use that .py and see what happens.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on April 30, 2010, 12:50:06 AM
Wire the spinner to the forward drive, there's no spin in pinner.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 30, 2010, 12:52:48 AM
if you want it to keep spinning in a countout wire it to backwards also

if not leave it be and it wont spin while backing up
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 30, 2010, 01:39:20 AM
I am having issues with the py i made yesterday for my Trinity SnS

https://gametechmods.com/uploads/files/FBSTrinityInvertDir.rar (https://gametechmods.com/uploads/files/FBSTrinityInvertDir.rar)

AKA a mix between Poker and FBSInvertDir.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on April 30, 2010, 03:04:42 AM
explain the issues ?

I cant look at it right now as im about to duck off the work but can get back to you
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on April 30, 2010, 05:17:45 PM
What is the AI.py supposed to do?  ^^Yea, explain a bit, please.^^
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on April 30, 2010, 05:41:23 PM
FBSInvertDir with poker support. Like my recently showcased HW.

O wait i could nearly use Topknot.py for this !!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 01, 2010, 10:32:47 AM
Here's PinnerPlus.py, Pinner with added support for a spinning weapon:

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

class PinnerPlus(AI.SuperAI):
    "Pushes without backing up"
    name = "PinnerPlus"
    # Designed for true pushers, though does NOT back up repeatedly like Pusher.py does. This has a spin function too.
    # In-built average Throttle, Topspeed, Turn and Turnspeed values for easier AI-ing. Also invertible.
    # Brought to you by G.K.
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
       
        self.tactics.append(Tactics.Engage(self))
       
    self.max_Throttle = 130
    self.top_speed = 99
    self.bInvertible = True
    self.max_turn = 40
    self.max_turn_speed = 3
        self.spin_range = 40.0
       
        if 'range' in args:
            self.spin_range = args.get('range')       
       

    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("")
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        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)
       
AI.register(PinnerPlus)

https://gametechmods.com/uploads/files/PinnerPlus.zip (https://gametechmods.com/uploads/files/PinnerPlus.zip)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on May 01, 2010, 10:34:40 AM
print "Lost Component!"
Wazzat mean?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 01, 2010, 10:41:27 AM
Here's PinnerPlus.py, Pinner with added support for a spinning weapon:

Why are you even bothering... Omni works nearly the same way.

Plus pinners with spinning weapons (should be called SPinners, har har har) aren't even pinners, since when pinning they immobilize their spinners as well.

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 01, 2010, 10:42:00 AM
SM asked me to make it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 01, 2010, 10:43:08 AM
@S_M: python will not read that line since it has a # at the start so its just a note.

that whole section if for handling a change of tactic shoudl the robot loose its designated components (the weapon: numbers in the binding line)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on May 07, 2010, 07:56:23 PM
You know that Omni does the exact same thing as Pinner right?
 
Just use Omni and don't wire any controls and you've got yourself a Pinner.  Wire a spinner control and you've got yourself a PinnerPlus.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 08, 2010, 02:18:15 AM
Ah ok.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 08, 2010, 02:37:09 AM
You know that Omni does the exact same thing as Pinner right?
 
Just use Omni and don't wire any controls and you've got yourself a Pinner.  Wire a spinner control and you've got yourself a PinnerPlus.

Yes, i just made pinner mainly to simplify Omni, plus to be less demanding in bindings.

EDIT: Does anyone saw the error on FBSTrinityInvertDir?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 10, 2010, 04:26:22 PM
Code: [Select]
    list.append(("Red Dragon","Omni",{'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,12,13,14)}))

    # 32 - RAW
    list.append(("Cryoseism","Omni",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("LOL WUT","SpinupOmni",{'radius':1.2,'range':99,'spinuptime':5,'topspeed':99,'throttle':130,'turn':100,'turnspeed':1.8,'weapons':(19,20,21)}))
    list.append(("Krakatau","Omni",{'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("Steel Reign","Omni",{'invertible':True,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("Reindeer","Pinner",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
    list.append(("Army Of One","Omni",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))
does anyone see any problems with these bindings? I AI'ed them and now the game crashes :S
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 10, 2010, 06:26:03 PM
When does it crash; start up, selecting a team, or bot,....?

Right off, Badnik, I can't see anything obvious with those lines.
RAR and upload your whole AI directory, and I'll help you out.
 
I might suggest to you and all that when modding the game to save yourselves from any trouble:
    1. make a BU.
    2. change only one thing at a time, then test; this way you know what is wrong.
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 11, 2010, 03:19:17 AM
I don't see anything wrong as well...

And you don't need that many values with pinner really.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:20:15 PM
As Mad said, where does it crash?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 11, 2010, 03:30:46 PM
Crashes on startup.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:32:15 PM
Are alll the bot files named correctly? As in Bot0, Bot1 etc...?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 11, 2010, 03:34:01 PM
yep.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 11, 2010, 03:49:36 PM
its not the bindings if it crashes at start up
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:50:00 PM
It can be.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Jonzu95 on May 11, 2010, 03:51:05 PM
What about the Robot Name? Is it the same in the bot lab and in the bindings?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:52:17 PM
That won't cause crashes on startup.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 11, 2010, 03:52:34 PM
usually when its the bindings its when you select the bot
i think you should check the teams.txt
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 11, 2010, 03:53:43 PM
hey when you make bindings use RAI it works a lot

you can download it from RFSHQ.com or i can send it to you
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:54:59 PM
IMO, 80-90% of AI-related startup crashes are because of the bindings in some way or other.

And RAI isn't necessary.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 11, 2010, 03:56:06 PM

And RAI isn't necessary.

i know but its very useful
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 11, 2010, 03:57:22 PM
For some.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 11, 2010, 08:54:26 PM
Badnik, if you want it fixed pronto, then compress and link your AI directory.
If not then it's your call...

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on May 11, 2010, 08:58:11 PM
Mad... Have that pure fbs ai yet?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 11, 2010, 09:39:56 PM
Which one is that?... What does it do, Roboman?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: roboman2444 on May 11, 2010, 09:43:07 PM
A robot like a sns, but it will translate, or move, toward the desired location while it spins. Just alternating wheel power based on the angle of the robot based on the desired direction.
I could code one on a microcontolller, but not the weird ways of pythA2
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 11, 2010, 10:07:22 PM
For that application, the py Apanx wrote is the best, IMHO.
Here; (https://gametechmods.com/forums/Themes/Headline/images/icons/clip.gif) FBS.zip (https://gametechmods.com/forums/index.php?action=dlattach;topic=2191.0;attach=314)
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 12, 2010, 12:16:50 AM
What about the Robot Name? Is it the same in the bot lab and in the bindings?

that value is required on start up of a match when the game locates the bot file (the bindings can be in any order)

the connection between the teams text file or an actual mistake in python files itself usually crash upon load up as its when the game adds the files in

possible solutions...

does it have all the pre load stuff up the top of the bindings still ? it needs all of that to load correctly

have you tried other python files ? try the common ones like omni, etc and see if its not a python with an error inside (which can effect load up)

are the python's all in the AI folder ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 12, 2010, 05:19:52 AM
You also need to name the controls of your bot correctly. (No spaces before or after it)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 12, 2010, 01:49:11 PM
https://gametechmods.com/uploads/files/7867AI.rar (https://gametechmods.com/uploads/files/7867AI.rar)

Here's the AI, just the Bindings and .bot files I'm having trouble with cuz the whole AI folder is too big XD
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 12, 2010, 02:34:02 PM
DP
everything's fixed, I just put it on a different game and it worked!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 12, 2010, 04:30:52 PM
LOL sometimes that is all that it takes
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 13, 2010, 03:43:11 PM
Hey, guys, not stealing SD's idea or anything, but I'd like an AI that does this for a robot for the 128 bot tourney::
The idea is to ram, then start SnSing. Then when the countdown goes off, run away, ram again, and then SnS.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 13, 2010, 09:31:55 PM
well roll up your sleeves and get coding then  :mrgreen:

probably could do it with some ranges and whipperplus
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on May 13, 2010, 09:36:01 PM
Hey, guys, not stealing SD's idea or anything, but I'd like an AI that does this for a robot for the 128 bot tourney::
The idea is to ram, then start SnSing. Then when the countdown goes off, run away, ram again, and then SnS.
.
Closes thing to that is RamSnS  which Initially rams the opponent, then sit-and-spins continuously.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 13, 2010, 09:39:39 PM
or of course SnS AI and using the weapon numbers for the SnS weapon and when it breaks the robot will start ramming.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on May 13, 2010, 09:42:17 PM
I guess it depends if he wants it to SnS first or ram.
Also, I loled at the line in the Octane.py
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 13, 2010, 09:50:57 PM
which one ?

Nar made a joke in Octane.py and I made one in Octane2.py 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 14, 2010, 06:21:32 AM
I guess it depends if he wants it to SnS first or ram.

Obviously he wants it to ram first...

Anyways, this can be done with Whipper.py and any SnS AI that uses a smartzone if you do it right.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 14, 2010, 07:56:38 AM
Hey joe wich AI did you use for super sns in clash cubes 2 because i want to try it out
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 14, 2010, 09:01:37 AM
just FBS_1
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 14, 2010, 07:51:11 PM
where can i dl that
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 14, 2010, 09:42:46 PM
memory dont fail me now...

some where in the first few pages of this thread I think

or its in CCAI
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 15, 2010, 03:34:37 AM
some where in the first few pages of this thread I think

Yes.

It's in RAW 1 AI and NAR AI as well. If my memory does not fail as well, the first known bot to use it was Pinball.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 15, 2010, 10:25:21 AM
help!
i have an ai file from gk that doesn't work and i'm looking for someone to make it work. bindings line is:

    list.append(("Fuel","Omni",{'nose':math.pi,'range':99,'radius':1.0,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2,'weapons':(16,17,18)}))

(craaig, it's your bot)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 15, 2010, 10:29:00 AM
It looks correct to me.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 10:30:40 AM
it has 2 range values
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 15, 2010, 10:33:21 AM
it has 2 range values
Why, does it mean anything?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 10:35:27 AM
that would be the most reasonable suggestion why the game rejects it

it should be like this

Code: [Select]
list.append(("Fuel","Omni",{'nose':math.pi,'range':99,'radius':1.0,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2,'weapons':(16,17,18)}))
getting rid of the second 'range':99 value
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 15, 2010, 10:42:15 AM
ok.

Edit:Nope, still don't work.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 15, 2010, 10:54:40 AM
Do you have the 4 spaces in front of the line?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 15, 2010, 10:56:52 AM
i think so, like all the robot lines in bindings.py.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 11:12:54 AM
are you using python to edit these ???

Ctrl + X will tell you if you indentations are incorrect

does the robot have 18 components ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 15, 2010, 11:46:02 AM
Just put 'weapons':(1,) and don't bother about the number of components.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 11:59:46 AM
thats what I do.. but if there isnt a component number 18 that will also crash
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 15, 2010, 12:04:35 PM
I was talking to bubbles... and also, Iron Storm 5 works perfectly with these

Code: [Select]
    list.append(("Iron Storm 5","FBSInvertDir",{'invertible':True,'direction':-1,'spinspeed':22,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.6,'weapons':(666,1337,9001)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 12:10:50 PM
really ? thats odd... I had some binding line that crashed until I changed the number to 1... ah the wonders of the game
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 15, 2010, 02:35:43 PM
does the robot have 18 components ?

Yes, it actually has 21.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 15, 2010, 08:51:26 PM
did you try copy and pasting the one I posted and using it ? it should work as it matches all other omni lines in my Bindings

otherwise you have made a mistake elsewhere (like the robot name) does it have a space after the name or something ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 16, 2010, 02:17:14 AM
Tried it, but it didnt work :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 16, 2010, 02:55:44 AM
you have made a mistake elsewhere (like the robot name) does it have a space after the name or something ?

check the robots name
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 16, 2010, 02:11:50 PM
it is Fuel. Definately
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on May 16, 2010, 04:16:24 PM
Do you have the right parts, because fuel has parts that come with Nar AI 2.2
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 16, 2010, 06:47:55 PM
What Nose line should I use for this bot?
(https://gametechmods.com/uploads/images/29949screenshot_200.PNG)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 16, 2010, 07:01:22 PM
*looks at bot*

*shakes head in disbelief*

*goes to comment about how the bot fails*

*doesn't even bothers*

...math.pi*0.5...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 16, 2010, 07:04:51 PM
Thanks Nary.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 17, 2010, 01:25:30 AM
Do you have the right parts, because fuel has parts that come with Nar AI 2.2
Ya, i have the parts, but a bigger problem has sprung up.
I deleted the line in bindings, even copied a new bindings in (it was nar ai 2.2), deleted the team from the teams.txt, deleted the team folder with the bot in it, now it wont start up at all! i know this is the wrong place to post it, i will post in technical support now. but i suspect it it something to do with bindings... still, HELP!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 17, 2010, 04:28:18 AM
Do you have the right parts, because fuel has parts that come with Nar AI 2.2
Ya, i have the parts, but a bigger problem has sprung up.
I deleted the line in bindings, even copied a new bindings in (it was nar ai 2.2), deleted the team from the teams.txt, deleted the team folder with the bot in it, now it wont start up at all! i know this is the wrong place to post it, i will post in technical support now. but i suspect it it something to do with bindings... still, HELP!

my previous theory was correct then your meddling with the teams .txt or the AI folder in general is the source of your issues

do yourself a favor and copy your running RA2 for tournaments and overwrite the original AI
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 17, 2010, 01:41:21 PM
ok, i took a (VERY) wrong turn. i will do my self the favor. Too bad for me most of the robots in my game haven't been exported *Person in background says "OOOOOHHHHH, Gutted!"*.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: 090901 on May 17, 2010, 05:13:00 PM
You can still get your bots form the teams folder.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 19, 2010, 12:50:59 AM
Is there a version of OmniRam newer than the BBEANS AI one and if so, when can one procure it?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 19, 2010, 07:32:27 AM
Not sure which characteristics you're looking for but here's a version I wrote for someone's (Sage?) tourney bot that may be useful, 'OmniRam_EnergySaver'.  (Read the user-friendly instructions at the top of the py.)
 
https://gametechmods.com/uploads/files/OmniRam_EnergyMiser.rar (https://gametechmods.com/uploads/files/OmniRam_EnergyMiser.rar)
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 19, 2010, 11:48:29 AM
To stop Pwnator's bot (Killdozer II on the Bot Exchange, Stock HW) from twisting instead of ramming when AI'ed after the first charge.

I'll try out the AI.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 19, 2010, 09:21:38 PM
The AI looks pretty good Mad
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Viper89 on May 21, 2010, 04:46:02 PM
Question? Do pokers have to have certain smart zones for Tag Team? My buddy's Poker works  sometimes but other times if it gets turned into a wall it just stays their and pokes the wall even if their is another bot hitting it. I even tried trial runs in a stock arena to make sure it wasn't a custom arena issue. I'm running out of ideas and it's to risky to send are bots in becuase if his bots does that in a match It's going to be 1 V.S 2 odds not in my favor :frown: .
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 21, 2010, 07:47:41 PM
i never heard of that happening so far
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 21, 2010, 10:38:00 PM
Nope. Just make sure that your SZ isn't too big and too far from the extended position of the weapon rack.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Viper89 on May 22, 2010, 11:03:38 AM
Nope. Just make sure that your SZ isn't too big and too far from the extended position of the weapon rack.

Would changing my tactics file have anything to do with this weird behavior, because G.K said this problem didn't happen to him in his computer.  I'm using Click new tactics file that goes with his PokerPlus.py but I'm using the normal poker.py. Can someone post the original DSL tactics file cause I think the problem might lie in my tactics file :frown: .
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 22, 2010, 11:10:37 AM
PokerPlus is mine... but doesn't quite works as well as i wanted  :mad:
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 08:23:08 AM
I'm using PhiletBabe's A.I chart and I'm trying to use WhipperPlus.py for my SnS. Where do I put the smartzone?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 23, 2010, 08:24:42 AM
Use one of the big circular ones.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 08:25:13 AM
Ok, thanks.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 08:33:22 AM
I would recommend FBS_1 over Whipperplus myself
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 08:41:11 AM
Ok. What smartzones do I need for FBS_1?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 23, 2010, 08:43:11 AM
You don't.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 08:45:37 AM
Ok, thanks. (Again)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 08:48:37 AM
you need

an analog - Forward
an analog - LeftRight
an analog - Spin (the same as left/right) + any spin weapons you have

and the binding line looks like this

Code: [Select]
list.append(("Robot1","FBS_1",{ 'PreSpinEntrance':0, 'SpinDirection(1/-1)':1, 'ReMobilizeRoutineTime(10-60)':10, 'range':99, 'radius':0.1, 'topspeed':100, 'throttle':100, 'turn':60, 'turnspeed':2.5, 'weapons':(1,)}))
The robot will start spinning straight away unless...

Code: [Select]
'PreSpinEntrance':0
you put a value there.. that is how many seconds the robot will drive about in the match before spinning.. once it starts it will only stop if being counted out.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 23, 2010, 09:14:47 AM
Does anyone knows what is the SnS AI that supports Trinity function ? My Entropic Storm needs this to work correctly !
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 09:34:37 AM
would that be SnS with fire command ?

Im unsure of one in existence but easily makable
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 23, 2010, 09:35:29 AM
Yes, it would be that.

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 23, 2010, 09:38:07 AM
What AI does flying sheep use?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 23, 2010, 09:55:52 AM
Flyer.py but that's not what i want since my bot needs to spin quite fast to Trinity, and Flyer.py doesn't supports that.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 10:22:36 AM
Also, what would I use to A.I my vertical spinner? (It has a srimech as well.)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 10:35:27 AM
omni works fine

Spin Button
Srimech Button
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 23, 2010, 10:38:40 AM
Omni's srimech function doesn't works with VS (unless they have a burst motor self righter, and in that case it is really fail).

You might want to try Click's VertSpinner.py, but you'll need to wire your weapon controls on an analog.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 10:44:11 AM
oh  :embarr I just assumed it was burst srimech
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 23, 2010, 10:45:22 AM
It is burst srimech, and really only works for burst srimechs.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 11:05:46 AM
I should have been clearer :P

I assumed Gazea's robot utilized a burst srimech therefor a simple omni could make do.. but that would be the wrong thing as you pointed out if that isnt the case.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 23, 2010, 11:12:02 AM
It does have a burst srimech. It has two snapper 2's. So, should I use omni?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 11:17:55 AM
omnis just a great "base" py.. nothing technical, very simple to use and remember it all.. works perfectly for general spinners with burst srimechs or firing weapons
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 23, 2010, 03:15:32 PM
Controls for FBS_1 are:
                    self.Input("LeftRight", 0, 0)
                    self.Input("Ahead", 0, 100) # then Go.
                    self.Input("Spin", 0, 0)

Note that 'Forward' is not used....  Instead is 'Ahead'.
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 23, 2010, 08:18:43 PM
If you have an SnS and you want to replace a flipper can you do that? (probbably another n00b guestion)
in all the tutorials it says it must be the SAME type of bot
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on May 23, 2010, 08:49:13 PM
Yes, you just have to change the AI type from "Flipper" to "FBS_2" or whatever AI you want to use, and add any new parameters you might need (such as 'range').
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 23, 2010, 09:57:20 PM
Controls for FBS_1 are:
                    self.Input("LeftRight", 0, 0)
                    self.Input("Ahead", 0, 100) # then Go.
                    self.Input("Spin", 0, 0)

Note that 'Forward' is not used....  Instead is 'Ahead'.

Im sure I used forward before.. I know it says ahead in the python.... unless I edited mine :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 23, 2010, 11:54:32 PM
'Forward' will work due to the 'tactics.py' driving it.

'Ahead' is the command in the AI.py that controls it.

Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 24, 2010, 12:00:00 AM
figured it was an underlying thing like that

any difference with the 2 ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 25, 2010, 10:37:39 PM
i have a qustion. How would you add a team to the default 14 teams. i wanna make team 15 but every time i try my game crashes
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 26, 2010, 12:38:37 AM
i have a qustion. How would you add a team to the default 14 teams. i wanna make team 15 but every time i try my game crashes
Yes, but I have no brain at this hour for me... I'll let another show you, else I'll help you out shortly...
 
 
 
figured it was an underlying thing like that

any difference with the 2 ?
Yea, 'Forward' uses the tactics to drive, and may be fighting the spinning, and thus slowing it down at times...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 26, 2010, 12:39:37 AM
Nic, take us through the steps you used.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on May 26, 2010, 12:44:48 AM
Thanks, GK...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 26, 2010, 12:55:17 AM
Yea, 'Forward' uses the tactics to drive, and may be fighting the spinning, and thus slowing it down at times...

awesome... I never knew it held off ahead.. thanks Mad

@Nic: a tutorial is coming in a min :D
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 26, 2010, 01:19:44 AM
ok one is up in this forum section but still follow through with GK (post above) as its always good to figure out what you did wrong
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 26, 2010, 06:57:03 PM
ok i tried it and it worked problem solved
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 29, 2010, 10:16:44 AM
I tried a.i-ing my VS using omni.py and it crashes my game when I try to go into battle with it. The team.txt, the bindings and the controls look fine. Any help?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 29, 2010, 10:25:13 AM
Go through the steps you took.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 29, 2010, 10:30:47 AM
I named the controls.
Then I moved the bot into "Team 35".
Next, I updated the teams.txt by putting a number 1 in the correct place.
After that I did the bindings using omni.py.
Finally, I went into the game and it crashed.

I've sent everything to you so that you can check it over. :)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 29, 2010, 10:37:06 AM
You need a comma after the 6 in the weapons entry.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 29, 2010, 10:42:42 AM
Are you sure the bot's name in the bot file fits exactly the bot's name in the bindings file (beware spaces) and the controls are correctly named ?


If it still doesn't works, then pray to the higher powers of RA2 it would work one day. When I AIed Ounce's ICM rebuild, it didn't work despite me having correctly wrote bindings, name, controls and EVERYTHING...

And it worked two days after being AIed.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 29, 2010, 10:43:58 AM
@Naryar - Wow, that's weird.

@G.K. - Ok, thanks. I'll do it and then send the finished bindings to you. :)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 29, 2010, 10:44:14 AM
Also Gazea, you need to remove the 'nose:math.pi', as well.

And I've done it, so you don't need to send me it.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 29, 2010, 10:48:34 AM
I noticed that and I've done it. Do I need to fine tune it or is it fine as it is?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 29, 2010, 10:49:04 AM
Feel free to fine tune it, or I can for you.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 29, 2010, 02:00:16 PM
You can fine tune it if you want. It'll probably be better that way. :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 31, 2010, 11:01:09 AM
J'ai un petit issue avec a couple of rammers.

I was AI'ing them for BTTB, but they both have the same issue. After the first charge, instead of continuing to seek out and ram opponents, they just swish from side to side, only actively ramming the opponent if they make contact. I have tried Omniram.py and Rammer.py, and 2 versions of tactics.py, but all produce the same effect at different levels.

Does anybody know what is going on?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 31, 2010, 11:21:19 AM
whats the turn values like ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 31, 2010, 11:24:15 AM
Well Pwn gave me one and I borrowed one from an Inf AI rammer...

Code: [Select]
    list.append(("Killdozer II","OmniRam",{'invertible':True,'topspeed':130,'throttle':130,'turnspeed':30,'turn':65,'radius':0.3,'range':99,'weapons':(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26)}))


    list.append(("Rusty Seringe","OmniRam",{'invertible':True,'topspeed':130,'throttle':130,'turnspeed':30,'turn':65,'radius':0.3,'range':99}))

So both 65.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 31, 2010, 11:26:19 AM
When my rammer was swishing from side to side the top speed was too high.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 31, 2010, 11:27:43 AM
An issue is the 'turnspeed':30 its massively overkill. should be about 2.5

the robot is trying to correct itself by straightening up but keeps over shooting as it turns to fast
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 31, 2010, 11:28:41 AM
Ah ok, I'll try that.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 31, 2010, 11:29:23 AM
Ok. If that doesn't work, but it probably will work, then try my suggestion. :)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on May 31, 2010, 11:34:54 AM
It did work! Thanks a bunch Joe.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on May 31, 2010, 11:36:09 AM
I thought it would. Joe's help/advice always works.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 31, 2010, 11:36:34 AM
your welcome

-----------------

30 is a turnspeed that should pretty much never be used

the default is 2.5 so always start there then tweak it out...

if the robot turns to slow bump it up to 3 or 4 (depending on the strength of the drive) but no more then 5 IMO

if it turns to fast like what you were experiencing reduce the number to 2 or 1.5
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on May 31, 2010, 12:07:54 PM
30 is a decent value for 'turn', not 'turnspeed'.

My favorite is 50 turn, 3.5 turnspeed.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Bubbleman on May 31, 2010, 01:17:21 PM
naryar, may i ask is the 2.3b a patch for the beta or is it a patch for 2.2?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on May 31, 2010, 03:32:42 PM
It's for the beta.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on May 31, 2010, 09:32:37 PM
Need help. I AIed some bot, and every time I try to fight it, the game crashes. Here's the bindings

Code: [Select]
    list.append(("AW-Ice Drop","Omni",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(17)}))
There's no extra spaces in the bot's name too.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 31, 2010, 09:33:42 PM
17 needs a comma after that. So it should be '17,'
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on May 31, 2010, 09:49:27 PM
Still doesn't work.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 31, 2010, 09:55:09 PM
Was the smartzone spelt correctly?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on May 31, 2010, 10:03:47 PM
Yes. It is "weapon" for Omni, right?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 31, 2010, 10:06:09 PM
Yeah. Maybe it's the Teams.txt.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on May 31, 2010, 10:17:05 PM
what about the controls
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on May 31, 2010, 10:18:58 PM
I have his bot, and those are fine.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on May 31, 2010, 10:55:10 PM
I just broke it down and see nothing wrong with it

the problem lies elsewhere... export your bot file and dont change the name then copy and paste the file name to be sure its right

otherwise it could be in the py file or teams text.. when does the game crash ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on June 01, 2010, 08:37:33 PM
Fixed it. I just took a random team's coding and pasted it over the coding of the team that my bot was on in the .txt.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 02, 2010, 07:25:18 AM
Whats up here?:
(https://gametechmods.com/uploads/images/41107PythonSheck.PNG)
"Invalid Syntax"
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 02, 2010, 07:27:13 AM
Show the whole lines.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 02, 2010, 07:28:34 AM
It's just highlighting the word list
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 02, 2010, 07:29:04 AM
Show the whole lines.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 02, 2010, 07:32:28 AM
How will that help?
Code: [Select]
    #55 - MW BBEANS
    list.append(("Ecam","Rammer",{'radius':1,'topspeed':100,'throttle':100,'turn':50,'turnspeed':1,'weapons':(7,9)}))
    list.append(("Encroaching Darkness","Popup",{'radius':5,'topspeed':40,'throttle':40,'turn':50,'turnspeed':1.7,'weapons':(18,19,20,21,22)})

    #56 - MW BBEANS
    list.append(("Adult's Work 2","Omni",{'invertible':True,'range':99,'radius':1,'topspeed':99,'throttle':130,'turn':100,'turnspeed':3.5,'weapons':(16,17,18,19,20,21)}))
    list.append(("Bringer of bad news","Poker",{'topspeed':100,'radius':1,'throttle':130,'range':99,'turn':100,'turnspeed':2.5,'weapons':(8,12)}))
    list.append(("El Torado","OmniRam",{'range':99,'radius':1,'topspeed':99,'throttle':130,'turn':60,'turnspeed':3.5,'weapons':(4,5)}))

    #57 - MW BBEANS
    list.append(("El Torado 2","OmniRam",{'range':99,'radius':1,'topspeed':99,'throttle':130,'turn':60,'turnspeed':3.5,'weapons':(7,8)}))
    list.append(("Adult's Work","Omni",{'invertible':True,'range':99,'radius':1,'topspeed':99,'throttle':130,'turn':100,'turnspeed':3.5,'weapons':(12,13,14,15,16,17)}))
    list.append(("Zaphod Stock","Omni",{'radius':1.2,'topspeed':99,'throttle':130,'range':40,'turn':60,'turnspeed':4.5,'weapons':(17,18,19,20,21,22,25,26)}))
BTW I have just cleaned it up a bit.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 02, 2010, 07:35:50 AM
You are missing a bracket at the end of Encroaching Darkness' AI Line.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 02, 2010, 07:36:49 AM
OK, thanks.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on June 02, 2010, 09:54:54 AM
did it work?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 02, 2010, 10:09:19 AM
Yes
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: nicsan2009 on June 02, 2010, 10:10:56 AM
ok then next queston
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on June 05, 2010, 07:46:26 AM
Thyrus and I are teaming up for Tag Team Tornado and I've A.I-ed my bot but when I A.I his, it won't fire. It's a flipper and I've named the smartzone "flip" (according to the A.I chart) and I've named the controls right.

Help?

P.S - I've just realised that I ask for lots of help. :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 05, 2010, 07:48:35 AM
Are they wired right ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on June 05, 2010, 07:49:45 AM
Yes. When I go into battle and I control the bot I can fire them fine.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 05, 2010, 07:54:07 AM
Post a screenshot of the controls.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Gazea2 on June 05, 2010, 08:02:45 AM
I just realised that I named the control that controls the flippers "Fire" instead of "Flip". *Facepalm*
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 11, 2010, 03:23:04 AM
Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics

class PopupMultiZone(AI.SuperAI):
    "Like Popup strategy, up to 4 zones and the classical Fire/Weapon/Srimech"
    name = "PopupMultiZone"
    # up to 4 zones named weapon1, weapon2, weapon3 and weapon4
    # and the associated triggers : Fire1, Fire2, fire3, Fire4
    # weaponX is associated with FireX ie : ennemy in customzone weapon3 -> do the action associated with Fire3
    # You may also change the default tactics (engage) by specify in the bindings.py 'tactic': XXX
    # with XXX = "Charge", "Engage", "Shove", "Ram"
    # Ripped off Popup.py and OmniMultiZone.py by Naryar
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.trigger2 = ["Srimech"]
        self.botinzone1 = 0
        self.compinzone1 = 0
        self.botinzone2 = 0
        self.compinzone2 = 0
        self.botinzone3 = 0
        self.compinzone3 = 0
        self.botinzone4 = 0
        self.compinzone4 = 0
        self.comptimer1 = 0
        self.comptimer2 = 0
        self.comptimer3 = 0
        self.comptimer4 = 0
        self.NoChassisTime = 8
       
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4
       
        self.triggerIterator = iter(self.triggers)

        if 'tactic' in args:
            self.theTactic = args['tactic']
            if   self.theTactic  == "Charge" : self.tactics.append(Tactics.Charge(self))
            elif self.theTactic  == "Ram" : self.tactics.append(Tactics.Ram(self))
            elif self.theTactic  == "Shove" : self.tactics.append(Tactics.Shove(self))             
            elif self.theTactic  == "Engage" : self.tactics.append(Tactics.Engage(self))
            else: self.tactics.append(Tactics.Engage(self))
        else: 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("weapon1", 1)
            self.RegisterSmartZone("weapon2", 2)
            self.RegisterSmartZone("weapon3", 3)
            self.RegisterSmartZone("weapon4", 4)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon

        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
       
        # if a component is in the first smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone1 == 1 and self.botinzone1 == 0:
            self.comptimer1 += 1
           
        if self.botinzone1 == 1:
            self.comptimer1 = 0
           
        if self.weapons and (self.botinzone1 == 1 or (self.comptimer1 >= self.NoChassisTime and self.compinzone1 == 1)):
            for trigger in self.triggers1: self.Input("Fire1", 0, 1)
           
        # if a component is in the second smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone2 == 1 and self.botinzone2 == 0:
            self.comptimer2 += 1
           
        if self.botinzone2 == 1:
            self.comptimer2 = 0
           
        if self.weapons and (self.botinzone2 == 1 or (self.comptimer2 >= self.NoChassisTime and self.compinzone2 == 1)):
            for trigger in self.triggers1: self.Input("Fire2", 0, 1)
           
        # if a component is in the third smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone3 == 1 and self.botinzone3 == 0:
            self.comptimer3 += 1
           
        if self.botinzone3 == 1:
            self.comptimer3 = 0
           
        if self.weapons and (self.botinzone3 == 1 or (self.comptimer3 >= self.NoChassisTime and self.compinzone3 == 1)):
            for trigger in self.triggers1: self.Input("Fire3", 0, 1)
           
        # if a component is in the fourth smart zone but not the chassis, wait to find chassis before firing weapons
        if self.compinzone4 == 1 and self.botinzone4 == 0:
            self.comptimer4 += 1
           
        if self.botinzone4 == 1:
            self.comptimer4 = 0
           
        if self.weapons and (self.botinzone4 == 1 or (self.comptimer4 >= self.NoChassisTime and self.compinzone4 == 1)):
            for trigger in self.triggers1: self.Input("Fire4", 0, 1)
                       
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn

           
        return AI.SuperAI.Tick(self)

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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)

    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone1 = 1
                    if chassis:
                        self.botinzone1 = 1
                if direction == -1:
                    self.compinzone1 = 0
                    if chassis:
                        self.botinzone1 = 0
        elif id == 2 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone2 = 1
                    if chassis:
                        self.botinzone2 = 1
                if direction == -1:
                    self.compinzone2 = 0
                    if chassis:
                        self.botinzone2 = 0
        elif id == 3 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone3 = 1
                    if chassis:
                        self.botinzone3 = 1
                if direction == -1:
                    self.compinzone3 = 0
                    if chassis:
                        self.botinzone3 = 0
        elif id == 4 and self.weapons:
            if robot > 0:
                if direction == 1:
                    self.compinzone4 = 1
                    if chassis:
                        self.botinzone4 = 1
                if direction == -1:
                    self.compinzone4 = 0
                    if chassis:
                        self.botinzone4 = 0
 
        return True
       
AI.register(PopupMultiZone)

Would like some feedback on that one... did i did it right ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 11, 2010, 03:32:28 AM
very nice work...

just a point of interest you may or may not want to know...

Madiaba previously made a python for up to 7 "fire" buttons, 7 SZ's, Srimech and can also handle combo firing of controls with other SZ's also

I used a slightly tweaked verson for RY3NO in RAW 2 since that had 4 SZ's and a Srimech

all it would lack is the popup's chassis finding code piece...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Reier on June 11, 2010, 03:14:27 PM
did i did it right ?


XD
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Clickbeetle on June 13, 2010, 11:32:38 PM
Would like some feedback on that one... did i did it right ?


Well does it work?  If so, yes. :P


I don't see any obvious problems with it.  It should work.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 22, 2010, 06:43:55 PM
Hey, just wondering:

Is there an AI that once a robot is flipped over and there is an 'invertible':False line in the bindings it drives in reverse until reverted? And if not, could someone make it? I'd like it so my latest AW can self-right.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Virus Bomb on June 22, 2010, 07:52:33 PM
use VertSpinner.py?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 22, 2010, 09:18:12 PM
No, it needs to use the...

OMG I JUST GOT IT!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 22, 2010, 10:12:41 PM
I'd like it so my latest AW can self-right.

so you need it to reverse to self right correctly ?

what you need is BountyHunter.py it handles sremech and reverse driving
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 22, 2010, 11:29:26 PM
Does it handle a spinning weapon?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 22, 2010, 11:55:15 PM
nope only Fire, Srimech, DriveBack, LeftRight and Forward
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Pwnator on June 23, 2010, 02:30:32 AM
The Inglourious Basterd uses BountyHunter. Just place a huge-ass SZ around your bot, and rename 'Spin' to 'Fire'.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 23, 2010, 01:09:23 PM
I haz an idea on how to self right it using VertSpinner.

You have to wire the spinner to the weapon analog and then on the other part of the analog instead of wiring the weapon to spin n reverse you just wire the drive in reverse! I'M A GENIUS!
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 23, 2010, 07:30:30 PM
or you could just add a small change to a few lines in omni from memory :P
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 25, 2010, 10:26:31 AM
Any .py to convert to a crawler if the wheels fall off?
I want to AI this:
(https://gametechmods.com/uploads/images/13291S=FTW.PNG)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 25, 2010, 10:31:22 AM
I win the wildcard :P

and I don't know about the PY. Maybe ask Mad?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 25, 2010, 10:37:21 AM
could be done using the weapons attribute of the bindings and some python tweaking / rewriting
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 25, 2010, 10:45:22 AM
*Asks politely whether anyone has time to do this*
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 25, 2010, 11:23:11 AM
What else?
Paypal so people can give me monies when I do stuff for them  :gawe:

for Thyrus's tourney ? if I have the time I will do it when I do my AI for said tournament

but I will need the bot file
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 25, 2010, 07:09:33 PM
Any .py to convert to a crawler if the wheels fall off?
I want to AI this:
(https://gametechmods.com/uploads/images/13291S=FTW.PNG)
Thanks, Joe...
SM, just for curiosity's sake, 'convert' to what?
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on June 25, 2010, 08:36:15 PM

Any .py to convert to a crawler if the wheels fall off?
I want to AI this:
*picture*

oh hai mammoth

so when the wheels fall off you want the two different weapon motors to spin different ways, making it bumble-bee like in it's attack?

 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 25, 2010, 11:09:48 PM
I assumed to make the weapon motors spin counter directions making it an SnS...

full movement would be worth the time as it needs something to push off against which will probably be destroyed soon after the wheels
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 26, 2010, 05:04:00 AM
What is the 'math.pi' value of a bot who's Forward Heading has been rotated one 'bit' more than 180 degrees?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 05:55:18 AM
ummm rebuild LOL (honestly I keep track of nose positions for easy AI when building)

you have to start working with small numbers (I cannot recall how many forward points there is)

math.pi*0.25 or -math.pi*0.25 I think... its really a trial and error thing
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 26, 2010, 06:14:44 AM
Did you even got trigonometry lessons joey ? It's math.pi*11/10
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Doomkiller on June 26, 2010, 06:16:18 AM
Did you even got trigonometry lessons joey ? It's math.pi*11/10

Did you even 'get' english lesson Naryar?  :p
 
only teasing you
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 26, 2010, 06:20:26 AM
Did you even got trigonometry lessons joey ? It's math.pi*11/10

Did you even 'get' english lessons Naryar?  :p
 
only teasing you

Not as much as you native speakers :P

*tries to remember not to make that same mistake again*
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 07:35:38 AM
Did you even got trigonometry lessons joey ? It's math.pi*11/10

I was on my way out and was thinking about something else to do with AI

anyway one more radial then 180 degrees should be (providing GK is accurate with what he wrote)

7pi / 6

so math.pi*7/6
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 26, 2010, 07:38:52 AM
Well I failed quite miserably there lol. I worked out that it was math.pi*0.55. Is there a picture showing all of these?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 07:41:09 AM
(http://library.thinkquest.org/20991/media/alg2_radians.gif)

math.pi*2 is the default heading when you dont change it.. so as I said if you provided the correct details with (just past 180)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 26, 2010, 08:11:03 AM
Hehe, you guys' interaction is funny. ;)   And your help is greatly appreciated, thanks.
 
Anyway, here is the work done GK,.. (though it's good to understand the math/logic).
How to use:
1. Find out where your bot is without any nose bias.
2. Then use this chart to turn it to face forward, NP.
 
 
Code: [Select]
    # nose is "front" of bot-
        #Nose paradigm: All 360 rotational degrees for "math.pi" are represented by the factor '2'.
            #thus:  '2'=360degrees,   '1'=180degrees,   '0.5'=90degrees,   '0.25'=45degrees.
        #The direction of change(CW/CCW)is determined by the "-" or "+" before the statement.
            #thus: '+' causes rotation CCW,  '-' causes rotation CW.
        #Format examples:
            # " 'nose':math.pi*0.25 "  will rotate the bot 45degrees/CCW.
            # " 'nose':-math.pi*0.25 " will rotate the bot 45degrees/CW.
            # " 'nose':math.pi*0.5 "   will rotate the bot 90degrees/CCW.
            # " 'nose':-math.pi*0.5 "  will rotate the bot 90degrees/CW.
            # " 'nose':math.pi*0.75 "  will rotate the bot 135degrees/CCW.
            # " 'nose':-math.pi*0.75 " will rotate the bot 135degrees/CW.
            # (Make sure there is a comma(,)after the the value # (to separate it from the next characteristic and its value).
            #(-----notes-----)
                # Note1:  "math.pi"   AND   'nose':math.pi*1.0 "   AND  " 'nose': -math.pi*1.0 "   will rotate the bot 180 degrees.
                    #   (The first two are the same, and the last two just rotate different directions to get 180 degrees.}
                    #   Thus there is no real reason to have a factor greater than '1',
                    #   since after that you just move into the other half of the circle covered by the other '+' or '-' sign.
                # Note2: "math.pi*0" or "math.pi*2" = the same as no new heading.

You might copy this to the top of your Bindings.py for easy reference.
 
(This was posted earlier in this thread)
 
 
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 26, 2010, 08:15:00 AM
I'm helping Thyrus AI some SnS'es for his tourney, but one keeps alternating between spinning CW and CCW for ages, before it eventually spins in one direction.

Here's the AI line:

Code: [Select]
    list.append(("Scarlet Transmission","FBS_1",{'invertible':True,'SpinDirection(1/-1)':1,'ReMobilizeRoutineTime(10-60)':60,'PreSpinEntrance':20,'range':30,'radius':0.1, 'topspeed':100, 'throttle':130, 'turn':60, 'turnspeed':3,'weapons':(0,)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 26, 2010, 08:22:52 AM
GK, lower the
         'ReMobilizeRoutineTime(10-60)':60 
to 20 or so...
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on June 26, 2010, 08:23:51 AM
Will do.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 08:31:43 AM
also drop the 'PreSpinEntrance':20 value right down unless you want it to drive about like normal at the match start for 20 tick (I think its ticks?)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Madiaba on June 26, 2010, 08:34:42 AM
It is....
 
Just to clarify 'PreSpinEntrance' use: It determines how far you want your bot to enter the arena before spinning up. Some like to their bot to 'ram' the opponent before spinning up (just play around as Joe suggested).
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 08:44:12 AM
if only I knew how to use it when I did CC2 :P could have avoided those long no contact SnS matches in the RW arena.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on June 26, 2010, 09:05:04 AM
What bindings line should I put in to make a SnS bot spin the other way?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on June 26, 2010, 09:06:31 AM
umm could you be more specific ? which python file ?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Naryar on June 26, 2010, 09:11:04 AM
Badnik if you read the py's you can see that easily...

Or just invert the spinning command's wiring.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on June 27, 2010, 10:42:06 AM
With my AI, I require some sort of movement once the wheels fall off. The first DSL bar rarely falls off.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on July 04, 2010, 03:47:23 PM
Is
Code: [Select]
'tactic':Ram the right thing to put in the binding line to change tactics?
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on July 04, 2010, 04:12:57 PM
pi = 180 degrees

wooo trig.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on July 04, 2010, 08:44:33 PM
old news Sage :P

@GK: at what point do you wish to add that? there is already countless ramming pythons
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: G.K. on July 05, 2010, 12:37:48 AM
I don't necessarily wan to add it, I'm just asking if that's the right way to change tactics in the bindings with a .py that supports changing tactics.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on July 05, 2010, 03:53:03 AM
yes if its put in the correct place with the correct supporting code
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Badnik96 on July 18, 2010, 07:05:59 PM
What would the nose line for this be?
(https://gametechmods.com/uploads/images/34322heading.PNG)

Thanks.
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Sage on July 19, 2010, 01:10:14 AM
pi/2 i believe... or -pi/2
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: ianh05 on July 20, 2010, 06:00:40 AM
for FBS_2 how do i get the robot to spin the opposite way when inverted? here are my current bindings:

Code: [Select]
    list.append(("AW - Thorny Devil","FBS_2",{'fbs_range':15,'right': "1",'invertible':True,'nose':math.pi,'radius':0.2,'range':99,'topspeed':99,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(1)}))
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: Squirrel_Monkey on July 20, 2010, 07:57:12 AM
Use FBSInvertDir.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: ianh05 on July 20, 2010, 08:04:56 AM
damn, I was hoping there would be a way to make it work while inverted so I wouldn't have to change the AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on July 20, 2010, 08:23:40 AM
I think you have to edit the python itself to do it from memory

I would use FBSinvert drive with a high spinspeed value to get a sit and spin strategy with inverted direction
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: NFX on July 20, 2010, 08:58:16 AM
Badnik, I think it would be 3pi/2. 360 degrees equates to 2pi, so 270 (Which I think yours is) degrees would be one and a half pi, or 3pi/2. ;)
Title: Re: AI-ing (.py files, coding, R+D, and help)
Post by: JoeBlo on July 20, 2010, 09:07:44 AM
I posted this a while ago...

(http://library.thinkquest.org/20991/media/alg2_radians.gif)

math.pi*2 is the default heading when you dont change it.. so as I said if you provided the correct details with (just past 180)

turn your head to the side, 0 / 360 point is the top of the grid when making a chassis (I will put this into the form of pic tutorial sometime)

there is more simplistic expressions but cant remember the exact one
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on July 20, 2010, 12:57:09 PM
Would it be possible for a medic Ai? A bot with the medic Ai would follow its tag team partner and slowly heal it but doesnt heal itself.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 20, 2010, 01:23:25 PM
Probably.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on July 20, 2010, 06:41:39 PM
Would it be possible for a medic Ai? A bot with the medic Ai would follow its tag team partner and slowly heal it but doesnt heal itself.
Yes. It would require roughly three things:
1. A way of determining which bot needs to be followed by the medic.
2. A negative value in plus.damage(BotID, Amount, (0,0,0)) to heal the Ally
3. Something to stop it from constantly healing the bot (it would end up with more than 100% Health, otherwise)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 20, 2010, 07:13:57 PM
Here are the tools:
plus.getHealth(bot#, ComponentID)
plus.getHitpoints(bot#, ComponentID)

Now go create.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on July 20, 2010, 07:25:44 PM
:D Apanx!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Somebody on July 22, 2010, 01:45:25 PM
How can I AI something with FBS.py to spin. I'm trying to AI a shell spinner for ELBITE. I wired the weapon to the drive so whenever the drive is running, the weapon SHOULD be going with it. The bot moves under AI but the weapon doesn't spin. Halp?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on July 22, 2010, 01:48:17 PM
use FBSPlus.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Somebody on July 22, 2010, 02:32:38 PM
Do I have to wire anything else for that because the shell still doesn't spin.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 22, 2010, 02:38:01 PM
The Sheck should have its own Spin Button.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Somebody on July 22, 2010, 06:29:31 PM
It works thanks guys!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on July 22, 2010, 09:47:26 PM
why would you be using FBSPlus.py for a shell spinner ?

unless its a SnS/ Hybrid the chassis will keep spinning around on the LeftRight control ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 23, 2010, 01:40:22 AM
Minifridge 4 uses FBSPlus so it can move.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on July 23, 2010, 02:54:12 AM
Whats wrong with these bindings:

    list.append(("Grappler","Omni",
{'invertible':True,'nose':math.pi,'radius':0.1,'topspeed':100,'throttle
':130,'turn':60,'turnspeed':2,'weapons':(39,42)}))

When I try to start a match my game has a 'runtime error'
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Pwnator on July 23, 2010, 02:57:08 AM
Are you sure it has at least 42 components?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on July 23, 2010, 03:00:33 AM
I don't know, but when it had the same bindings as Big Metal Friend it worked, its only when I edited the nose direction thingy that it crashed. It used to be 'nose':math.pi*2, but the bot faced the wrong way so I changed it
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on July 23, 2010, 11:34:03 AM
any random spaces in the bot's name?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on July 23, 2010, 01:25:31 PM
Nope, like I say, it worked before I changed the nose direction, it just didn't face the right way
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Somebody on July 23, 2010, 04:36:33 PM
Consult Philetbabe's AI Chart. Don't have a link on me but it has a section on Nose.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on July 24, 2010, 12:53:25 PM
Thats what I used
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: martymidget on July 24, 2010, 03:39:45 PM
What is so horribly wrong with these bindings?
Code: [Select]
# 35 - The Pandorica "The Pandorica will open, and silence will fall."
    list.append(("Pacey Macey","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))
    list.append(("Iron Filings","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))
    list.append(("Mouldy Cheese 2","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))
    list.append(("Scorcher VIII","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))
    list.append(("The guy with the ballast","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))
    list.append(("A VS :O","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))

Thanks XD
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Somebody on July 24, 2010, 05:11:26 PM
Make sure the bot names are exact.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 14, 2010, 12:25:32 PM
I tried to improve Joey's THZ.py, notably by adding popup code and something that retracts the arm to backwards position when no bot is into the smartzone (that Frenzy.py critically misses)

But did it wrong (no surprise here):
Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics

class THZPlus(AI.SuperAI):
    "Frenzy strategy + FBS immobility management. Also backs up weapon when not in use and uses NoChassisTime variable like Popup.py"
#Original Frenzy.py improved by JoeBlo, re-improved by Naryar
    name = "THZPlus"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "whipzone"
               
        self.tactics.append(Tactics.Engage(self))
       
        self.whipTimer = 0
        self.whipDir = 1
        self.whipDirCount = 4
        self.botinzone = 0
        self.compinzone = 0
        self.comptimer = 0
        self.NoChassisTime = 8
self.canFire = 0
        self.ImmobileCounter = 0
        self.ThisAI_bImmobile = 0
        self.BU_ImmobileTimer_A = 0       
        self.BU_ImmobileTimer_B = 0
        self.ReMobilizeRoutineTime = 40
        self.ThisAIBot_XFactorA = 0
        self.ThisAIBot_ZFactorA = 0
        self.ThisAIBot_XFactorB = 0
        self.ThisAIBot_ZFactorB = 0
       
        self.whipFunction = self.WhipBackAndForth
       
        if 'zone' in args: self.zone = args['zone']
       
        if 'whip' in args:
            if args['whip'] !=  "around": self.whipFunction = self.WhipBackAndForth
        if 'NoChassisTime' in args: self.NoChassisTime = args.get('NoChassisTime') * 4
       
    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(self.zone, 1)
        else:
            # get rid of reference to self
            self.whipFunction = None
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon
        targets = []
       
        if self.weapons:
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
        if self.compinzone == 1 and self.botinzone == 0:
            self.comptimer += 1
           
        if self.botinzone == 1:
            self.comptimer = 0
           
        if self.weapons and (self.botinzone == 1 or (self.comptimer >= self.NoChassisTime and self.compinzone == 1)):
            canFire = 1
else:
    canFire = 0


        bReturn = AI.SuperAI.Tick(self)
    # call this now so it takes place after other driving commands
        if self.whipFunction and self.ThisAI_bImmobile == 0: self.whipFunction(len(targets) > 0)

        if self.ThisAI_bImmobile == 1: # If Immobility is on:  -------------------------------------
            self.ImmobileCounter += 1  # Then start counting....
           
            if self.ImmobileCounter >= self.ReMobilizeRoutineTime*0.2:   # go backward for a designated time.   
                self.Throttle(100)
                self.Input("LeftRight", 0, 0)
                self.Input("Forward", 0, -100)
           
            if self.ImmobileCounter >= self.ReMobilizeRoutineTime*0.6:  # go forward for a designated time.   
                self.Input("LeftRight", 0, 0)
                self.Throttle(100)
                self.Input("Forward", 0, 100)

            if self.ImmobileCounter >= self.ReMobilizeRoutineTime:  # Reset everything:   
                self.ThisAI_bImmobile = 0 # default Reset (if timer goes too long).
                self.ImmobileCounter = 1
        else:
            self.ThisAI_bImmobile = 0
            self.ImmobileCounter = 0     



        # BackUp Immobile routine (continually running).... calculate difference of position between 2 calls
        self.BU_ImmobileTimer_A +=1       
        if self.BU_ImmobileTimer_A >= 1:       
            self.ThisAIBot_XFactorA =  plus.getLocation(self.GetID())[0] #
            self.ThisAIBot_ZFactorA =  plus.getLocation(self.GetID())[2]
        if self.BU_ImmobileTimer_A == 16:       
            self.ThisAIBot_XFactorB =  plus.getLocation(self.GetID())[0]
            self.ThisAIBot_ZFactorB =  plus.getLocation(self.GetID())[2]
            self.BU_ImmobileTimer_A = 0 # Reset.       

        if   self.ThisAIBot_XFactorA > self.ThisAIBot_XFactorB - .07 and   self.ThisAIBot_XFactorA < self.ThisAIBot_XFactorB + .07 and    self.ThisAIBot_ZFactorA > self.ThisAIBot_ZFactorB - .07 and   self.ThisAIBot_ZFactorA < self.ThisAIBot_ZFactorB + .07:
            self.BU_ImmobileTimer_B +=1       
            if self.BU_ImmobileTimer_B ==50:       
                self.ThisAI_bImmobile = 1
                self.BU_ImmobileTimer_B = 0
        else:
            self.BU_ImmobileTimer_B = 0 # Reset
       
        return bReturn
       
    def InvertHandler(self):
        # fire weapon once per second (until we're upright!)
        while 1:
            if self.whipDir > 0:
                self.Input("Hammer", 0, -1000)
            else:
                self.Input("Hammer", 0, 1000)

            self.whipDirCount -= 1
            if self.whipDirCount < 0:
                self.whipDirCount = 4
                self.whipDir = -self.whipDir
           
            self.whipTimer -= 1
           
            for i in range(0, 8):
                yield 0

    def WhipBackAndForth(self, bTarget):
        if bTarget and canFire = 1: self.whipTimer = 8
       
        if self.whipTimer > 0:
            # Whip back and forth!
            if self.whipDir > 0:
                self.Input("Hammer", 0, -100)
            else:
                self.Input("Hammer", 0, 100)
            self.Throttle(0)
           
            self.whipDirCount -= 1
            if self.whipDirCount < 0:
                self.whipDirCount = 4
                self.whipDir = -self.whipDir
           
            self.whipTimer -= 1

if self.whipTimer = 0:
            self.Input("Hammer", 0, -100)

    def WhipAround(self, bTarget):
        if bTarget: self.whipTimer = 4
        elif self.whipTimer == 0: self.whipDir = -self.whipDir
       
        if self.whipTimer > 0:
            # Whip around!
            if self.whipDir > 0: self.Turn(0)
            else: self.Turn(0)
            self.Throttle(0)
           
            self.whipTimer -= 1
           
    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)

    def ImmobilityWarning(self, id, on): # keep track of our own immobility warning
        if on and  id == 0 or id == 1 or id == 2 or id == 3:
            if  id == self.GetID():               
                self.ThisAI_bImmobile = 1

        if self.ImmobileCounter == 0:  # ID protector(Keeps other bots from changing "self.ThisAI_bImmobile = 1", until it runs its course of 'freeing' this AI.
            if not id == self.GetID():
                self.ThisAI_bImmobile = 0


AI.register(THZPlus)

Any help ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on August 14, 2010, 07:56:58 PM
I'm away from my main computer so I can't test but it looks like you have a problem at line 29. It needs 8 spaces instead 4 before 'self.canFire'.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on August 14, 2010, 10:48:01 PM
the retraction thing is to do with the whip back and forth section


infact IIRC a robot is start point 2 will retract the hammer backwards


I have been meaning to do stuff like that ^^^ (I have a few new versions of an unreleased THZ.py) but I got distracted making an effective strafe AI
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on September 30, 2010, 11:41:21 AM
Which direction is Clockwise on FBSPlus?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on September 30, 2010, 11:42:48 AM
Which direction is Clockwise on FBSPlus?

1

FYI you can check this in the python.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on September 30, 2010, 11:49:30 AM
Cheers.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 02, 2010, 12:13:31 PM
(https://gametechmods.com/uploads/images/69569heading.PNG)
What nose.math should I use for this heading?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on October 02, 2010, 12:22:35 PM
umm off the top of my head

-math.pi/2

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on October 31, 2010, 08:51:40 AM
In my bot's bindings, ,'nose':math.pi makes it face backwards so, what would I need to change it to to make it face forwards?

EDIT: I got it to work. I have one last question. How do you add a srimech? My brain is failing me.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on October 31, 2010, 09:04:52 AM
Remove the nose value, or put 'nose':0, or 'nose': math.pi*2. Or any multiple of 2 really.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on October 31, 2010, 09:05:59 AM
I managed to do it just before you posted. :P

I have one last question. How do you add a srimech? My brain is failing me.

Could you help me with this? My bot is a popup if it helps.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on October 31, 2010, 09:06:37 AM
Add a button named "srimech" to the bots you want
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on October 31, 2010, 09:08:24 AM
And then I need to add "invertible: false" to the bindings?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on October 31, 2010, 09:19:05 AM
You don't need it, but what you need in simple AIs is the bot NOT being considered as invertible by the game. If it has no "invertible : True" in the bindings it's fine.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on October 31, 2010, 09:34:14 AM
IIRC it will ignore the srimech control if told "invertible : True"

"invertible : False" is the exact same as having nothing at all, so just delete the "invertible : True" part if its not needed
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on October 31, 2010, 09:37:29 AM
Ok, thanks. For some reason I forgot how to do it. >_>
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on November 07, 2010, 01:36:48 PM
Can someone give me a download link for OmniMultiZone?

I asked this before but no one listened :(
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 07, 2010, 01:44:06 PM
Doesn't it come with DSL?

If it doesn't then it comes with NAR AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on November 07, 2010, 01:45:59 PM
I cant download from rapidshare or megaupload so I cant get it from NAR ai and it isnt in DSL
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 07, 2010, 05:23:18 PM
One sec...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 07, 2010, 05:24:34 PM
here
https://gametechmods.com/uploads/files/8748OmniMultiZone.rar (https://gametechmods.com/uploads/files/8748OmniMultiZone.rar)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on November 13, 2010, 08:23:55 AM
How do I Ai Frenzy bots again? I need to AI Slashy D and Frenzy (Robot wars version)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on November 13, 2010, 08:36:17 AM
use my THz.py otherwise.. well see my match in IRL.

https://gametechmods.com/uploads/files/5054THZ.rar (https://gametechmods.com/uploads/files/5054THZ.rar)

Just controls

Forward, LeftRight, Hammer (on analog) and a Smartzone called Whipzone

nothing fancy required for the bindings..
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: J24 on November 21, 2010, 09:39:35 AM
I need to rotate a robot 90 degrees clockwise and each time i try it just crashes my game

heres the bindings
Code: [Select]
list.append(("The Perfect Song","OmniRam",{'invertible':True,'nose':math.pi,'radius':0.1,'topspeed':99,'throttle':130,'turn':40,'turnspeed':1,'weapons':(5,6)}))

What am i doing wrong?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on November 21, 2010, 01:57:54 PM
are you missing 4 spaces at start?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: J24 on November 21, 2010, 01:59:12 PM
before the list.append? nope
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on November 21, 2010, 02:01:58 PM
there should be
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: J24 on November 21, 2010, 02:07:07 PM
no as in nope im not missing them
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on November 21, 2010, 02:11:35 PM
Before 'nose' there should be a { like this {'nose'.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on November 21, 2010, 02:13:05 PM
Before 'nose' there should be a { like this {'nose'.
No
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on November 21, 2010, 02:13:40 PM
    list.append(("Scout","Flipper",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':100,'turn':30,'turnspeed':5,'weapons':(8,9)}))
    list.append(("RED ALERT","Poker",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':5,'weapons':(13,14,16,17,18)}))
    list.append(("Second Sentinel","Flipper",{'nose':math.pi*2,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':5,'weapons':(18,19)}))
    list.append(("T-Minus","Poker",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(25,)}))
    list.append(("Biohazard","Poker",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(4,)}))
    list.append(("Dreadnought","Omni",{'invertible':True,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':80,'turn':25,'turnspeed':1.5,'weapons':(20,)}))

See?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on November 21, 2010, 02:16:40 PM
He has it already, just before "invertible"
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on November 21, 2010, 02:19:28 PM
It's only before 'nose' there in your examples as nose is the first variable. The {} enclose the variables.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on November 21, 2010, 02:19:56 PM
^Why this?^
EDIT: Damn you GK
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: J24 on November 21, 2010, 02:27:27 PM
ok so what is the radian whajamacallit i should be using

Edit: Got it.
Now if only i could test its turnspeed without it smashing me in one second... -_-
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on December 17, 2010, 05:31:57 PM
Can someone explain how to wire a bot with invertomni2.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on December 17, 2010, 07:37:31 PM
If I read it correctly, it's just an Omni.py that attempts to self-right even while being invertible, so there's no need for special wiring. Just like Omni.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on December 21, 2010, 08:55:32 AM
What AI would I use to AI my BTTB entry? It's a drum.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Pwnator on December 21, 2010, 08:57:18 AM
Drum.py, unless your drum isn't invertible, where a simple Omni would work.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on December 22, 2010, 04:41:18 AM
My memory is failing. What do I need to call the spin motor's control for omni.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on December 22, 2010, 04:42:44 AM
Spin, I told you yesterday :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on December 22, 2010, 04:44:00 AM
I know. That's why I said, "My memory is failing". :P

Thanks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on December 22, 2010, 07:00:07 AM
DP!

Can anyone see what's wrong with this A.I line?

Code: [Select]
    list.append(("Drumbelina","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on December 22, 2010, 07:08:26 AM
You need a comma after the 1 in weapons.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on December 22, 2010, 07:13:05 AM
Thanks. :D
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 02, 2011, 03:24:34 PM
I AI'd Zog's BTTB bot with the following AI line:

    list.append(("Huge SnS","FBS",{'invertible':True,'direction':-1,'spinspeed':18,'radius':0.1,'throttle':130,'topspeed':99,'turn':60,'turnspeed':5,'weapons':(13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)}))

However, to bot doesn't translate. Any idea why?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on January 02, 2011, 05:49:01 PM
Are the wirings correct ? If yes, try reducing spinspeed.

What are torque and maxspeed of these bluebird-like motors anyway ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 02, 2011, 08:43:15 PM
its too slow to translate much without spinning really slow

(look back to CC3, remember how fast your robot moved GK, compared to LDL's)

for its drive speed (or rather, lack of it) I would use FBS_1
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 05:43:22 AM
Ok, thanks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 08:45:26 AM
DP:

With

Code: [Select]
    list.append(("Huge SnS","FBS_1",{'invertible':True,'PreSpinEntrance':0,'SpinDirection(1/-1)':1,'ReMobilizeRoutineTime(10-60)':10,'radius':0.1,'throttle':130,'topspeed':99,'turn':60,'turnspeed':5,'weapons':(13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)}))
It just chases the opposing bot around and sways. Any ways to make it spin like normal?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 03, 2011, 08:51:46 AM
named your controls correct ?

Spin (Analog) wired to drive and weapon motors (if required)

Ahead (Analog) same as what Forward would normally do

LeftRight (Analog)



a control called Forward will hinder spinning

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 08:56:08 AM
That would explain everything. I forgot to change the comtrol names. :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 09:23:52 AM
DP: Now it drives up to the opponent, sways for a few seconds before spinning.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 03, 2011, 09:27:27 AM
is your 'PreSpinEntrance': still set as 0

in any case try 'PreSpinEntrance':1 and see if it does any better..

you only have these controls correct?

Spin (Analog) wired to drive and weapon motors (if required)

Ahead (Analog) same as what Forward would normally do

LeftRight (Analog)


because a "Forward" control will effect the spinning process
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 09:29:30 AM
Controls were renamed and applied.

Prespin entrance was set at 15 but I'll try 1.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 09:32:41 AM
DP: Going even more wacko with 'PrespinEntrance':1, not spinning at all.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 03, 2011, 09:39:20 AM
Prespin entrance was set at 15

thats really bad :P PreSpinEntrance is the number of tick intervals the robot will wait before spinning...

send me the robot and I will see what you have done...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 03, 2011, 09:59:49 AM
https://gametechmods.com/Robot_Exchange/HW/Zog_Huge%20SnS.bot (https://gametechmods.com/Robot_Exchange/HW/Zog_Huge%20SnS.bot)

Current AI line:

Code: [Select]
    list.append(("Huge SnS","FBS_1",{'invertible':True,'PreSpinEntrance':1,'SpinDirection(1/-1)':-1,'ReMobilizeRoutineTime(10-60)':10,'radius':0.1,'throttle':130,'topspeed':99,'turn':60,'turnspeed':5,'weapons':(13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 03, 2011, 11:34:53 PM
The main problem was no range value.. thats why I wouldnt spin until close.. and the re-immobile time was to slow for a slow robot :P

Code: [Select]
    list.append(("Huge SnS","FBS_1",{'invertible':True,'PreSpinEntrance':1,'SpinDirection(1/-1)':-1,'ReMobilizeRoutineTime(10-60)':60,'range':99,'radius':0.1,'throttle':100,'topspeed':99,'turn':60,'turnspeed':5,'weapons':(1,)}))
controls themselves were fine

this .py is probably one of the most advanced / technical to work with.. a lot of different things / strategies can be made with this and FBS_2...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 04, 2011, 04:06:18 AM
Thanks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 123savethewhales 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 (https://gametechmods.com/Robot_Exchange/DSL_LW/123savethewhales_LWBigWheel.bot)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo 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..
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 12, 2011, 11:03:10 AM
Have neither sorry, will do it for moneyz though :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on January 12, 2011, 11:04:32 AM
*Hands over virtual moneyz*
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on January 12, 2011, 11:07:20 AM
Sorry the exchange rate for that is awful, $AUD would be better :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on January 12, 2011, 11:10:51 AM
Sorry the exchange rate for that is awful, $AUD would be better :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle 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 (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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner 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).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on January 13, 2011, 08:01:27 PM
WHAT HAVE I DONE


(https://gametechmods.com/uploads/images/61717bigwheel.jpg)


^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* (https://gametechmods.com/uploads/files/TRFBD.zip)


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:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo 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...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 123savethewhales 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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on January 15, 2011, 06:24:01 AM
So is/ will someone work on my .py? If not, don't worry.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo 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...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle 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,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: SteveM4 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 27, 2011, 11:17:27 AM
Post the binding line plz.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: SteveM4 on January 27, 2011, 11:26:50 AM
Code: [Select]
list.append(("Frontal Assult","Flipper",'nose':math.pi*2,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':6,'weapons':(18,19)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on January 27, 2011, 11:32:47 AM
delete the *2 after the nose:math.pi
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: SteveM4 on January 27, 2011, 11:34:07 AM
kthnxbai  :approve:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Scrap Daddy on February 16, 2011, 03:11:19 PM
philletbabe?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Scrap Daddy on February 16, 2011, 03:21:25 PM
nice to see you, dude and nice ai. Also youu have to use your email you signed up with as your username
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on February 16, 2011, 08:12:25 PM
woah, not expecting this! Sup Phil!

We have so many oldies coming back. 2011 should be known as the year of the returning members or something.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: philetbabe on February 17, 2011, 12:42:57 PM
https://gametechmods.com/includes/flvfiles/ramUfo2.flv (https://gametechmods.com/includes/flvfiles/ramUfo2.flv)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on February 17, 2011, 01:59:31 PM
Awesome!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on February 17, 2011, 02:34:27 PM
O.O That's actually amazing!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: martymidget on February 17, 2011, 02:35:03 PM
Amazing o.o
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on February 17, 2011, 02:51:26 PM
Glad to see you back phil.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Madiaba on February 23, 2011, 08:58:50 AM
Glad to see you back phil.
Ditto.   :bigsmile:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on February 23, 2011, 01:06:22 PM
Glad to see you back phil.
Ditto.   :bigsmile:
Your name looks intimidating in red, I must say...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Serge on February 23, 2011, 01:10:23 PM
Phil:
a) Nice demo but FRAPS is better at recording games than CamStudio.
b) How are you achieving the downwards motion? Just applying a force from the AI script?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Scorpion on February 23, 2011, 04:05:21 PM
2011 should be known as the year of the returning members or something.
Catchy

So, can this AI be manipulated more? So we could perhaps have flying robots as a legit thing?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nicsan2009 on February 23, 2011, 05:02:27 PM
Nice Vid!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: philetbabe on February 24, 2011, 05:16:18 PM
b) How are you achieving the downwards motion? Just applying a force from the AI script?
yes just poor force : i've tried to build a ai only relaying on force (no hover craft component), but if it was easy to move the bot, its chassis was  extremly instable, never staying horizontal. Force are only applied on the G point on the bot, not uniformaly on the chassis.

Yet i'm working on a bot moving invertible and using servo piston.Look closely how the pistons  retract before the bot goes upsidedown.

Any way, servo pistons seem to have some bug  when aied.


http://www.youtube.com/watch?v=opYuj5GwF8A&feature=player_detailpage# (http://www.youtube.com/watch?v=opYuj5GwF8A&feature=player_detailpage#)
               
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: philetbabe on February 27, 2011, 04:22:37 PM
this is the picture of the bot :
(https://gametechmods.com/uploads/images/51830inverti1.jpg)

As long as they are human controled, servo piston works well. However, their control by program seems to be eratic. At last, one must thinks to stop the extent/retract order, otherwise the airtank will quickly be empty.
 
Code: [Select]
         #define identifier of servo-Piston
         goon = 1
         i = 0
         while goon == 1:
            if i  == self.GetNumComponents(): break
            currentType =  self.GetComponentType(i)
            if currentType == "ServoPiston":
               self.PistonFound += 1
               if self.PistonFound == 1 : self.PistonOne = i
               else:
                  self.PistonTwo = i
                  break
            i = i+ 1   

...

         pos1 = self.GetPistonPosition(self.PistonOne)
         pos2 = self.GetPistonPosition(self.PistonTwo)

         if  self.IsUpsideDown() :
            self.InverterTime = self.reloadDelay
            if   (pos1 < -0.2 ) or (pos2 < -0.2 ) :
               self.Input("SPExtend", 0, 1)
            else  :   
               self.Input("SPExtend", 0, 0)           
               self.Input("SPRetract", 0, 0)
         else :
            if   (pos1 > -0.15 ) or (pos2 > -0.15 ) :
               self.Input("SPRetract", 0, 1)
            if (self.InverterTime <= 0) :
               self.Input("SPExtend", 0, 0)           
               self.Input("SPRetract", 0, 0)
               self.Input("Inverter", 0, 1)
               self.InverterTime = self.reloadDelay
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hard Bot on February 27, 2011, 06:17:04 PM
When my bot loads  in the game, it says runtime error. What do I do?
Anyway, here is a picture of my bot:

(https://gametechmods.com/uploads/images/3736screenshot_3.JPG)

I now I made correct bindings.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on February 27, 2011, 06:44:34 PM
Did you use the ones I posted in the thread? Yours weren't right.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hard Bot on February 27, 2011, 07:36:23 PM
It still says runtime error.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Stagfish on February 28, 2011, 01:30:51 AM
In your team folder is the bot file called Bot0?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: philetbabe on February 28, 2011, 03:29:14 PM
When my bot loads  in the game, it says runtime error. What do I do?
Anyway, here is a picture of my bot:

I now I made correct bindings.

if your bot is AIed :
if RA2 crashes before showing the arena the most common reasons are :
- your bot use unreferenced  components (much as if you take a DSL bot and put it in a  stock context)
-the binding is no good :
   -blank (white space)  used instead of tabulation
   -name error (name get white space you didn't notice) ,  AI name error,  missing ')', missing ',', case sensitive error
  -double binding with the same name, and last one is with error (but your always looking at the first one)
 -correct binding, but you don't have the associated AI ( the file something.py that should exist under your AI/ folder)

if it crashes after showing the arena and the countdown ... well you have touched the something.py.

if your bot is not AIed :
maybe this is your file RA2/teams/teams.txt that is corrupted.
Correction is not easy. this is what i adive :
-take a file RA2/teams/teams.txt from a good archive and erase yours.
-under RA2, re-creae teams (but do not create bots in these teams)
-exit RA2 and edit the file  RA2/teams/teams.tx
-for each team that got bots, modify the line
Code: [Select]
Robots:
by
Code: [Select]
Robots: 0 1 2 3 4 5
if you've gor 6 bots for your team.

Easiest way (file teams.txt corrupted)  :
-Copy your file RA2/teams/teamnumber/bot0 under RA2/teams/Robot design
-do the same for each of your bot
-take a file RA2/teams/teams.txt from a good archive and erase yours : you have loosed all of your teams but your bots maybe imported.

last spring : (if your bot is not AIed) : send me your file teams.txt

  last spring : (if your bot is AIed) : send me your file binding .py

please, give feedback
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 12, 2011, 05:08:02 AM
Bump.


I made a TRFBD, and then for AI'ing it, I copied the wiring of the LW TRFBD in 123 AI exactly. I used the same binding line. However, it only functions as it should for ~2 seconds, whereupon it fails to move at all, and if an enemy approaches it, it sits and spins for a few seconds, before returning to its stationaryness. Anyone know why this may be the case?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 12, 2011, 05:09:56 AM
Check your nose, wiring, etc. How different is it from the one in 123AI?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 12, 2011, 05:10:56 AM
Nose and wiring are identical.

as for differences, there are no flails, if that helps.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 12, 2011, 05:18:11 AM
Piglet motors?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 12, 2011, 05:19:54 AM
ja.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 12, 2011, 05:22:41 AM
Well, I tried. TBH I shouldn't even be helping as I don't know the AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on June 16, 2011, 12:34:34 AM
And all the other TRFBD's still work?


I have no idea what could be wrong.  It would seem to be an issue with the drive, since the "Spin" weapon control seems to work fine, but if you're sure the wiring, control names, and bindings are exactly the same... who knows.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 16, 2011, 05:23:47 AM
I've not got it in a game with other TRFBD's. Is there an update in Tactics.py or something?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on June 16, 2011, 10:57:18 PM
TRFBD.py doesn't use any new tactics so it's not that.


Does the bot move correctly when you drive it?  Sometimes wiring for crawlers is quite weird.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 17, 2011, 03:43:57 AM
The driving itself is mostly ok, but it does veer off to one side a tad.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 18, 2011, 02:31:17 PM
Here's a game of spot the binding error! :D

Code: [Select]
    list.append(("Gicquel","Popup",{'radius':1,'topspeed':100,'throttle':130,'turn':100,'turnspeed':2,'weapons':(0)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on June 18, 2011, 02:38:18 PM
Ugh, who started using "list" as variable name?

Please don't do that in Python, "list" is the name of the built-in type list. If you overwrite that name you can't turn other things in lists anymore (for example, "list((5, 3, 2))").
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 18, 2011, 02:38:58 PM
I cant't help it, it's the binding line for RA2.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on June 18, 2011, 02:55:59 PM
Here's a game of spot the binding error! :D

Code: [Select]
    list.append(("Gicquel","Popup",{'radius':1,'topspeed':100,'throttle':130,'turn':100,'turnspeed':2,'weapons':(0)}))

Pretty sure you need a comma after your 0 in the weapons entry.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 18, 2011, 03:04:45 PM
Smeg, I do, cheers Nary.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 25, 2011, 12:06:49 PM
Can anyone advise me on how to AI a trinity SnS like this?
(https://gametechmods.com/uploads/images/44854Tail%20Whiplash.png)

Also, I can't seem to find the link to those weightless smartzones.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on June 25, 2011, 12:10:00 PM
It doesn't matter if its overweight cause of a smartzone

Anyway, try just AI'ing like a normal SnS on FBSPlus, but with the pistons wired to "Spin"
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 25, 2011, 12:12:11 PM
It's just it can't stop spinning. I don't think it'l translate.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on June 25, 2011, 12:16:53 PM
Well a trinity SNS won't immobilise itself, surely

So no need to stop spinning
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 25, 2011, 12:19:21 PM
I guess so. Any ideas about those weightless smartzones?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on June 25, 2011, 12:29:57 PM
Doesn't matter if you're entering it in a tourney, smartzones aren't included in the bots weight
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 25, 2011, 12:53:52 PM
I know, but I wish to find them for a purpose I do not wish to reveal.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Vertigo on June 25, 2011, 01:07:59 PM
Not a clue then :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on June 25, 2011, 02:12:49 PM
I have made a py file for trinity SnS, but it failed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on June 25, 2011, 02:27:14 PM
Also, I can't seem to find the link to those weightless smartzones.

One of the components in here is a no-wieght smartzone:
https://gametechmods.com/Robot_Arena2/Components/zonemodpack.zip (https://gametechmods.com/Robot_Arena2/Components/zonemodpack.zip)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on June 25, 2011, 10:32:09 PM
Leave it to the pro's :P

1) The weightless SZ's are Mad's, just go back through the pages in the "Mods and Designs" section and find the topic "Mad's Mods, Thoughts and Tweaks" they are on the last or second last page (if memory serves)

2) I am working on a Trinity python for the flier challenge right now, When I get them to AI ok I will hook you up with the files and info..
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 26, 2011, 04:25:35 AM
@ JB, thanks and thanks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on July 16, 2011, 12:03:29 PM
(https://gametechmods.com/uploads/images/61188lits.PNG)
Does anyone have any experience with ElectricHammer ai? Aka the ai used on Bisector?
I am trying to Ai this and it is refusing to even attempt to swing the hammer. The motor is a NPCfast which can swing the hammer fine.
I've got the Motorid right so I have no idea whats going on.
Or if anyone else could suggest an alternative that'd be great.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 10, 2011, 06:43:50 PM
GRAAARGH

I AM TRYING TO AI MY BOT FOR IRONBOT AND EITHER IT'S NOT WORKING, EITHER I AM UNHAPPY WITH IT

Here's the special AI for it:

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

class SZSpinnerPopup(AI.SuperAI):
    "Like Omni, but does not use a range value for a spinning weapon ; instead uses a smartzone"
    name = "SZSpinnerPopup"
   
    #Just like said, this is an AI that activates it's spinning weapon via a smartzone (that you need to name "spinner") rather than a range value.
    #For very short spinup time robots (jugglers, drums, face spinners, etc) that only really need to spin their weapons when the opponent is on them.
#This version is similar to Popup.py, only the chassis of an opponent will trigger the spinning.
    #Brought to you by Naryar and inspired by Madiaba's Arrowhead.py.
   
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone = "weapon"
        self.triggers = ["Spin"]
        self.trigger2 = ["Srimech"]
        self.botinzone = 0
       
     
        if 'triggers' in args: self.triggers = args['triggers']
       
        self.triggerIterator = iter(self.triggers)
 
        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(self.zone, 1)
            self.RegisterSmartZone(self.zone1, 2)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon
        if self.weapons:
            # spin up if enemy is in smartzone.
            if self.botinzone1 == 1:
                self.Input("Spin", 0, 1)
            else:
                self.Input("Spin", 0, 0)
           
           
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]

        return AI.SuperAI.Tick(self)

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    def LostComponent(self, id):
        # if we lose all our weapons, stop using the Engage tactic and switch to Shove (absolutely worthless, that said)
        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)
    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 0 and self.weapons:
            if chassis:
                if direction == 1:
                    self.botinzone == 1;
        return True
AI.register(SZSpinnerPopup)

That is not working. It launches the game fine, then at the end of the match starting countdown it randomly crashes.

AND NOW THERE IS A MOSQUITO ANNOYING ME. HIS END WILL BE SWIFT AND PAINFUL.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 10, 2011, 07:04:51 PM
lol

Just use Popup, name the spinner command "fire" and the SZ "weapon". Works for BountyHunter and LSoDG (AKA my BTTB4 entry)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 10, 2011, 07:29:56 PM
lol

Just use Popup, name the spinner command "fire" and the SZ "weapon". Works for BountyHunter and LSoDG (AKA my BTTB4 entry)

Do you think I did not tried that ?

It worked, but the spinner WOULD NOT STOP SPINNING after first getting contact with the chassis. And that I do not want, mostly because my razors might hit the enemy's weapons, and no gut-ripper keeps his weapons outside when not attacking !
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 10, 2011, 08:15:51 PM
oh.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 13, 2011, 05:24:51 AM
DP

How would I AI this?

(http://pic.phyrefile.com/l/lo/loz/2011/08/12/PI3.jpg)

I tried to AI it with THZ.py but the actuators trinity on me and the clamps move at an ungodly speed.

ElectricHammer was not much better.

Help?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on August 13, 2011, 06:48:37 AM
THZ is a motor hammer python.. so even if the robot didnt glitch it wouldnt work..

Try Kheper.py 

Put the linear's on the analog control "Servo" with positive axis as open and negative axis as closed (or vice versa if it keeps them closed all the time)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 03:01:31 PM
Is there an AI out there that makes the bot back up at the beginning but is then just a normal Omni-style bot?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on August 17, 2011, 03:02:33 PM
For how long?

This isn't my BoR bot is it?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 03:05:10 PM
no, it's my bot for Un-generic-ness.

for like 3 seconds.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 17, 2011, 03:18:21 PM
I think you need a new python for this. I would go and take a look at SpinupOmni.py (Heaven's Windmill's .py file) if i were you Badnik.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 17, 2011, 03:34:48 PM
I think you need a new python [sic] for this. I would go and take a look at SpinupOmni.py (Heaven's Windmill's .py file) if i were you Badnik.

I think you need a new Python script for this.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 17, 2011, 03:38:40 PM
Other.py (LittleMetalFriend) is the way to go.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 17, 2011, 03:45:28 PM
Other.py (LittleMetalFriend) is the way to go.

Do you even know what are you talking about ? I don't think so. Lemme check...

*goes to see Other.py*

No you don't. Other.py activates two analog controls when the enemy bot is in a smartzone, and has an additional spin motor support.

*goes to see SpinupOmni.py*

And this one has a function you might be interested in Badnik. It's called getTimeElapsed. The whole py sends a null throttle value to the bot until a certain time is elapsed, and at that time the null value goes away, leaving place to normal driving. I bet you can mod the py a little so it gives negative throttle for a few seconds.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 04:08:57 PM
OK, I see this and I edited it. I'm going to try it out.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 04:22:26 PM
Believe it or not, it worked first try!

I dunno if it was the binding or the bot though. Gonna test it out.

edit: Yep, it's the binding! :D I think maybe SpinUpOmni itself would have worked though, and I didn't have to edit the .py. But IDC.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 17, 2011, 04:49:51 PM
Other.py (LittleMetalFriend) is the way to go.

Do you even know what are you talking about ? I don't think so. Lemme check...

*goes to see Other.py*

No you don't. Other.py activates two analog controls when the enemy bot is in a smartzone, and has an additional spin motor support.

*goes to see SpinupOmni.py*

And this one has a function you might be interested in Badnik. It's called getTimeElapsed. The whole py sends a null throttle value to the bot until a certain time is elapsed, and at that time the null value goes away, leaving place to normal driving. I bet you can mod the py a little so it gives negative throttle for a few seconds.



Excuse me, but I used LittleMetalFriend in BB2, and it worked fine.

http://www.youtube.com/watch?v=3UlMj0Z-S9U# (http://www.youtube.com/watch?v=3UlMj0Z-S9U#)
http://www.youtube.com/watch?v=7gSEppXkXug# (http://www.youtube.com/watch?v=7gSEppXkXug#)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on August 17, 2011, 04:56:40 PM
Yes, it worked for that bot, but not for the thing Badnik's trying to AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 05:00:21 PM
It works, everything is settled.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 17, 2011, 05:14:22 PM
Yes, it worked for that bot, but not for the thing Badnik's trying to AI.

He's trying to AI the exact same bot. :P

But I'll stop complaining and eat my bacon.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2011, 05:17:46 PM
No, I'm AIing another bot now, derp. I fixed the the clamper with Kheper.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on August 17, 2011, 05:33:36 PM
Yes, it worked for that bot, but not for the thing Badnik's trying to AI.

He's trying to AI the exact same bot. :P

He isn't.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 17, 2011, 05:36:42 PM
sh**sh**sh**sh**

i really apologize.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 18, 2011, 10:53:25 AM
Is there a spinner AI that could tell the bot to retreat when the motor stops spinning? Or even just a rammer AI with a spinning weapon?  It would really help thanks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on August 18, 2011, 11:01:13 AM
Try to hybrid it yourself.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 18, 2011, 11:01:50 AM
I literally know nothing of what to do.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 18, 2011, 11:26:20 AM
DP: Something weird happening. I just AI'd a spinner and it won't spin! The control is named"Spin", it's a button, it works under human control. The bot uses Spinner.py and has a ranfe of 99. Yet the weapon doesn't spin under AI. I must be missing something obvious here.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on August 20, 2011, 10:28:27 PM
i ai-ed a pushy bot with a snowplow that fails. it's wired correctly, it faces the right way, but this is what it does.

it drives toward me, backs up, then drives staright into a corner. help?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 12:40:45 AM
Question: I AI-d a spinner and when it drives it turns left and right while moving forward. Any way to solve this?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on August 21, 2011, 01:13:15 AM
Lower your turn speed, you probably have it too high..

What is it?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 21, 2011, 08:50:17 AM
i ai-ed a pushy bot with a snowplow that fails. it's wired correctly, it faces the right way, but this is what it does.

it drives toward me, backs up, then drives staright into a corner. help?

is the turning named "LeftRight"?
Does it have car steering (fail)? if so, put 'car': True in the binding line.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 10:35:12 AM
Lower your turn speed, you probably have it too high..

What is it?

2.5
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on August 21, 2011, 10:36:43 AM
hmm.. what is the turn value?

is the robot fast to drive too?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 10:40:59 AM
hmm.. what is the turn value?
30
is the robot fast to drive too?
It has NPCF IIRC
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on August 21, 2011, 10:55:50 AM
Bump it from 30 to 60 as it might be trying to correct itself all the time..

NPCF doesnt help much :P what weightclass?

For example.. a LW is going to be super fast so the turning need to be backed off.. try 60 first and see how you go.. 
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 10:58:04 AM
NPCF doesnt help much :P what weightclass?

It's a HW HS 4WD

EDIT: I switched it from 30 to 60, and it seems to turn even more left and right
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 21, 2011, 12:28:37 PM
What's the radius? That always seems to help me.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 12:31:10 PM
What's the radius? That always seems to help me.

I believe .5
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on August 21, 2011, 01:47:36 PM
what about my pushy bot that's scared to fight?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 21, 2011, 02:08:58 PM
What's the radius? That always seems to help me.

I believe .5

Try lowering it to .2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on August 21, 2011, 02:11:29 PM
What's the radius? That always seems to help me.

I believe .5

Try lowering it to .2

Still turns. (But less)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on August 21, 2011, 09:38:31 PM
does anyone care about my scared snowplow pushing bot?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: System32 on August 23, 2011, 01:41:30 PM
I'm not the best coder, but I've come up with a basic AI for a rammer that leaps onto an opponent and then reverses.
Code: [Select]
from __future__ import generators
import plus
import AI
from AI import vector3
import Arenas
import Gooey
import math
import Tactics
class Jumper(AI.SuperAI):
    "AI that leaps onto the opponent to attack, then backs up."
    name = "Jumper"
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "Zone1"
        self.zone2 = "Zone2"
  self.zone3 = "leap"
  self.triggers1 = ["Leap"]
        self.botinzone1 = 0
        self.botinzone2 = 0
        self.backupFunction = self.Backup
        if 'zone1' in args: self.zone1 = args['zone1']
        if 'zone2' in args: self.zone2 = args['zone2']
 
  if 'leap2' in args: self.triggers1 = args['leap2']
        self.tactics.append(Tactics.Ram(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(self.zone1, 1)
            self.RegisterSmartZone(self.zone2, 2)
            self.RegisterSmartZone(self.zone3, 3)
        else:
            # get rid of reference to self
            self.backupFunction = None
           
        return AI.SuperAI.Activate(self, active)
    def Tick(self):
                       
        bReturn = AI.SuperAI.Tick(self)
       
        # call this now so it takes place after other driving commands
        if self.backupFunction: self.backupFunction(len(targets) > 0)
       
        return bReturn
       
    def Backup(self, bTarget):
        # back up if a bot gets under us (I ripped this from Arrowhead, sorry madiba)
        if self.botinzone1 == 1:
            self.Throttle(0)
            self.Input("Fire1", 0, 100)
        else:
            self.Input("Fire1", 0, 0)
           
        if self.botinzone2 == 1:
            self.Throttle(0)
            self.Input("Fire2", 0, 100)
        else:
            self.Input("Fire2", 0, 0)
    def LostComponent(self, id):
        # if we lose all our weapons, stop using the Ram 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 == "Ram"]
            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)
    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1:
            if robot > 0:
                if direction == 1:
                    self.botinzone1 = 1
                if direction == -1:
                    self.botinzone1 = 0
        elif id == 2:
            if robot > 0:
                if direction == 1:
                    self.botinzone2 = 1
                if direction == -1:
                    self.botinzone2 = 0
        elif id == 3:
            if robot > 0:
                if direction == 1:
                    for trigger in self.triggers1: self.Input(trigger, 0, 1)
        return True
   
AI.register(Jumper)
I just need some help to see if it actually works.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 12:37:23 PM
DP: Something weird happening. I just AI'd a spinner and it won't spin! The control is named"Spin", it's a button, it works under human control. The bot uses Spinner.py and has a ranfe of 99. Yet the weapon doesn't spin under AI. I must be missing something obvious here.
Anyone got any help?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 27, 2011, 12:42:41 PM
check for extra spaces, misspellings, maybe an undercase S (wiring is case-sensitive)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on August 27, 2011, 12:42:50 PM
DP: Something weird happening. I just AI'd a spinner and it won't spin! The control is named"Spin", it's a button, it works under human control. The bot uses Spinner.py and has a ranfe of 99. Yet the weapon doesn't spin under AI. I must be missing something obvious here.
Anyone got any help?

Dunno.

1. Try a switch
2. Omni.py
3. Range? :P

All I can think of. :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 12:44:11 PM
I've tried Omni.py. No luck.
G.K. tried to AI it and had the same problem!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 27, 2011, 12:47:53 PM
erm... is there a "weapons" line in the bindings?

did you try re-wiring the motor?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 12:52:38 PM
No weapons line, would that affect it?

And I'll try re-wiring the motor.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 27, 2011, 03:09:14 PM
I just added a folder called Team36 to Pys AI and added this to Teams.txt:

Code: [Select]
index 36
NC's creatures
"Crunch, gnaw and claw"
AI\oldies.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

Next I put my TheTroll5.bot in that folder and renamed it to bot0.bot. It is wired with Forward, LeftRight, Fire and Srimech.

So far it all worked. But when I add my bindings.py entry it crashes:

Code: [Select]
list.append(("The Troll5","Omni",{'radius':0.1,'topspeed':99,'throttle':130,'turn':30,'weapons':(1,2,3,4)}))
What am I doing wrong?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 03:11:46 PM
How is TheTroll5 written in the bot fie?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 27, 2011, 03:13:37 PM
Code: [Select]
Name: The Troll5
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 03:14:45 PM
OK, there goes my idea. I'm assuming you had the 4 spaces at the beginning of the line right?
When does it crash?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 27, 2011, 03:17:19 PM
At the start of the game.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 03:19:13 PM
Shouldn't it be called Bot0.bot?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 27, 2011, 03:21:03 PM
Shouldn't it be called Bot0.bot?

Woops, still crashes though.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 03:22:10 PM
OK, that's me out, I'm still trying to fix my problem.
I guess all we can do now is wait.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 27, 2011, 03:27:37 PM
Alright, got it fixed.

The problem was that I had installed Pys AI over SC3 AI which has strange effects on the teams.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 27, 2011, 03:28:33 PM

Yeah, SC3 and its batch files...
I still can't fix my bot :rage
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Fracture on August 27, 2011, 03:37:17 PM
Is it set to "Spin" with a button and not a switch?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on August 27, 2011, 07:49:36 PM
No weapons line, would that affect it?

Yes, the AI is told to only spin if it still has weapons.  If there is no 'weapons' line, the AI doesn't know that it has any weapons and it won't spin.  If you don't want to actually have any real weapons set, just use 'weapons':(0,)
 
The reason the AI never stops spinning once they start is because button controls are almost impossible to turn off once activated.
 
Edit:
 
i ai-ed a pushy bot with a snowplow that fails. it's wired correctly, it faces the right way, but this is what it does.

it drives toward me, backs up, then drives staright into a corner. help?

What .py are you using?  Does it eventually drive out of the corner or does it just stay there?  Does the AI ever turn?  It may also help to post the bindings you're using.  Answer those questions and someone may be able to help.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on August 28, 2011, 05:38:07 AM
No weapons line, would that affect it?

Yes, the AI is told to only spin if it still has weapons.  If there is no 'weapons' line, the AI doesn't know that it has any weapons and it won't spin.  If you don't want to actually have any real weapons set, just use 'weapons':(0,)
 
I had a dream that I got that advice last night, but it was from Sage for some reason.
I'll go check it works now.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Sage on August 28, 2011, 12:32:18 PM

I had a dream about Sage last night.

:rage
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 28, 2011, 03:46:39 PM
So... I would guess Sage is so incredibly awesome at giving advice that when he sleeps, his mind casts Sending (http://www.d20srd.org/srd/spells/sending.htm) spells on it's own and sends advice subconsciously to less skilled builders ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 29, 2011, 03:06:38 PM
How can I AI a SnS so that it moves towards the enemy (kinda like pressing forward whenever the front of the SnS is aiming towards the enemy).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on August 29, 2011, 03:16:01 PM
FBS.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 29, 2011, 03:22:39 PM
FBS.py

Where can I get it?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on August 29, 2011, 04:40:19 PM
It should be in the BBEANS DSL AI pack.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on August 29, 2011, 05:29:56 PM
It's in NAR AI as well. And I bet it has moar info to make it work (added by me) that in the BBEANS AI pack :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on August 29, 2011, 05:50:11 PM
No weapons line, would that affect it?

Yes, the AI is told to only spin if it still has weapons.  If there is no 'weapons' line, the AI doesn't know that it has any weapons and it won't spin.  If you don't want to actually have any real weapons set, just use 'weapons':(0,)
 
The reason the AI never stops spinning once they start is because button controls are almost impossible to turn off once activated.
 
Edit:
 
i ai-ed a pushy bot with a snowplow that fails. it's wired correctly, it faces the right way, but this is what it does.

it drives toward me, backs up, then drives staright into a corner. help?

What .py are you using?  Does it eventually drive out of the corner or does it just stay there?  Does the AI ever turn?  It may also help to post the bindings you're using.  Answer those questions and someone may be able to help.
"Rammer",{'invertible':True,'radius':2,'topspeed':100,'throttle':120,'turn':60,'turnspeed':4}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 29, 2011, 06:04:34 PM
Alright, I got it to work with FBSPlus.py (is this the best version?), but there's one flaw: since my battery capacity is quite low the bot will decrease in spin speed dramatically during the fight. This AI file only takes one parameter, spinspeed, to see if the bot already is spinning fast enough before prioritizing moving to the enemy. So, at the end of the fight my bot just sits there spinning and doesn't attack whatsoever.

Is there a way to find out battery power (like self.GetBattery() or something) in the AI Python script? If there is I can brew something myself.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on August 30, 2011, 12:58:02 PM
There are no easy ways of checking the battery power using python. Your best bet is to either make a rough formula (with a binding for the amount of power and drain) or have the spinspeed decline over time (with a binding for the rate of decline).

Unfortunately, the drain isn't always linear so these methods aren't always accurate. There might be a way to use the sergepatcher as a means of looking up a specific value but it might be more trouble than its worth.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on August 30, 2011, 02:41:30 PM
Alright, I just added two paremeters:

drain
draintime

It basically substracts "drain" from "spinspeed" gradually in a linear way during "draintime" ending in "spinspeed"-"drain".
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on September 04, 2011, 06:26:48 AM
I'm trying to AI a pop-up for RPJK's AI pack, and when a match is started, it avoids the enemy (drives directly into the wall)
Code: [Select]
    list.append(("Yus","Omni",{'nose':math.pi,'radius':1,'topspeed':99,'throttle':130,'turn':60,'turnspeed':1,'weapons':(24,25,26,27,28,29,32,33,34,35,36,37)}))

I can replace omni with popup.py if it's needed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on September 04, 2011, 06:33:07 AM
My guess is that the nose is wrong. Try deleting the 'nose':math.pi,.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on September 04, 2011, 06:35:26 AM
Worked. Thanks NC.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on September 05, 2011, 06:19:25 AM
For future Info, Deleting it doesnt always fix the problem, it just makes the robot use the default which is

'nose':math.pi*2

The 4 common building directions are..

'nose':math.pi*2
'nose':math.pi
'nose':math.pi/2
'nose':-math.pi/2

If you build with your robots using the top of the Blueprint as the front of the robot you only need 'nose':math.pi*2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: nightcracker on September 05, 2011, 07:56:28 AM
Oh, and before you go like why math.pi and stuff, read this: http://en.wikipedia.org/wiki/Radian (http://en.wikipedia.org/wiki/Radian)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on September 12, 2011, 07:23:01 PM
I got a question, what pythonshould I use for Torque reaction hammer bots?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on September 21, 2011, 09:43:13 PM
It's a crawler right?
 
If so, then TRFBD.py should work.  It has a feature that makes the AI drive back and forth when the enemy is in a certain range, which on a TR hammer would make the hammer swing.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on September 24, 2011, 02:20:22 PM
Thanks Click.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on November 01, 2011, 07:39:12 PM
How would I AI this:
(https://gametechmods.com/uploads/images/31161screenshot_77.png)

There is no control board and therefore no controls.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on November 01, 2011, 07:42:12 PM
How would I AI this:
(https://gametechmods.com/uploads/images/31161screenshot_77.png)

There is no control board and therefore no controls.
you add a control board
or you just make it a sitting duck with nobrain.py, iirc.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on November 01, 2011, 09:01:49 PM
It's for Steel Warzone though and he can's really edit a competitor's bot so, I guess you'll have to use nobrain.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R0B0SH4RK on November 02, 2011, 04:29:05 PM
Was skimming this thread, figured I might as well upload this nose orientaiton guide I made a while ago. Hope this helps someone.

(https://gametechmods.com/uploads/images/62885NoseGuide.png)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on November 03, 2011, 08:50:20 AM
nice stuff R0B0... should be a huge help to those starting out
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yoda9726 on November 04, 2011, 04:17:23 PM
God, I hate to do this, but can I get some help Ai'ing this bot?  Everything I'm trying is failing miserably. 
 
https://gametechmods.com/uploads/files/HoverVore.rar (https://gametechmods.com/uploads/files/HoverVore.rar)
 
All help is appreciated.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on November 04, 2011, 04:21:11 PM
InMyArms2.py might work if you take a look at it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yoda9726 on November 04, 2011, 11:50:10 PM
been trying.  Servo never moves at all. Can you guys double check me, please?  I've got the servo wired to an analog named Servo, and the smartzone is labeled as servozone.  Here's the bindings, values aren't exact yet, i'm just currently trying to get it to work at all....


   


Code: [Select]
    list.append(("HoverVore","InMyArms2",'nose':math.pi*2,'servodelta':0.15,'servospeed':100,'servonose':1,'servoopenangle':10,'servocloseangle':0.5,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':5,'weapons':(2,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Preytor_4 on November 05, 2011, 08:30:52 AM
Finally finished AIing, but these 2 bots crash my game:

Code: [Select]
list.append(("Return To Sender","FBSPlus",{'nose':math.pi,'spinspeed':7,'range':99,'radius':0.1,'topspeed':99,'throttle':130,'turn':70,'turnspeed':4,'weapons':(20,21,22,23,24,25,26)}))
    list.append(("Ion-","FBSPlus",{'nose':math.pi,'spinspeed':7,'range':99,'radius':0.1,'topspeed':99,'throttle':130,'turn':70,'turnspeed':4,'weapons':(20,21,22,23,24,25,26)}))

Yes, I have FBSPlus

There is 4 spaces, just didn't copy it.

It crashes when I start the match. It gives me this error:

(https://gametechmods.com/uploads/images/24648m.PNG)

(yes this is in the SW-SBV  thread, but thats not really where it belongs)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS 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
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on April 27, 2012, 04:55:28 PM
i switched it to flameomni and fixed it thx for the help
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb 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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on May 25, 2012, 05:05:29 PM
What does Sawzal use?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on May 25, 2012, 05:19:25 PM
FBS_2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on May 25, 2012, 05:24:53 PM
Then use that  :gawe:.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on May 26, 2012, 11:58:28 AM
Can anyone get SimpleWeapon.py to work? I need it for Scrap's CW3 bot.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS 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 ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on May 28, 2012, 12:02:25 PM
You probably have to use weapon ID but I'm not too sure what py.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS 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
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 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,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on May 28, 2012, 03:32:32 PM
Extra comma after weapon 13?
No 4 spaces, tabbed instead?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on May 28, 2012, 03:34:45 PM
yeah it was the tab


thanks SM
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 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)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on June 04, 2012, 09:22:14 AM
I thought there was already a FBSInvertDrivePlus python kicking around?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 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...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders 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)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on June 08, 2012, 10:05:03 PM
theres no unlockable content in ra2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on June 08, 2012, 10:21:07 PM
OHH THOSE... those are cheatbot2 components, you need to enter your bot's name as cheatbot2 and then hit enter, the screen should flash and you will have the cheat parts until you quit when you will have to re-enter the code. just remember that they are generally banned in the community
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders on June 08, 2012, 10:33:37 PM
Thanks man! Now on the DSL when I'm playing with robots heavier (H) the game begins to lag is heavy for my pc? I'm from Brazil here do not have any forum.Da to play online on the purchased version does not? About prohibited you mean in online games can not use these weapons? sorry so many questions I found the game now!

Dual Core 1.60mhz
1gbram / ​​nvidia6200agp (512mb)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders on June 08, 2012, 10:47:43 PM
The error and closes. NO RA2 and tsl
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on June 08, 2012, 10:53:05 PM
Now on the DSL when I'm playing with robots heavier (H) the game begins to lag is heavy for my pc?
well of course that always happens with huge bots like shws and the such

About prohibited you mean in online games can not use these weapons?
if you make a showcase and showcase bots with those weapons you will be scolded, they are also banned from ai tournaments held by us (https://gametechmods.com/forums/index.php/board,121.0.html (https://gametechmods.com/forums/index.php/board,121.0.html))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders on June 10, 2012, 09:45:13 PM
PysAIpack guys downloaded and was looking at the architecture of the robot.
How to put the guns together and can not even across the battery and everything? I even dismantled but in time will not ride again.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on June 11, 2012, 11:10:10 AM
ummm... what?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: mistesanders on June 11, 2012, 11:35:28 AM
How to put the engine and propeller inside of the battery? With snapper bust II engine know what is possible but in this case he is not used.
http://imageshack.us/photo/my-images/137/roboty.png/ (http://imageshack.us/photo/my-images/137/roboty.png/)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Fracture on June 11, 2012, 02:21:28 PM
How to put the engine and propeller inside of the battery? With snapper bust II engine know what is possible but in this case he is not used.
http://imageshack.us/photo/my-images/137/roboty.png/ (http://imageshack.us/photo/my-images/137/roboty.png/)
http://www.youtube.com/watch?feature=player_embedded&v=Bs_ia4sTwHQ# (http://www.youtube.com/watch?feature=player_embedded&v=Bs_ia4sTwHQ#)
Hope you understand well enough. If you have any more questions please make a topic for them in Technical Support (https://gametechmods.com/forums/index.php/board,67.0.html).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on June 11, 2012, 02:30:57 PM
How to put the engine and propeller inside of the battery? With snapper bust II engine know what is possible but in this case he is not used.
http://imageshack.us/photo/my-images/137/roboty.png/ (http://imageshack.us/photo/my-images/137/roboty.png/)
http://www.youtube.com/watch?feature=player_embedded&v=Bs_ia4sTwHQ# (http://www.youtube.com/watch?feature=player_embedded&v=Bs_ia4sTwHQ#)
Hope you understand well enough. If you have any more questions please make a topic for them in Technical Support (https://gametechmods.com/forums/index.php/board,67.0.html).
OR you could put a 60 or 80cm extender on a motor, attach a rad by its end and spin both the motors while switching tabs
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on July 02, 2012, 08:18:00 PM
I'm having trouble AIing this bot. It uses ElectricHammer, and I can't:

A) keep it from starting balanced on its weapon

or

B) fix how long it swings the weapon. When the weapon swings, it swings until it inverts itself.

Bindings:
Code: [Select]
    list.append(("Technoderp","ElectricHammer",{'nose':math.pi,'invertible':True,'radius':1.5,'topspeed':99,'throttle':100,'turn':50,'turnspeed':1.5,'MotorID':14,'NoChassisTime':-1,'StartAngle':-math.pi,'SwingTime':5,'weapons':(15,)}))


Edit: Previous dancing problem pinpointed to StartAngle, not SwingTime.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gauche Suede on July 06, 2012, 12:01:45 AM
Hey, is there any py for a hammer flamethrower(EternalFlame) hybrid?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on July 18, 2012, 10:01:42 AM
Use FlameOmni from NarAI

Its just omni with the spin section duplicated to allow a tweaked number to be used to fix the flamethrower range problem AI tends to have, so everything else is as per normal.. 



Just wire your flamethrower on a positive analog as "Flame"


In theory you can use Omni with a flamethrower as "spin" but the range fires less then it should..
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on July 23, 2012, 12:37:02 PM
Can someone help me with this? i got everything wired up, with the weapons and everything, and starts going after the enemy, but at the last second runs away?

https://gametechmods.com/uploads/files/ai help.rar (https://gametechmods.com/uploads/files/ai help.rar)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on July 30, 2012, 08:10:01 PM
IS there a .py file that reverses direction when inverted? I need it for Lightning S.'s latest LDAI team.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: JoeBlo on July 31, 2012, 04:39:15 AM
Poke through BBEANS AI.. I think I remember seing one in the stock version.. though it was a while ago


most custom AI's have notes written into the top of the files, so just pop them open in regular notepad and read what they do..
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 01, 2012, 02:20:59 PM
Can't seem to find one.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gauche Suede on August 02, 2012, 09:55:25 AM
How do i wire a bot using Razorbackv3? I need it for Midnight Destiny so that it could self-right.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 14, 2012, 11:20:58 PM
Send me the bot and binding, it'll be easier for me to do it than explain what the problem most likely is.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on August 16, 2012, 10:30:13 PM
did you try -math.py and -math.py*2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Tweedy on August 17, 2012, 03:59:07 AM
try going into decimals such as math.py*1.5
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on August 17, 2012, 04:10:27 AM
Can I see a picture of the bot?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on August 17, 2012, 08:52:16 AM
Can I see a picture of the bot?
^This^
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on August 17, 2012, 01:57:29 PM
I need to see a picture of where the forward facing arrow is so that I can help... Tank treads shouldn't affect it, nor should the .py.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on August 17, 2012, 02:37:50 PM
is the bot's name the same as any other bot that in the AI file? if so you might have to rename it. i had problems where bots that had the same name but different bindings both used only the first binding in the list that had their name.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 17, 2012, 08:50:32 PM
Ohhh, that might be why Phantom was acting weird back a few months ago (I had one of GK's bot's named Phantom in the same AI). Yay for outdated problem fixes!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yoda9726 on August 18, 2012, 01:42:37 AM
My "front" of a bot is different than your 'front'.  Just show a pic of the bot.  or in the very least, show a pic of the Forward Heading Slider Bar.  We need something to work with here
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on August 18, 2012, 12:21:42 PM
try going into decimals such as math.py*1.5
Hmm, that doesn't work either...
Can I see a picture of the bot?
No, but I'll tell you that it uses omni.py and is the first bot I've ever tried to AI which uses tank tracks, which may be why this is happening. I have no idea if it is for sure and if it is I don't have a clue why, but I don't know what else it could be.

math.pi
 
pi is a number, py is an abbreviation for Python.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on August 21, 2012, 06:14:59 PM
DP-Need more AI help. What fun!
I'd like to know what .py file, wiring setup and smartzone types and names Thunderhead (created by Clickbeetle) has. The reason is that I'm trying to AI a Tazbot replica.

Dig through the first few pages of this thread and you'll find it. It's by Philetbabe (and even comes with its own Tazbot replica)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on August 21, 2012, 06:43:33 PM
DP-Need more AI help. What fun!
I'd like to know what .py file, wiring setup and smartzone types and names Thunderhead (created by Clickbeetle) has. The reason is that I'm trying to AI a Tazbot replica.

Dig through the first few pages of this thread and you'll find it. It's by Philetbabe (and even comes with its own Tazbot replica)
Found it, but sadly, the thread to it has 404'd.
can you post the link ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Fracture on August 21, 2012, 07:03:23 PM
DP-Need more AI help. What fun!
I'd like to know what .py file, wiring setup and smartzone types and names Thunderhead (created by Clickbeetle) has. The reason is that I'm trying to AI a Tazbot replica.

Dig through the first few pages of this thread and you'll find it. It's by Philetbabe (and even comes with its own Tazbot replica)
Found it, but sadly, the thread to it has 404'd.
https://gametechmods.com/uploads/files/tazbot.rar (https://gametechmods.com/uploads/files/tazbot.rar)

?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on August 21, 2012, 07:10:54 PM
ok https://gametechmods.com/forums/index.php/topic,1492.0.html (https://gametechmods.com/forums/index.php/topic,1492.0.html)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Fracture on August 21, 2012, 07:11:21 PM
DP-Need more AI help. What fun!
I'd like to know what .py file, wiring setup and smartzone types and names Thunderhead (created by Clickbeetle) has. The reason is that I'm trying to AI a Tazbot replica.

Dig through the first few pages of this thread and you'll find it. It's by Philetbabe (and even comes with its own Tazbot replica)
Found it, but sadly, the thread to it has 404'd.
can you post the link ?
https://gametechmods.com/forums/showthread.php?t=1492 (https://gametechmods.com/forums/showthread.php?t=1492)
The URL has to be updated, although that's not the one Badnik was talking about.

https://gametechmods.com/forums/index.php/topic,1492.0.html (https://gametechmods.com/forums/index.php/topic,1492.0.html)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on September 09, 2012, 09:37:46 AM
Is there anyway to AI bots using OmniInverted so that they don't have to turn around after they flip themselves over? I'm tired of fighting robots such as Drowning Pool that have to turn around to face me right after they invert themselves. I tried messing around with the nose settings so that the bot's starting position would result in the bot facing the right way right after inverting itself, but the bot then turns around and drives away from the opponent.
I also tried messing around with the drive wiring but still to no avail. Anyone have any other suggestions?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on September 22, 2012, 05:57:19 PM
Does an AI exist with nochassistime and a spin weapon other than flipper2.py?

If not, how easy would it be to incorporate a spinner into Popup.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 123savethewhales on October 19, 2012, 07:41:09 PM
So, what the heck does "Radius" in the binding do anyway?  I changed the number from 0.1 to 20 to 50 and I see no difference.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on October 20, 2012, 05:01:36 AM
What arena have you been testing it in afterward?

From what I rememeber (And bear in mind I've AI'd 1 bot in about 8 months), it basically increases the bearth a bot gives to arena obstacles. The best test is probably the BBEANS arena. This is just from memory but I think it's right.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 21, 2012, 07:38:27 PM
@lightning S
Big name for little AI !
https://gametechmods.com/uploads/files/tazbot.rar (https://gametechmods.com/uploads/files/tazbot.rar)

this is a variant of 'SpinServo AI'. it is  based on Madiaba work.

Here the servo must spin horizontaly only, but you may attach it a spin motor or a fired weapon (piston). In both case, no need of custom zone.

Sample shows  TazBot from DSL 2.1

Fixed : the AI seems to crash the game when the bot is inverted !
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 28, 2012, 07:21:41 PM
Can someone AI this robot with ElectricHammer.py please? Every time I do it the hammer doesn't want to work.

https://gametechmods.com/uploads/files/AI this please.rar (https://gametechmods.com/uploads/files/AI this please.rar)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 13, 2012, 08:34:06 PM
Can someone AI this robot with ElectricHammer.py please? Every time I do it the hammer doesn't want to work.

https://gametechmods.com/uploads/files/AI this please.rar (https://gametechmods.com/uploads/files/AI this please.rar)
Please?

I also need someone to AI a linear actuator crusher, could I get a recommended AI py file for that?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: d-lark on December 30, 2012, 04:49:58 PM
Hey guys, anyone have an idea as to what would make a specific robot give you an abnormal program termination runtime error? The binding is fine, (4 spaces, all the weapons etc) and works just fine for the same sort of bot. I've looked it over, and I can't see anything that would make it crash.. I can open it in the botlab and such fine. I'm really rather lost
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on December 30, 2012, 04:51:47 PM
Make sure the names the same, sometimes that is what causes it for me.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: d-lark on December 30, 2012, 05:02:33 PM
There it is, I had to look in .bot but sure as heck, it had a space after the last number in the name! Found it, thanks for the tip
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: d-lark on December 30, 2012, 10:06:58 PM
Double Post.
Alright this is something I haven't seen before, the AI is a standard Rammer AI used in countless bots fine, but when applied to this particular one, the robot acts.. well, derpy, its nose is fine and it is oriented fine in the arena, but all it does is drive forward into a wall, slowly, when it starts to get counted out, it backs up quickly enough, but then again drives forward. I've searched the bindings but don't know what could be causing this problem for the particular robot, its a very simple Rammer with Forward and LeftRight controls.

Code: [Select]
    list.append(("Narrowhead","Rammer",{'invertible':True,'ThresholdSpeed':1.5,'radius':0.5,'topspeed':100,'throttle':100,'turn':30,'turnspeed':2,'weapons':(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Pwnator on December 30, 2012, 10:39:20 PM
Try increasing the radius.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: d-lark on December 30, 2012, 11:30:38 PM
Thanks, I'd given that a go already to no avail.

What did end up working, was deleting the LeftRight Analog, replacing it again, and re-exporting it, dunno why but it worked, so hooray for that
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on March 07, 2013, 09:37:38 PM
Does anyone know of an AI which combines THZ and omnimultizone?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on March 07, 2013, 09:49:03 PM
Is there anyway to AI bots using OmniInverted so that they don't have to turn around after they flip themselves over? I'm tired of fighting robots such as Drowning Pool that have to turn around to face me right after they invert themselves. I tried messing around with the nose settings so that the bot's starting position would result in the bot facing the right way right after inverting itself, but the bot then turns around and drives away from the opponent. I also tried messing around with the drive wiring but still to no avail. Anyone have any other suggestions?

anyone ever found a solution to this?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on March 23, 2013, 03:52:37 PM
the inverted caster popups such as this:

(https://gametechmods.com/uploads/images/14809heroic.jpg)

Drowning Pool is pretty much just like it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on March 23, 2013, 06:00:17 PM
Quick question, I'm trying to use SwitchWep.py to get a spinner to stop spinning and go to Pusher.py if the weapon breaks, how would I do this?
So is there any way to do this?
Most .pys already auto-switch to Shove/Ram tactics if their spinner breaks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on March 23, 2013, 10:01:37 PM
he means .py files
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: ianh05 on March 24, 2013, 08:03:45 AM
Looking for help AI'ing Clickbeetle's AW Hammer (ElectricHammer.py) in Ultimate Stock AW AI.

Currently I think the main problem is 'StartAngle':math.pi, because this bot uses a front caster and tips over at the start of the match I have no idea what to use as the starting angle for the weapon. Also while I'm here do ElectricHammer.py bots use a button to fire or analog?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on March 24, 2013, 09:44:15 AM
Analog to fire. What is the problem with the bot when AI'ed?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: ianh05 on March 24, 2013, 09:53:44 AM
The weapon seems to get stuck under the bot so I'm not even sure if it's firing. I'm sure it has something to do with the start angle.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on March 24, 2013, 10:36:24 AM
Is the motorid correct?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: ianh05 on March 24, 2013, 11:06:29 AM
Not sure, I'm using this:

    list.append(("AW hammer","ElectricHammer",{'invertible':True,'nose':math.pi*2,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'MotorID':2,'NoChassisTime':2,'StartAngle':math.pi,'SwingTime':5,'weapons':(0,)}))

For this:
https://gametechmods.com/uploads/files/5099Bot2.rar (https://gametechmods.com/uploads/files/5099Bot2.rar)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on March 27, 2013, 12:28:23 AM
Are your weapon IDs listed in the bindings?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on March 31, 2013, 08:00:51 PM
You mean the numbers? If so, then only the ones that I'd need the robot to switch tactics for if it broke (so things like static weapons were not included)


yeah.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on April 07, 2013, 04:12:13 AM
Well, I don't get why it matters so much to have it stop spinning when you have it set up to stop spinning after the DSL bar breaks.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on April 09, 2013, 12:46:32 PM
The weapon IDs used by that piece of code come from the IDs that you gave in your bindings. With that in mind, there shouldn't be any reason for your bot not to switch tactics (assuming that the three IDs that you have listed are correct). On a side note, tactics deal with the movement of your bot and the AI.py deals with controlling the weapon and changing tactics as necessary.

The part that actually tells your AI to stop spinning is actually the "if self.weapons:" line found in the Tick method (in combination with the method that you posted). Once all the weapons that you listed have broken off, the condition becomes false which means that the Spin control is not triggered again.

I suspect that you are using a switch to control the weapon motor. You need to use either an analog controller or button for it to turn off when all the weapons are broken.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on April 10, 2013, 10:08:14 AM
Assuming that you have three weapons that you want to break before switching tactics, it would look something like this "'weapons':(13,14,15)" in the bindings (exactly how you posted it). Just be sure that 13, 14, and 15 are the correct Component IDs (if you aren't already using it, Apanx made a really good tool for getting these).

If it still doesn't work, feel free to PM me the bot file and I'll take a look at it when I get the chance.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on April 10, 2013, 02:55:31 PM
Isn't there also a typhoon spike on the DSL bar?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on April 10, 2013, 03:14:27 PM
After digging through the posts that you made in your showcase, I would say that you want something like this as your bindings:
Code: [Select]
    list.append(("Toxic Wound","Omni",{'range':50,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'weapons':(13,)}))

Just be sure that you are using a button or analog controller named "Spin" instead of a switch (like I previously mentioned).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on June 15, 2013, 09:33:27 PM
I think it's preset because I remember someone making an Arnold the Terminager bot of sort and it would land on its back and wouldn't selfright. Or Rampard sticking the landing in BB6.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 16, 2013, 04:19:02 AM
Quick question. In a line of bindings using omni.py, which is the variable that determines how far over a bot has to tip before it uses its srimech? Or does such a variable exist?

Are you talking about my Heavy Metal entry, by any chance?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on June 21, 2013, 11:27:59 AM
So whenever I AI a rammer, it keeps backing into walls too much in the ring arena. Is there a way to change this in the bindings?
they look like this:
Code: [Select]
    list.append(("Kurt Rambis 2","Rammer",{'ThresholdSpeed':1.5,'SightRange':4,'invertible':True,'radius':0.5,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 25, 2013, 05:17:08 AM
I'm using OmniInverted.py, but my bot doesn't drive when it is righted and the bot continues to fire its inverter constantly. My guess is it is to do with the wiring, but can anyone give me a hand?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on June 27, 2013, 05:48:43 AM
Look in Rammer.py, do you have all the .py's mentioned at the top of it like tactics in your AI folder?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on July 12, 2013, 10:14:56 AM
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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 12, 2013, 10:27:22 AM
Put the bot and AI line up.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on July 12, 2013, 11:03:23 AM
you probably misspelled forward or something.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on July 12, 2013, 12:12:24 PM
Put the bot and AI line up.
https://gametechmods.com/uploads/files/6512Gaze.zip (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,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on July 14, 2013, 01:19:20 PM
I'm pretty sure that you can't change it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on July 14, 2013, 02:41:38 PM
Having a bit of trouble with FBS_2.py, it says in the file that if I enter any number other than 1 for the 'clockwise' value in the bindings, it'll spin left (the way I need it to spin), but I've tried a bunch of different numbers including negatives with no luck. Any tips?

Have you tried -1?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: rnifnuf on July 17, 2013, 05:36:37 PM
Hello and good evening to you.

I really hate to go partially off-topic, but I need some help.

What is this " 'weapons':(x)" nonsense in the bindings? How do I find out what numbers to input in place of x?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: rnifnuf on July 17, 2013, 06:19:44 PM
Thanks, Lightning.

Now I need help with something else:

I have a popup called "Cutting Wedge III" that I am trying to AI. Here is the binding:
Code: [Select]
    list.append(("RNF-0032III Cutting Wedge III","Flipper",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,13,14,15,16,17,18,19)}))Weapons 12-19 are all razors.

Here is the controller:
(https://gametechmods.com/uploads/images/87881CWIII controls.png)
The smartzone is named "weapon". The buttons "Fire" and "Srimech" are both wired to the BSGs.

What do I do to get Cutting Wedge to fire the BSGs?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on July 17, 2013, 08:20:18 PM
I use Omni.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on July 17, 2013, 10:30:44 PM
As Lightning S. mentioned, Flipper.py requires the trigger to be called "Flip" and the smartzone to be called "flip". It is also worth noting that there is no Srimech option.

Omni.py would be a slight upgrade to Flipper.py just because it has a Srimech and the upsidedown checker doesn't work well for Flipper.py (Omni doesn't have one).

Popup.py would be better than both of the above because it only fires when an opponent's chassis enters the smartzone. If you use this, I would recommend adding 'NoChassisTime' with the number of seconds that you want it to have a component in the zone before it will stop waiting for the chassis before attacking.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: rnifnuf on July 18, 2013, 05:37:33 PM
Good evening Trov and Lightning.

I finally got Cutting Wedge to work. Thank you both for the advice :mrgreen:

But now I have another dilemma.

I have a Superheavyweight HS that I AI'ed that crashes the game when the bot loads.

Binding:
Code: [Select]
    list.append(("RNF-0016 Roto Destructo (SHW)","DirectionalSpinner",{'nose':math.pi*2,'radius':0.2,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3,'weapons':(14,15,16,17,18,19,20,21,22,23,24,25)}))Weapons 14-25 are all Large beater bars.

Any tips?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on July 18, 2013, 05:42:47 PM
You need four spaces infront of list.append
    list.append(("RNF-0016 Roto Destructo (SHW)","DirectionalSpinner",{'nose':math.pi*2,'radius':0.2,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3,'weapons':(14,15,16,17,18,19,20,21,22,23,24,25)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on July 18, 2013, 06:37:30 PM
Since it is crashing when the bot loads, I'm guessing that it isn't a problem with spacing but a problem with the name of your bot not matching the name given in the bindings.

DirectionalSpinner is found inside of Spinner.py (a file that comes with RA2). Unless your HS has a Srimech, you can leave it as a DirectionalSpinner with no significant difference in performance (most people use Omni for HS). DirectionalSpinner uses a trigger called "Spin" unless you rename if from in the bindings.

For future reference, please use the BBC tags for code instead of the box tags. I don't mind fixing it but it is obviously better if you do it. If you are on the post screen than it is the button that has a "#" on it. You could also do it manually like so: [code]Your code[/code]

Just for completeness, it looks like this when you post it:
Code: [Select]
Your code
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 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 (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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on July 18, 2013, 07:53:08 PM
Get the bot from Fracture and check the wiring?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hydro 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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hydro on July 28, 2013, 02:13:44 AM
https://gametechmods.com/forums/index.php/topic,11156.0.html (https://gametechmods.com/forums/index.php/topic,11156.0.html)

I downloaded that. I think it's Click's doing.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Paranoia 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)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hydro on July 28, 2013, 09:49:01 AM
Didn't do jack.

Also

(https://gametechmods.com/uploads/images/30009more-info.PNG)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lemonism 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 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.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. 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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. 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?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 05, 2013, 07:13:56 PM
Check the Teams.txt file and make sure everything is exactly right.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. 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
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 06, 2013, 05:01:56 PM
Is who.bmp a 128/128 24-bit bitmap?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on October 06, 2013, 05:15:29 PM
team bindings pls
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. 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!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mystic2000 on October 14, 2013, 12:50:20 PM
i was thinking of a new py file for flippers that i named for now OOTA.py:
So basically when the enemy goes into the flipper smartzone the robot charges to the nearest wall and when close enough, fire the flipper which is going to ensure a quite high degree of OOTA chance

now i have no clue of this is possible
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: AlexGRFan97 on October 14, 2013, 02:05:22 PM
There's already plenty of robots that can score OOTA purposefully. Just fight Second Sentinel in the DSL Tournament Arena for example.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on October 14, 2013, 03:03:33 PM
There's already plenty of robots that can score OOTA purposefully. Just fight Second Sentinel in the DSL Tournament Arena for example.
Nowhere in Second Sentinel's code does it say that it should throw a bot OOTA. It may have a tendency of doing it but it certainly doesn't do it intentionally.  More to point, there currently aren't any AI.py files that throw bots OOTA intentionally.

i was thinking of a new py file for flippers that i named for now OOTA.py:
So basically when the enemy goes into the flipper smartzone the robot charges to the nearest wall and when close enough, fire the flipper which is going to ensure a quite high degree of OOTA chance

now i have no clue of this is possible
You could use Arenas.currentArena.RayTest to try to find walls. Technically, the map files were designed for this type of thing but they are very inaccurate and many arenas don't have them. The problem is that arenas aren't always flat so you would need some funky handling for ramps.

Once you find a wall, you could use self.DriveToLocation to get close to it and fire the weapon once the bot is within some predefined distance. One of the parameters of DriveToLocation indicates whether you want to avoid hazards or go straight through them but there is no distinction between pits and other hazards so you could either be driving straight into pits or giving your opponent more time to escape. To counteract this, I would probably use a combination of GetNearestHazard and RayTest to figure out if it is a pit and base the DriveToLocation on that (updating the boolean for avoiding hazards accordingly as the bot gets close to them).

You may also want to include a threshold for determining if the wall is too far away. The PushOffEdge tactic has a check for this and for determining which bot would be easiest to push but it doesn't work very well (in fact, I'm almost certain that it doesn't behave as intended by its programmer). Personally, I would use it as a reference point but I wouldn't try to modify it to suit your needs because it is way too different.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: MassimoV on November 29, 2013, 02:43:26 PM
How do I AI this?
(https://gametechmods.com/uploads/images/37834gay.jpg)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on November 29, 2013, 03:23:52 PM
electrichammer.py? Just copy/edit bisectors AI from DSL BBEANS AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on January 13, 2014, 02:41:25 PM
Code: [Select]
list.append(("29 minutes to HELL", "Pusher",{'invertible':False,'radius':0.1,'topspeed':100,'throttle':100,'turn':60,'turnspeed':2.5,'weapons':(7,9)}))Doesnt work. Does pusher have a different srimech name or something?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on January 13, 2014, 03:16:26 PM
Pusher doesn't have a srimech. However, OmniRam has everything that Pusher has plus the three basic triggers (Srimech, Fire, and Spin).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on January 14, 2014, 09:27:11 AM
Thanks!
EDIT:
Doesnt work:
Code: [Select]
list.append(("29 minutes to HELL", "OmniRam",{'invertible':False,'radius':0.5,'throttle':100,'turn':55,'turnspeed':2.4,'weapons':(4,5)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on March 07, 2014, 01:50:44 PM
of course i cant ai every time i try to ai it doesnt work.

Code: [Select]
list.append(("For Danny", "Pusher",{'invertible':True,'radius':.5,'turn':20,'turnspeed':1.5,'weapons':(7,)}))
EDIT: fixed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: KOS on March 09, 2014, 01:30:57 PM
I am trying to AI a trinity SnS

Code: [Select]
list.append( ("Nonstop", "FBS_2", {'radius':1, 'invertible': True, 'topspeed' : 100, 'throttle' : 110,'range':5,'fbs_range':15,'clockwise':1,'turnspeed': 1.5, 'weapons': (25, 26) }) )
It fires the pistons and spins clockwise, but it fires the pistons and spins at the same distance, meaning the trinity wont work. (what i'm trying to do is make the pistons fire at a shorter distance than the spin) any help would be appreciated
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on March 09, 2014, 02:14:10 PM
It should be able to work even if you AI it like any other FBS.

example
Code: [Select]
    list.append(("Algae2","FBSInvertDir",{'spinspeed':18,'invertible':True,'direction':1,'nose':0,'radius':0.1,'topspeed':1000,'throttle':1000,'turn':190,'turnspeed':30,'weapons':(0,)}))
Notice mine doesn't have 'range':X, or 'fbs_range':Y
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on March 09, 2014, 02:22:34 PM
Does anyone have EternalFlame.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on March 09, 2014, 05:40:53 PM
Does anyone have EternalFlame.py?
it's in NarAI somewhere.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on March 09, 2014, 06:28:28 PM
Does anyone have EternalFlame.py?
it's in NarAI somewhere.

Not in my NarAI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on March 09, 2014, 06:29:30 PM
Download the latest version?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on March 10, 2014, 06:53:21 PM
https://gametechmods.com/Robot_Exchange/DSL_HW/MassimoV_Spaulding%202.bot (https://gametechmods.com/Robot_Exchange/DSL_HW/MassimoV_Spaulding%202.bot)

Can't for the life of me AI this robot.

(still needing EternalFlame.py)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on March 10, 2014, 10:24:02 PM
https://gametechmods.com/Robot_Exchange/DSL_HW/MassimoV_Spaulding%202.bot (https://gametechmods.com/Robot_Exchange/DSL_HW/MassimoV_Spaulding%202.bot)

Can't for the life of me AI this robot.

have you tried putting the Up Arrow as the postive axis and the down arrow as the negative axis in the controls
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on March 24, 2014, 04:00:11 PM
Thanks!
EDIT:
Doesnt work:
Code: [Select]
list.append(("29 minutes to HELL", "OmniRam",{'invertible':False,'radius':0.5,'throttle':100,'turn':55,'turnspeed':2.4,'weapons':(4,5)}))
ok
so i found the problem with the ai attempts, but with this robot a strange thing happend. when i have an ai match with this robot in it, it wont load. the loading symbol appears and nothing happens until the screensaver appears and the game crashes. it works fine with any other ai or human robot, even when i control this robot

please help
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on March 24, 2014, 04:04:47 PM
there's a space right here:          :thumbdown
list.append(("29 minutes to HELL", "OmniRam",{'invertible':False,'radius':0.5,'throttle':100,'turn':55,'turnspeed':2.4,'weapons':(4,5)}))

Could that be the problem?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on March 24, 2014, 04:31:22 PM
there's a space right here:          :thumbdown
list.append(("29 minutes to HELL", "OmniRam",{'invertible':False,'radius':0.5,'throttle':100,'turn':55,'turnspeed':2.4,'weapons':(4,5)}))

Could that be the problem?
maybe
but
doesnt it crash at the splash screen if there is a coed problem?
ill try it tomorrow g2g
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: System32 on March 25, 2014, 04:33:31 PM
I'm sorta disappointed at the lack of AI file directories.

BBEANS ai has the most but I still think it is missing some AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on March 29, 2014, 05:55:55 AM
there's a space right here:          :thumbdown
list.append(("29 minutes to HELL", "OmniRam",{'invertible':False,'radius':0.5,'throttle':100,'turn':55,'turnspeed':2.4,'weapons':(4,5)}))

Could that be the problem?
maybe
but
doesnt it crash at the splash screen if there is a coed problem?
ill try it tomorrow g2g

doesnt work
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: System32 on March 29, 2014, 10:09:32 AM
It seems like it may be either a probem with your bot or the bot you are fighting it against.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on April 04, 2014, 12:56:04 PM
It seems like it may be either a probem with your bot or the bot you are fighting it against.
i tested it against 5 different bots

and also it works fine when im driving it

and also check my quints (
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: helloface on April 04, 2014, 01:54:10 PM
Have you tried re-exporting it and checking the robot name for spaces and typos?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on April 04, 2014, 02:40:44 PM
https://gametechmods.com/Robot_Exchange/DSL_HW/playzooki_29%20minutes%20to%20HELL.bot (https://gametechmods.com/Robot_Exchange/DSL_HW/playzooki_29%20minutes%20to%20HELL.bot)
have a bot file

you will need nar ai 3 to open it
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on April 13, 2014, 09:57:34 PM
I see no problems with this .bot file or the bindings (other than that space helloface found).  Check that:

- there are 4 spaces before list.append in Bindings.py

- the .bot file is named Bot0.bot, Bot1.bot, or Bot2.bot, etc.

- you actually have OmniRam.py in your AI folder

Edit: Also check that you're using DSL3.  I don't know why you said I need Nar AI 3 to open this bot.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: playzooki on April 14, 2014, 09:37:39 AM
Ah, i musnt have used any nar ai 3 only parts. Ill check tonight.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on April 30, 2014, 09:06:54 PM
Anyone have a download for FBSPlus.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gazea2 on May 01, 2014, 09:34:48 AM
https://gametechmods.com/uploads/files/0321FBSPlus.rar (https://gametechmods.com/uploads/files/0321FBSPlus.rar) :3
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on May 02, 2014, 07:20:46 PM
wasn't there a quick picture that shows where the nose math is in the bot lab?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on May 02, 2014, 07:29:43 PM
ya

(http://i.imgur.com/oaU3Rjy.png)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on May 02, 2014, 08:51:22 PM
can someone tell me what's wrong with these bindings? they just sit there immobolized.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: HurricaneAndrew on May 02, 2014, 09:03:40 PM
can someone tell me what's wrong with these bindings? they just sit there immobolized.


Missing spaces on the first line.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on May 02, 2014, 09:35:31 PM
Are your controls properly named?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on May 02, 2014, 09:44:36 PM
Are your controls properly named?

I found the problem. The people who made Sting Ray (the devs) named the controls for drive "ForwardBack"

I dun goofed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on May 11, 2014, 07:33:02 PM
anyone know how to stop this stuff from showing up when watching fights that involve bots that have laserguidedv2.py as their ai?

(https://gametechmods.com/uploads/images/97307ra2stuff.png)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on May 11, 2014, 07:38:17 PM
anyone know how to stop this stuff from showing up when watching fights that involve bots that have laserguidedv2.py as their ai?

(https://gametechmods.com/uploads/images/97307ra2stuff.png)

My best guess is something with the console (it's one of the function keys iirc.) Not a good guess, but that's all I got.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on May 11, 2014, 07:44:53 PM
Find these lines near the top

Code: [Select]
        # to display the current angle of the servo motor uncomment thoses lines :
        self.debug = True
        AI.SuperAI.debugging = True

and either comment them out or change True to False.  That should do it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Virus Bomb on May 11, 2014, 09:44:14 PM
thanks
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Wolfsbane on May 13, 2014, 07:54:35 PM
I have a question about MeltyBrain. Is it a tactic or AI?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on May 14, 2014, 01:21:50 PM
AI
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Philippa on May 14, 2014, 01:50:35 PM
How do I AI this?
(https://gametechmods.com/uploads/images/37834gay.jpg)
electrichammer.py? Just copy/edit bisectors AI from DSL BBEANS AI.

I have a similar robot that needs AI'd. Can I get the Bindings line for this please? And also what to name the smartzones/controls?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on May 14, 2014, 02:12:24 PM
Surely you could use Frenzy.py?
That uses an analog control named 'Hammer' and the smartzone 'whipzone'. It's basically whipper but with a spin motor, from what I can tell.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on May 22, 2014, 08:44:00 PM
Just curious, but has anyone tried a "take-opponent-to-hazards" py file?

for example
robot in smart zone -> actively aim for hazards instead of avoid them

Might make some wedge matches more interesting.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on May 23, 2014, 02:50:56 PM
you could reduce radius but then again it won't aim actively into hazards.

 i don't think there's any non-arena-specific way to do that though. maybe I am wrong.

also would be very interesting for pushers and most rammers.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on May 23, 2014, 08:34:00 PM
Just curious, but has anyone tried a "take-opponent-to-hazards" py file?

for example
robot in smart zone -> actively aim for hazards instead of avoid them

Might make some wedge matches more interesting.

The 'Shove' tactic that came with the game does this.  It gets appended to most bots after they lose their weapons.  The arena needs to have hazards defined by collision lines and possibly a map file as well for it to work, though.  (I'm not really sure if the arena map files actually do anything.)

IIRC, Shove doesn't work on its own though.  You need Engage and Shove or Charge and Shove.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on June 12, 2014, 02:08:21 PM
I would like to know what I would have to add the .py file so when a bot I stuck on it's front it would fire it's weapons/srimech
Reference pic:
(http://i.imgur.com/5F9XnDp.png)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Clickbeetle on June 13, 2014, 10:08:02 PM
Try this:

Code: [Select]
        if list(plus.getDirection(self.GetID(),0))[1] < -0.9:
            self.Input("Srimech", 0, 1)

Haven't tested it so you may need to fiddle with the exact number.  But that's the code you would use.

Decreasing the number (to a bigger negative number) will make it less sensitive.  It can go up to -1 (the bot is perfectly balanced on its front).  Increasing the number (closer to 0) will make it more sensitive.  For reference, 0 is when the bot is flat on its wheels.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on June 14, 2014, 10:08:06 AM
Seems to work, thanks Click.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on June 20, 2014, 02:26:07 PM
I'm having some difficulty AI-ing Tommy's bot.


(https://gametechmods.com/uploads/images/92885smitejrissue.png)


Bot in thread:
https://gametechmods.com/forums/index.php?topic=16331.msg643329#new (https://gametechmods.com/forums/index.php?topic=16331.msg643329#new)


Bindings:
Code: [Select]
    list.append(("Smite Jr","ElectricHammer",{'nose':math.pi,'invertible':True,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'NoChassisTime':2,'StartAngle':math.pi,'SwingTime':5,'weapons':(0,)}))

According to Tommy, he would like me to AI this bot to behave like Stinger. The problem is I have no idea how to do this, so I used ElectricHammer.py to have it swing back and forth. I also am having the problem where if I pause the game with this bot in the arena, the game crashes in a second.


Am I AI-ing it wrong? Is there something missing in the Bindings? Do I need to modify the analog functions in the wiring? am I excluding something in this explanation?


Thank you.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on June 20, 2014, 04:58:46 PM
Well I got it (sorta) working:
https://gametechmods.com/uploads/files/9742Smite Jr.zip (https://gametechmods.com/uploads/files/9742Smite Jr.zip)

Comes with Smite Jr with controls + smartzone, THZ.py, and binding line.
Turnspeed and turn still needs to be tweaked however.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on June 20, 2014, 05:22:03 PM
I've done some tweaking on the turnspeed and turn, Also for some reason, one wheel clips through the floor on the small arena and I have no idea why.


It does work. Thank you 090901!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on June 20, 2014, 05:27:51 PM
Also for some reason, one wheel clips through the floor on the small arena and I have no idea why.
Probably due to the small arena having very low start points, I'll see if I can raise them.
*Edit* Start points are now 2x higher, should be helpful for large Stock LW vs too: https://gametechmods.com/uploads/files/9751smallarenagmfraisedstartpoints.zip (https://gametechmods.com/uploads/files/9751smallarenagmfraisedstartpoints.zip)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: freeziez on June 25, 2014, 05:00:09 PM
hey guys so i'm finishing bb5 finally because i'm that bad on timing and i'm having trouble AIing the 8 bots I need. All relevant info should be here. I'll send more if it's needed.

https://gametechmods.com/uploads/files/6157AI.zip (https://gametechmods.com/uploads/files/6157AI.zip)

bots are included so you can take a look at them
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on June 27, 2014, 11:43:15 AM
Hopefully this does the trick:

https://gametechmods.com/uploads/files/7803Battlebots 5.zip (https://gametechmods.com/uploads/files/7803Battlebots 5.zip)

Basically the new Bindings for the bots, since I didn't have the DirectionalSpinner.py, the AI codes have been changed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on June 27, 2014, 12:28:11 PM
IIRC, DirectionalSpinner is at the bottom of Spinner.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on November 22, 2014, 06:31:37 PM
I'm pretty sure this question has been asked before, but does anyone have an sample AI line for TRFBD.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yugitom on December 15, 2014, 10:32:55 AM
I have been trying to AI bots with the Popup.py and it's fine until it gets to the 1 count in-game and then my game just crashes. Does anyone know the cause of this?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: martymidget on February 10, 2015, 01:35:05 PM
Got a robut that is wired up correctly, but the weapons won't spin. Everything else is all good.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on February 10, 2015, 02:27:28 PM
Could you put 0 in the weapons category? Will that do anything? If not, then I've got no clue.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on February 10, 2015, 03:30:12 PM
The bindings are just fine and weapon value doesn't matter.

It's either the weapon control which is named wrong (check for spaces!), either the weapon itself that is not wired/poorly wired.

Or maybe it is one of these bots that do not work even if there is nothing wrong with the AI. Sometimes ra2 does that, so just AI it again.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on February 10, 2015, 04:11:21 PM
Is there another robot in your AI with the same name? That causes problems IIRC.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: P3PSl on February 14, 2015, 07:03:05 PM
What would the code be for eternalflame.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on February 14, 2015, 07:13:38 PM
What would the code be for eternalflame.py?
Code: [Select]
list.append(("Enter Bot Name","EternalFlame",{'invertible':True,'flame_range':99,'radius':0.1,'throttle':130,'topspeed':99,'turn':50,'turnspeed':2,'weapons':(0,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: P3PSl on February 14, 2015, 07:13:58 PM
Thank You :D
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on February 14, 2015, 07:15:23 PM
Thank You :D
Make sure you have an analog control connected to the flamethrower called "Flame" too
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on February 16, 2015, 12:29:01 PM
And so the Forward input is wired to flame. The backward input can be let empty.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TakionKasukedo on February 20, 2015, 11:56:49 AM
I cannot seem to play Robot Arena 2 DSL with any of my AI Teams, they don't replace any other robots in the game, it always ends up in a crash or error.

As you can imagine, it's very annoying.

DSL version is 2.2
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on February 20, 2015, 01:18:32 PM
When patching your game, you need to overwrite everything. Skipping or renaming doesn't work.
Title: AI help?
Post by: TheUnknownRobotics on March 31, 2015, 07:32:42 PM
SOLVED

Code: [Select]
import math

def load(list):
    print "Loading AI bindings"

    # binding format:
    # ( 'name of robot from .bot file', 'name of AI from script class',
    #       {'optional constructor parameter':value, 'another':value} )

    # constructor parameters:
    # nose - "front" of bot in radians (default 0)
    # invertible - can function upside-down (default False)
    # topspeed - speed in meters/second AI will attempt not to exceed (default 4.0)
    # throttle - maximum analog value AI will attempt not to exceed (default 100)
    # turnspeed - turning in radians/second AI will attempt not to exceed (default 2.5)
    # turn - maximum analog value AI will attempt not to exceed (default 60)
    # radius - bot radius to use for checking for hazards and walls (default 1.0)

    # 0 - Finished "That's where your bot will be after ten seconds with ours!"
    list.append(("A Torner","Spinner",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':100,'turn':30,'turnspeed':5,'weapons':(8,9)}))
    list.append(("Assassin The Finest","DirectionalSpinner",{'invertible':True,'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':5,'weapons':(13,14,16,17,18)}))
    list.append(("Bang Bang","Rammer",{'nose':math.pi*2,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':5,'weapons':(18,19)}))
    list.append(("Bashur","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(25,)}))
    list.append(("Beast","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(4,)}))
    list.append(("Bolt","Rammer",{'invertible':False,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':80,'turn':25,'turnspeed':1.5,'weapons':(20,)}))

    # 1 - Finished "Badder and still bloodthirsty!"
    list.append(("Clusterbot Spinnys","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5}))
    list.append(("Crank Dat Spine","Whipper",{'invertible':True,'nose':math.pi*2,'radius':0.2,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3.5,'weapons':(10,11,12,13,14,15,16,17,18,19)}))
    list.append(("Cypher","DirectionalSpinner",{'invertible':True,'nose':math.pi*2,'range':500,'radius':1,'topspeed':3,'throttle':130,'turn':60,'turnspeed':5,'weapons':(27,28,29,30,35,36,37,38,39,40,41,42,43,44,45,46,47,48,53,54)}))
    list.append(("DarkNight","Rammer",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5}))
    list.append(("Destiny Is Final","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(24,25,26)}))
    list.append(("Flatire","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(6,23)}))

    # 2 - Finished "Don't need nuthin' but my truck, my shotgun, my new bots, and my REVENGE!"
    list.append(("Force","DirectionalSpinner",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5}))
    list.append(("Foul Lem","DirectionalSpinner",{'nose':math.pi*2,'radius':.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3,'weapons':(3,4,5,6)}))
    list.append(("Frightener","Poker",{'nose':math.pi*2,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':30,'turnspeed':3,'weapons':(22,23,24,25)}))
    list.append(("Fwacker","DirectionalSpinner",{'nose':math.pi,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(17,)}))
    list.append(("Harmless","Poker",{'invertible':True,'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(6,)}))
    list.append(("Lavra","DirectionalSpinner",{'invertible':True,'nose':math.pi*2,'radius':1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,),'sweapons':(28,29,)}))

    # 3 - Finished "If you defeat us again, we will sneak in at night and steal your bots."
    list.append(("No Mercy 4 U","Poker",{'nose':math.pi*2,'range':99,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2,'weapons':(4,5)}))
    list.append(("Nothing Is Everything But Me","DirectionalSpinner",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3.5,'weapons':(9,10)}))
    list.append(("Red Brawler","DirectionalSpinner",{'invertible':True,'nose':math.pi*2,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':1,'weapons':(13,14,15,16)}))
    list.append(("Slam and Dank","Rammer",{'invertible':True,'radius':0.3,'range':2.5,'topspeed':100,'throttle':130,'turn':60,'turnspeed':3,'weapons':(25,)}))
    list.append(("Slam and Dank (Thwack)","Whipper",{'invertible':True,'nose':math.pi,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(19,)}))
    list.append(("Slice and Dice 'em","DirectionalSpinner",{'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(55,)}))

    # 4 - Finished "The BLACK STORM was only getting started with our old bots!"
    list.append(("SpamYou","Spinner",{'nose':math.pi*2,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(19,)}))
    list.append(("Spikez","DirectionalSpinner",{'nose':math.pi*2,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2}))
    list.append(("Stein","Poker",{'nose':math.pi*2,'radius':0.1,'range':99,'topspeed':150,'throttle':130,'turn':60,'turnspeed':4,'weapons':(29,41,42)}))
    list.append(("Tetsuke","Poker",{'nose':math.pi,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':25,'turnspeed':3,'weapons':(7,)}))
    list.append(("Toart","DirectionalSpinner",{'invertible':True,'nose':math.pi,'radius':0.1,'range':99,'topspeed':6,'throttle':60,'turn':60,'turnspeed':2.5,'weapons':(15,)}))
    list.append(("Uproar","Flipper",{'invertible':False,'nose':math.pi,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':30,'turnspeed':3,'weapons':(25,29)}))

    # 5 - Finished "EMERGENCY is back with a vengeance, faster and more furious."
    list.append(("WeSpin","Spinner",{'nose':math.pi*2,'radius':0.1,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(12,)}))
    list.append(("Yayuia","Spinner",{'nose':math.pi*2,'radius':0.1,'topspeed':100,'throttle':130,'turn':130,'turnspeed':5,'weapons':(12,17)}))
Title: Re: AI help?
Post by: RedAce on March 31, 2015, 07:39:21 PM
Can you be a little more specific than "Something is off"? They look just fine and should work as well.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on March 31, 2015, 07:45:25 PM
topic merged with ai topic.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on March 31, 2015, 07:47:06 PM
topic merged with ai topic.
Thx Nary.

@Redace, I open the program, and it seems to crash. I found a few mistake, but it still doesn't open. Every name has been checked and is put in correctly.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on March 31, 2015, 07:49:08 PM
5 turnspeed is way too high for anything that isn't a SnS. Look at some other AI lines (like the ones in Starcore AI v4).

You can also just copy+paste other AI lines and edit the number values and name to lower the chances of it crashing.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on March 31, 2015, 07:52:17 PM
5 turnspeed is way too high for anything that isn't a SnS. Look at some other AI lines (like the ones in Starcore AI v4).

You can also just copy+paste other AI lines and edit the number values and name to lower the chances of it crashing.
Okay (I took these from the DSL, btw). Thanks. Is that what makes the game crash before I can even enter the game?
Dangit, it didn't work. I'm still not sure what's making the game crash right away.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Resetti's Replicas on March 31, 2015, 08:04:23 PM
Have you tried just wiping the offending line and starting from scratch?  When you can't solve the problem with a toothpick, a sledgehammer is the next-best thing.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on March 31, 2015, 08:16:57 PM
Have you tried just wiping the offending line and starting from scratch?  When you can't solve the problem with a toothpick, a sledgehammer is the next-best thing.
Okay, I'll see what I can do with this. Right now, I'm testing team by team. Sadly, I'm in need of sleep. So hopefully after school, It'll be resolved (Teams 0 and 1 are working, just not the nose). BTW, one of my robots goes in circles. Is that because of the controls (though I'm sure through testing it worked in the garage), or is it the turn/nose?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on March 31, 2015, 08:21:25 PM
5 turnspeed is way too high for anything that isn't a SnS. Look at some other AI lines (like the ones in Starcore AI v4).

You can also just copy+paste other AI lines and edit the number values and name to lower the chances of it crashing.
Okay (I took these from the DSL, btw). Thanks. Is that what makes the game crash before I can even enter the game?
Dangit, it didn't work. I'm still not sure what's making the game crash right away.
Amping your turnspeed up too high won't crash your game. Only way I could imagine the turnspeed number crashing your game is if you put it at some stupidly high number, like 999 billion. What's more likely to cause the crash is a misplaced or omitted comma. If you're using notepad++ you might want to turn off auto-indent too, that'll screw your bindings over easily.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on April 01, 2015, 04:58:18 PM
Thankfully, I fixed the problem. I noticed 2 brackets were missing for Lavra.
However, I got one last, easy problem that I can't fix for some reason. "Force" turns on his weapon when the robot goes to them, not automatically in the beginning. I tried putting a Range of 99, 50, taking out range, and even changing DirectionalSpinner to Spinner. I don't know what else I could do. Any help for this. (I am sorry for asking too many things. Hopefully this won't affect me if I ever do a Tourney).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Avalanche on April 04, 2015, 06:11:06 PM
Put range around 500 to ENSURE that it starts right away.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on April 05, 2015, 06:50:45 AM
99 should work.

Maybe it's how you wired it ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on April 05, 2015, 08:55:35 AM
99 should work.

Maybe it's how you wired it ?
No, I wired it "Spin" (No quotations), and I put  99. I'll check it again.
Also, some of my robots spin very late anyways, even with 99 range. What should I do?
(By late, I mean as soon as the robots are touching, the motor spins, doing, like, little to no damage.)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on April 05, 2015, 12:22:48 PM
99 should work.

Maybe it's how you wired it ?
No, I wired it "Spin" (No quotations), and I put  99. I'll check it again.
Also, some of my robots spin very late anyways, even with 99 range. What should I do?
(By late, I mean as soon as the robots are touching, the motor spins, doing, like, little to no damage.)

Are you using an analog or switch instead of a button ?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on April 05, 2015, 03:32:20 PM
99 should work.

Maybe it's how you wired it ?
No, I wired it "Spin" (No quotations), and I put  99. I'll check it again.
Also, some of my robots spin very late anyways, even with 99 range. What should I do?
(By late, I mean as soon as the robots are touching, the motor spins, doing, like, little to no damage.)

Are you using an analog or switch instead of a button ?
I used a button, and I did, in fact, name it Spin. So I have no idea what's wrong.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on April 05, 2015, 03:41:22 PM
Do your robots have "weapon" values in their binding lines? If they don't, their weapons won't spin.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on April 05, 2015, 03:46:13 PM
Do your robots have "weapon" values in their binding lines? If they don't, their weapons won't spin.
... Damn it. I'll be right back. Thx Badnik.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on April 05, 2015, 06:42:56 PM
If you don't wanna find the actual component numbers to use in the weapons section, just put 0 - this corresponds to chassis so the bot will always try to spin the weapons as long as the range is triggered (even if the weapons aren't there)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheUnknownRobotics on April 05, 2015, 09:50:19 PM
If you don't wanna find the actual component numbers to use in the weapons section, just put 0 - this corresponds to chassis so the bot will always try to spin the weapons as long as the range is triggered (even if the weapons aren't there)
Thankfully, it works now. (For some reason, I'm feeling more doubt of starting a tourney, now.)
Hopefully I'll remember this in the future.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Jaydee99 on April 07, 2015, 05:15:18 PM
I may have asked this before but is there an AI for a thwacker hammer thing and a spinner?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on April 09, 2015, 05:08:35 PM
FBSInvertDir will do what I think you're trying to do.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Jaydee99 on April 09, 2015, 05:22:23 PM
Thanks
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on July 01, 2015, 02:49:48 PM
Can someone help me out here? Whenever I start the game with this AI for this bot, the game crashes. What am I doing wrong?

https://gametechmods.com/Robot_Exchange/BW/jaydee99_Kitten.bot (https://gametechmods.com/Robot_Exchange/BW/jaydee99_Kitten.bot)

Code: [Select]
    list.append(("Kitten","Omni",{'nose':math.pi,'invertible':True,'range':50,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'weapons':(0)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yugitom on July 01, 2015, 02:59:09 PM
I don't know but this line works:
Code: [Select]
    list.append(("Kitten","Omni",{'nose':math.pi,'invertible':True,'range':99,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':1,'weapons':(0,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 01, 2015, 03:06:40 PM
Did you remember teams.txt?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yugitom on July 01, 2015, 03:12:10 PM
Did you remember teams.txt?
Doesn't matter. I tried it with teams.txt and it still didn't work. The new AI line works, for some reason, though.

Edit: Just saw what Chris said. Yeah, the comma after the very last 0 needs to be there.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 01, 2015, 03:32:23 PM
Yeah, that comma is prolly it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on July 01, 2015, 08:48:58 PM
Not sure why that works, but that doesn't matter. What matters is that it works. Thanks guys!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on July 02, 2015, 06:42:21 AM
there is a comma missing after the 0 of weapons and i am quite sure this is it

edit: 2slow
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yugitom on July 02, 2015, 06:44:19 AM
edit: 2slow
Not even. You just didn't read the fact a solution was found.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on July 21, 2015, 09:19:24 PM
Few things I've been wondering.
- Is there an AI file that uses drive for a srimech? I've tried just wiring the drive as "Srimech", but once the bot is upright, it's drive stays stuck as if it were still upside-down.
- Is there an AI that uses smartzones to spin a weapon motor?
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on July 21, 2015, 09:27:30 PM
Few things I've been wondering.
- Is there an AI file that uses drive for a srimech? I've tried just wiring the drive as "Srimech", but once the bot is upright, it's drive stays stuck as if it were still upside-down. Somewhat. BountyHunter.py combines driving and fires whatever weapon (typically popup) to self-right. Probably the closest thing you might get.
- Is there an AI that uses smartzones to spin a weapon motor? I believe EcoOmni does this, and it saves battery life.
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it? Yep, and the I believe the button for the inverter needs to wired as "Invert."
Hopefully I helped out.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on July 21, 2015, 09:29:30 PM
1. What do you mean by that? If you mean uses the drive and srimech the bot already has to help flip it over bountyhunter.py may be what you are looking for
2. Yes, it's in NarAI and is called "SZspinner.py"
3. No, it just has the bot drive inverted once the srimech breaks, the newest version of Popup.py supports upside-down driving and I believe it just uses the srimech to flip the bot over, if you want a version of it that also supports spinning weapons I have a version I threw together for one of my bots like a year ago.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: G.K. on July 21, 2015, 09:39:03 PM
- Is InvertOmni.py the AI that flips the robot, then fights? If so, is there a specific way to wire it?

Do you still have my bot Mockery Of The Whole Concept from your previous tourney a couple of years ago? I'd open that up and see how that was wired. Make sure it's the AI'd version Trov did, because I found the version I had originally sent you the other day in my Robot Designs folder and that was wired all over the place.

As 090901 says, the newest version of Popup.py has a feature which will use the srimech to invert the bot, if you're after something simple.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on July 21, 2015, 11:33:19 PM
Thanks guys, but I'm still running into stuff. I managed to find a workaround to using drive as a srimech, but SZspinner doesn't spin the weapon motor even though I named the smartzone accordingly and unfortunately I don't still have G.K.'s bot, so idk how to get a bot to upright itself using popup.py. Anyone know this stuff?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on July 22, 2015, 12:16:20 AM
From the notes in Popup.py
Code: [Select]
#Set variable 'RunUpsideDown' to 1 for bots that flip over at the beginning of the match and fight upside down.  Such bots must be invertible as well.
# UPDATE 7/4/11: Added support for upside down bots, conditional invertibility, and made AI fire srimech if the bot is stuck on its rear.

I checked and the newest version of EcoOmni does support smartzones, check the .py files for the notes on how to do it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on July 22, 2015, 01:53:50 AM
That second line of code was initially missing from the .py I was using; turns out I had outdated versions of both AI files. Thanks for pointing that out.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on August 08, 2015, 05:15:37 PM
I'm trying to AI an SnS, but I want it to spin in the opposite direction from normally. What portion of the AI line in FBSPlus.py or FBSInvertDir.py determines the direction of the spin?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Mr. AS on August 08, 2015, 05:18:09 PM
I'm trying to AI an SnS, but I want it to spin in the opposite direction from normally. What portion of the AI line in FBSPlus.py or FBSInvertDir.py determines the direction of the spin?
'direction':1

1 = clockwise, -1 = counterclockwise
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on October 23, 2015, 05:00:55 PM
I need a different AI for one of the robots for Pot Luck 2 (Guess which). What I need is other.py (Littlemetalfriend) but for it to raise a linear actuator up to its max when nothing is in the smartzone.

Any ideas?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Silverfish on October 23, 2015, 09:48:32 PM
well, i'm not the best at aiing, but i think you may have to program your own.  :rage
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: cephalopod on October 24, 2015, 03:37:33 AM
Could you do something with something like omnimultizone and wire a whole load of other smartzones further out in a ring to rise the actuator? Bit of a dodgy solution, I will admit.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on October 31, 2015, 04:46:18 PM
So I've been trying to AI this Ironforge Kheper style bot, but what I've given it is wonky as hell.  Can someone help out with this bot (https://gametechmods.com/uploads/files/8291FFR.rar)? 

Thanks in advance.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on November 03, 2015, 12:19:00 PM
I need a different AI for one of the robots for Pot Luck 2 (Guess which). What I need is other.py (Littlemetalfriend) but for it to raise a linear actuator up to its max when nothing is in the smartzone.

Any ideas?

Don't use smartzones to emulate stuff better handled by code. Make a variant of the Littlemetalfriend.py code You'll figure it out...

From:
Code: [Select]
    def Tick(self):
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0]
        if len(targets) > 0:
            # TODO: squeeze and push? or whip?
            self.Input("Lefthook", 0, -100)
            self.Input("Righthook", 0, -100)
        else:
            # TODO: open arms back up?
            self.Input("Lefthook", 0, 0)
            self.Input("Righthook", 0, 0)
           
        return AI.SuperAI.Tick(self)


To:
Code: [Select]
    def Tick(self):
        targets = [x for x in self.sensors.itervalues() if x.contacts > 0]
        if len(targets) > 0: #When stuff in smartzone. Push Kill trigger
            self.Input("Kill", 0, 1)
        else: #When smartzone empty, Fully raise lineal acutator
            self.Input("RaiseLinAcu", 0, 100)
           
        return AI.SuperAI.Tick(self)

You can also use self.GetPistonPosition(ID of piston) to make the AI not touch pistons when fully raised.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on November 08, 2015, 10:22:54 AM
I'll be honest, ai'ing is not my forte. I plugged the changed code into a copy of other.py and tried to run it with appropriate control name changes (Kill, RaiseLinAcu), and the game just crashed.

Edit: It's semi working now after I changed the AI register names, but if you could tell me how to use self.GetPistonPosition(ID of piston) so it can stop being a walking havok bomb that'd be great.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on November 14, 2015, 01:34:16 PM
Anyone know where I can find DirectionalSpinner.py?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on November 14, 2015, 01:35:42 PM
Anyone know where I can find DirectionalSpinner.py?
IIRC, DirectionalSpinner is at the bottom of Spinner.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on November 14, 2015, 09:37:43 PM
Anyone know where I can find DirectionalSpinner.py?
IIRC, DirectionalSpinner is at the bottom of Spinner.py
derp
thanks
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on February 27, 2016, 04:13:39 PM
I'm using omni.py and I want my bot to fire its weapon once inverted, in order to self-right. How would I do this?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on February 27, 2016, 04:17:20 PM
Separate control called srimech?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on February 27, 2016, 04:18:42 PM
I'm using omni.py and I want my bot to fire its weapon once inverted, in order to self-right. How would I do this?
Make a sepearte button labeled "Srimech" or use OmniS.py made by Joeblo.

Edit: 2slow.  D:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on February 27, 2016, 04:26:41 PM
ty senpais
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Silverfish on February 27, 2016, 04:33:30 PM
If it's a popup, just change the variable RunUpsideDown to 1 and invertible to true (use popup.py). otherwise, i have no idea.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Calmarius on April 28, 2016, 04:24:23 PM
Hi there,

I'm using popup.py for my popup bot (which I took from the starcore 4 ai pack, I don't know where can I find the latest version of it), and noticed that weapons fire only when the chassis of the opponent enters the smart zone but not when the chassis is inside it. This means if my popup bot shoves up the opponent before the razors retract, the opponent can sit on the top of my bot without firing the weapons.

Is it possible to fix this, somehow or do you know an update version of this file?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on April 28, 2016, 05:39:10 PM
So once a bot is on top of the popup it no longer fires? That's never happened with popup.py for me. What's your AI line?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Calmarius on April 29, 2016, 12:55:34 AM
By AI line you mean the line in the bindings.py?

    list.append(("BWOD Micro 2","Popup",{'radius':0.1,'topspeed':99,'throttle':130,'range':99,'turn':50,'turnspeed':2,'weapons':(1,2,3)}))

To demonstrate it, add a huge smart zone for the weapon, when the opponent enters the smart zone, the weapons fire once, and won't fire again until the robot exits the smart zone an reenter again. So it looks like an event handling problem to me.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on April 29, 2016, 02:30:46 AM
I can't test for myself as I don't have access to a PC right now. Do you have the same issue with other ai's popups (for example those that came with the AI pack). If so it might be an old version of the AI. I'm sure popups work fine in BBEANS AI if you want to look at that.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on April 29, 2016, 06:31:36 PM
Hi there,

I'm using popup.py for my popup bot (which I took from the starcore 4 ai pack, I don't know where can I find the latest version of it), and noticed that weapons fire only when the chassis of the opponent enters the smart zone but not when the chassis is inside it. This means if my popup bot shoves up the opponent before the razors retract, the opponent can sit on the top of my bot without firing the weapons.

Is it possible to fix this, somehow or do you know an update version of this file?
Let me have a look at the popup.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Naryar on April 29, 2016, 06:41:40 PM
Apanx :O

All hail !
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Calmarius on May 01, 2016, 12:58:54 PM
Quote
Let me have a look at the popup.py

Here it is:

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

class Popup(AI.SuperAI):
    "Like Omni, but fires its weapon only upon smartzone contact with an opponent's chassis."
    name = "Popup"

    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
               
        self.zone1 = "weapon"
        self.triggers1 = ["Fire"]
        self.triggers2 = ["Srimech"]

        if 'zone' in args: self.zone = args['zone']
       
        if 'triggers' in args: self.triggers1 = args['triggers']
        if 'triggers' in args: self.triggers2 = args['triggers']

        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(self.zone1, 1)
           
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon

        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
                       
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.triggers2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0
               
    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)

    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if chassis:
                if direction == 1:
                    for trigger in self.triggers1: self.Input(trigger, 0, 1)
        return True
   
AI.register(Popup)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on May 01, 2016, 01:21:21 PM
This code is messed up. It contains superfluous stuff under Tick. You can't specify Weapon trigger separately from Srimech trigger. SmartZoneEvent is only triggered when something enters or leaves the Smartzone.
If you want to use it. Remove this part
Code: [Select]
    def SmartZoneEvent(self, direction, id, robot, chassis):
        if id == 1 and self.weapons:
            if chassis:
                if direction == 1:
                    for trigger in self.triggers1: self.Input(trigger, 0, 1)
        return True

Replace this part
Code: [Select]
    def Tick(self):
        # fire weapon


        targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
                       
        bReturn = AI.SuperAI.Tick(self)
       
        return bReturn

With this
Code: [Select]
    def Tick(self):
        # fire weapon
        if self.weapons:
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
                       
            if len(targets) > 0:             
                for trigger in self.triggers1: self.Input(trigger, 0, 1)
           
        return AI.SuperAI.Tick(self)

Also, separate Weapon triggers from Srimech triggers, Replace this:
Code: [Select]
        if 'triggers' in args: self.triggers2 = args['triggers']With
Code: [Select]
        if 'srimech' in args: self.triggers2 = args['srimech']
And make smartzone name changeable in bindings, replace this:
Code: [Select]
        if 'zone' in args: self.zone = args['zone']With
Code: [Select]
        if 'zone' in args: self.zone1 = args['zone']
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Calmarius on May 03, 2016, 02:45:48 PM
Ok made the changes except the SmartZoneEvent thing.

The goal of the popup.py is hitting other bot only when the chassis is within the smart zone. Do you have info what does the arguments for this SmartZoneEvent method mean?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: yugitom on May 03, 2016, 03:00:35 PM
The goal of the popup.py is hitting other bot only when the chassis is within the smart zone.
Isn't that just Omni? Or, any other .py with smart zones involved?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on May 03, 2016, 03:56:13 PM
get the newest version of popup.py that is on the beetlebros site in the AI essentials pack. (link to it on the main page of gtm) and use that one and use a binding line with 'NoChassisTime"
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on May 03, 2016, 04:16:35 PM
What does nochassistime actually do?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on May 03, 2016, 05:31:18 PM
What does nochassistime actually do?

It waits for specified time (1=0.5secs) before activating trigger if enemy robot is in zone, but the chassis is outside. If not specified, it is 1 sec .

Ok made the changes except the SmartZoneEvent thing.

The goal of the popup.py is hitting other bot only when the chassis is within the smart zone. Do you have info what does the arguments for this SmartZoneEvent method mean?
Yes but the code for SmartZoneEvent is messed up. It won't work. It is updated in the later pack. The changes in Tick won't do anything if SmartZoneEvent is not fixed.
direction, is 1 when stuff enters and -1 when stuff leaves zone
id, ID of smartzone, usually 1 for robots, unused in robot AI code, more important for arenas.
robot, ID of robot in zone
chassis, true if chassis of robot is in zone.

The newer Popup.py is better, but some of the old changes still apply if you want to separate Weapon from Srimech triggers.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on June 20, 2016, 05:10:23 AM
Yo can someone explain the differences between all the meltybrain .pys? I remember one version I used seemed to try to flank the other bot, but the version I'm using ATM just charges straight at them.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on June 20, 2016, 09:58:39 AM
Not sure which ones you mean.
Please link them and I'll check them out.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on June 20, 2016, 10:01:33 AM
Wow, apanx is here still.
I didn't know there was more than one meltybrain py to begin with.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on June 20, 2016, 10:05:22 AM
https://gametechmods.com/uploads/files/8061FBS PYs.7z (https://gametechmods.com/uploads/files/8061FBS PYs.7z)

Mainly wondering the differences between the first 3 and the analogue one.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on June 20, 2016, 10:30:43 AM
FBS is my old creation modded by Naryar to spin in the same direction no matter inverted status.
https://gametechmods.com/forums/index.php?topic=2191.msg54748#msg54748

FBS_1 and FBS_2 are made by Madiaba, not as good as FBS ;)

FBSFlame is FBS but with a Analog input named Flame pegged at 100.
FBSPlus is a FBS and can include a spinning weapon attached to an Switch control. It also uses a larger tickInterval to reduce CPU usage (and accuracy).
FBSInvertDir is FBSPlus but it spins in opposite direction when inverted.
FBSAnalog is a FBSInvertDir but using an Analog control instead of a Switch for the spinning weapon.




Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on June 20, 2016, 10:31:58 AM
Thanks apanx!
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on June 25, 2016, 03:42:45 PM
How would I AI a servo piston lifter? I am trying Other.py but it is just moving the pistons to their max extension straight away and this is causing it to havok.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on June 26, 2016, 05:21:25 AM
Depends on what you want it to do.
Extend pistons to maximum when a bot is inside a smartzone or something else?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Conraaa on June 26, 2016, 07:49:11 AM
I would like the pistons to stay at their starting point initially and extend to maximum when a robot is inside the smartzone. And then return to starting point when nothing is in the smart zone.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hi5er on July 01, 2016, 09:06:34 AM
Hi guys, I need some advice on weapon bindings...

I'm trying to AI my drum bot from my showcase. I basically copy and pasted Neglected Waterbugs AI from Starcore v4, but I don't understand why NWB has code like "weapons":(1,2,3,4,5,6,7, etc), because he has two spinners, nothing more.

My drum bot works with this code, I just don't understand why it has to be like that, why not Weapons 1,2 (for the 2 ZTek motors powering the drum?). I read the ai pack thing from the tutorial index, but it talks about weapon ID's, how do I know the ID's of the weapons i'm using?  I can't see that we can actually assign anything a number to then quote from the bindings text file anyway?

Sorry for the questions, but I'm actually (I would say) an intermediate level coder in actionscript 2.0 and C++, so I just need everything to make sense for me to understand it haha...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on July 01, 2016, 09:39:07 AM
The weapon numbers correspond to all the components you want the AI to consider as weapons. Once all of those are knocked off the AI will switch tactics, usually to shove but some AIs might use secondary weapons (sweapons) etc...
Commonly people use the weapon id 0 which corresponds to the chassis so the AI will never switch tactics, which is normally fine.

To find weapon IDs you can count down components in the bot file or use the bot exporter.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hi5er on July 01, 2016, 10:16:34 AM
The weapon numbers correspond to all the components you want the AI to consider as weapons. Once all of those are knocked off the AI will switch tactics, usually to shove but some AIs might use secondary weapons (sweapons) etc...
Commonly people use the weapon id 0 which corresponds to the chassis so the AI will never switch tactics, which is normally fine.

To find weapon IDs you can count down components in the bot file or use the bot exporter.

Thanks for the reply.

So for example, if I had a base plate extender, 20cm black extender, 1x Razor on the end. I could essentially assign the AI weapons 1,2,3 so it would consider all 3 a weapon?

Could you clarify what the Bot Exporter is? Is it simply when you export a bot from the bot lab and open the corresponding file in something like notepad? Then just count the components down from there?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 01, 2016, 10:26:03 AM
The bot exporter is this old thing
https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=97
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on July 01, 2016, 01:05:56 PM
See link above for bot exporter. It gives all the components numbers in a nice format.

Then in the AI line you specify which components must fall off before the AI considers the weapon system destroyed and will change tactic. As I said it's not always necessary to bother.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hi5er on July 01, 2016, 01:23:17 PM
The bot exporter is this old thing
https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=97

Thanks for this, I also feel privileged getting a reply from 1 of only 38 of your messages ever in 10 years.

I have downloaded and extracted the application and saved it to the main Robot Arena file on my desktop, but I get the following error when I try and run it:

(https://s32.postimg.org/hzu9nlahx/Bot_Exporter_App_2.png)
(https://s31.postimg.org/fq58mw4wb/Bot_Exporter_App.png)

I'm running on Windows 10.

See link above for bot exporter. It gives all the components numbers in a nice format.

Then in the AI line you specify which components must fall off before the AI considers the weapon system destroyed and will change tactic. As I said it's not always necessary to bother.

So if I AI'd my bot to say an, "Omni" with "weapons": (0) or whatever syntax it requires, that's basically saying. "You are an Omni until component 0 falls off", a.k.a The Chassis? Which won't happen haha...

Which I suppose I'll have to do if I can't get the app to run.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 01, 2016, 01:49:06 PM
You need the VB6 runtime to use the exporter
https://support.microsoft.com/en-us/kb/957924
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Hi5er on July 01, 2016, 01:57:36 PM
You need the VB6 runtime to use the exporter
https://support.microsoft.com/en-us/kb/957924

Thanks support!  :smile:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 16, 2016, 04:29:58 PM
So I've been trying to AI my first bot, using Spinner.py from the AI Pack for a drum bot.

I customized it a bit calling it Modspinner(replaced all "Spinner" in the py file as well, no crashes) but even with that I'm having trouble to getting my bot to spin, it doesn't spin at all(same happens with the default Spinner.py from Stock) the spinner motors do have a button control called Spin yet it doesn't work for some odd reason.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on July 16, 2016, 04:35:23 PM
You sure it's a capital S on the control? Try using omni.py. Ifyou still can't get it to worm PM it to me and I'll take a look.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 16, 2016, 04:41:24 PM
You sure it's a capital S on the control? Try using omni.py. Ifyou still can't get it to worm PM it to me and I'll take a look.
Yes it's a capital S, didn't work with omni, here's the line in Bindings.py:
list.append( ("Mega Gator", "Omni", { }) )
Think I'm missing some values here?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Squirrel_Monkey on July 16, 2016, 04:46:33 PM
It might not spin up as you haven't given it a weapons parameter. Go look at another AI line and compare.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 16, 2016, 04:53:53 PM
It might not spin up as you haven't given it a weapons parameter. Go look at another AI line and compare.
Thought the weapons parameter was only required for it to stop attacking once a certain part ID breaks, how would I make it keep attacking even if every weapon breaks?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 09090901 on July 16, 2016, 04:57:14 PM
It might not spin up as you haven't given it a weapons parameter. Go look at another AI line and compare.
Thought the weapons parameter was only required for it to stop attacking once a certain part ID breaks, how would I make it keep attacking even if every weapon breaks?
set it to 0, the chassis
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 16, 2016, 05:08:38 PM
It might not spin up as you haven't given it a weapons parameter. Go look at another AI line and compare.
Thought the weapons parameter was only required for it to stop attacking once a certain part ID breaks, how would I make it keep attacking even if every weapon breaks?
set it to 0, the chassis
Works now(had that before but didn't notice it during testing)but only if I get really close to it(after that it keeps on spinning)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 09090901 on July 16, 2016, 05:19:00 PM
if it's still not spinning up instantly then it might be because you don't have a range parameter. try a line like this:

    list.append(("Mega Gator","Omni",{'invertible':True,'range':99,'topspeed':99,'turnspeed':3,'throttle':130,'weapons':(0,)}))

also use a button instead of a switch. with a button the ai will just keep turning it on and off.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 16, 2016, 05:25:06 PM
if it's still not spinning up instantly then it might be because you don't have a range parameter. try a line like this:

    list.append(("Mega Gator","Omni",{'invertible':True,'range':99,'topspeed':99,'turnspeed':3,'throttle':130,'range':99,'weapons':(0,)}))

also use a button instead of a switch. with a button the ai will just keep turning it on and off.
Works now, thanks guys, thought that this parameter might be missing but didn't want to mess around more with it(already had the game crash like 10 times because of multiple errors), it is a button and not a switch(are there even switch controls for AI? think only buttons exist) full line is this:
list.append( ("Mega Gator", "ModSpinner", { 'range':99, 'weapons': (0,) }) )
The other parameters are optional so I didn't add them.(also you have range twice?) Do top/turn speed and throttle go past the values that the bot would normally be able to get or do they keep those limits/only work for slowing the bot down and making it more controlable?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 18, 2016, 01:26:22 PM
Would it be possible to create a bot that only starts using it's second weapon once the enemy hp reaches 0 or the first weapon(set via ID) breaks down?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 18, 2016, 02:36:23 PM
if it's still not spinning up instantly then it might be because you don't have a range parameter. try a line like this:

    list.append(("Mega Gator","Omni",{'invertible':True,'range':99,'topspeed':99,'turnspeed':3,'throttle':130,'range':99,'weapons':(0,)}))

also use a button instead of a switch. with a button the ai will just keep turning it on and off.
Works now, thanks guys, thought that this parameter might be missing but didn't want to mess around more with it(already had the game crash like 10 times because of multiple errors), it is a button and not a switch(are there even switch controls for AI? think only buttons exist) full line is this:
list.append( ("Mega Gator", "ModSpinner", { 'range':99, 'weapons': (0,) }) )
The other parameters are optional so I didn't add them.(also you have range twice?) Do top/turn speed and throttle go past the values that the bot would normally be able to get or do they keep those limits/only work for slowing the bot down and making it more controlable?

Top speed and turn speed is just a max limit, they don't make the bot go faster than possible just for making the bot more controllable. Throttle, (and Max Turn) are capped at 100.

Would it be possible to create a bot that only starts using it's second weapon once the enemy hp reaches 0 or the first weapon(set via ID) breaks down?
Yes. It is possible.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Jet-speed on July 24, 2016, 06:45:44 AM
Trying to find my way around the bot file.

Say I want to find the component IDs for my weapons so that my bot switches tactics upon being deweaponed, what value am I looking for exactly? Out of this for example:

Weapon
Components\dao40.txt
21
4
1
0 0 0
0 3.55271e-015 0 1
3.14159 0

Have I even segmented that properly? Took a stab in the dark. I think that's the Knife component in Ironforge? Who knows, confuzzled.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 24, 2016, 06:47:17 AM
Count number of objects, the first one after the chassis has ID 1.
Or use the exporter, it is simpler.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Jet-speed on July 24, 2016, 07:06:06 AM
Eh, getting VB6 set up on windows 10 looks like more effort than it's worth as someone who's computer illiterate and would have no use for it other than the exporter, as great a tool as it is.

I think I've sussed the bot file now, thanks for the help. :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on July 24, 2016, 07:59:53 AM
VB6 outputs programs as a simple .exe, which should work on all Windows systems, right? Assuming you have the correct C++ redistributable but you almost certainly already do.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 24, 2016, 08:06:20 AM
VB6 outputs programs as a simple .exe, which should work on all Windows systems, right? Assuming you have the correct C++ redistributable but you almost certainly already do.
I was going to make a post saying that the X(VB6) runtimes are needed to run all X(in this case VB6) applications, so having them on your pc definitely wouldn't hurt.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 29, 2016, 10:46:03 AM
Would it be possible to create a bot that only starts using it's second weapon once the enemy hp reaches 0 or the first weapon(set via ID) breaks down?
Yes. It is possible.
How would one do that? I'm also interested on how you would read other stuff about the enemy bots, like their current rotation(based on their default forward heading),changing tactics depending on time left or being able to rotate your own bots servo motors until they reach a certain degree.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 29, 2016, 12:56:35 PM
By exploiting functions of the plus-class for fun and profit and code a custom Python AI.
Bind a button for secondary weapon. Use plus.GetHealth(BotID,0) to find HP and insert custom tactic to switch to when Enemy HP is 0 or all primary weapons are lost.
Use plus.getHeading(botID, useOffset) to get the Heading of the enemies, compare with your own to find their heading in comparison with yours.
Don't think there is a nice way to find time left, but maybe plus.getTimeElapsed could be used to change tactics based on time. A better way would be to maybe compare enemy points with your own and cower when in lead.
Use plus.AI.GetMotorAngle(MotorComponentID) to find the current servomotor angle. The first page in this thread explains usage.

There are a lot of good stuff buried in this thread, but it is worth reading through if you want to create custom AIs.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on July 29, 2016, 01:02:59 PM
By exploiting functions of the plus-class for fun and profit and code a custom Python AI.
Bind a button for secondary weapon. Use plus.GetHealth(BotID,0) to find HP and insert custom tactic to switch to when Enemy HP is 0 or all primary weapons are lost.
Use plus.getHeading(botID, useOffset) to get the Heading of the enemies, compare with your own to find their heading in comparison with yours.
Don't think there is a nice way to find time left, but maybe plus.getTimeElapsed could be used to change tactics based on time. A better way would be to maybe compare enemy points with your own and cower when in lead.
Use plus.AI.GetMotorAngle(MotorComponentID) to find the current servomotor angle. The first page in this thread explains usage.

There are a lot of good stuff buried in this thread, but it is worth reading through if you want to create custom AIs.
Thanks a lot, I'll try to mess around with those before I ask for more help. Is there a document or a page somewhere? It would make it much easier(which is the reason why I'm adding all my bots to the main post in the showcase) than browsing the entire thread in hopes of finding something.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 04, 2016, 11:55:19 AM
I'm having a little AI issue with only limited time to fix(still should be plenty), basically the AI I'm using works a bit like a push bot, pushing the other around. Combat performance has been great so far, however the problem is the countdown, if that one happens the bot sometimes turns when moving backwards and ends up with the side sticking in the opponent's direction, it doesn't rotate to face the opponent again, giving them a easy win.
Think this problem happens with almost all of the AI and the easiest solution would probably be to make it face the enemy all the time/when moving backwards?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 04, 2016, 11:58:35 AM
Add a StuckHandler and InvertHandler and put in your own code there. Standard is to move forward and backward when stuck or inverted. Some bot have InvertHandler code to fire SRMs or do other stuff. Facing the enemy when moving backwards leads to driving of the edge, a hazard, sticking into the wall.
Anyways, it would be easier to see whats wrong if you post the python file for the AI.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 04, 2016, 12:06:26 PM
Add a StuckHandler and InvertHandler and put in your own code there. Standard is to move forward and backward when stuck or inverted. Some bot have InvertHandler code to fire SRMs or do other stuff. Facing the enemy when moving backwards leads to driving of the edge, a hazard, sticking into the wall.
Anyways, it would be easier to see whats wrong if you post the python file for the AI.
I'm still rather new to all this, so adding own commands will probably be out of question for now. The AI file I'm using is still the basic EternalFlame, might change some stuff to create my own one but it's currently only that.
Driving backwards would be the right thing to do and fair instead of pinning the opponent, the front(nose) is the default one(0?) so maybe code that tells the nose to face the way the other bot is would be enough?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 09, 2016, 12:23:08 PM
I might not have been enough clear before, but what happens is that the bot turns sideways just like it sometimes happens when driving a robot backwards(apparently that happens in IRL as well), I'd want to correct that so that it faces the enemy instead of sitting there sideways ready to get attacked. Even if the driving off the edges issue would be there(which I think would happen anyways with the default AI) I'd still want that as that robot is only going to fight in closed, no hazard arenas.

A different problem that I'm having with a 2wd robot is that it seems to "shuffle" to move, first moves left side, then right, making it very easy to get attacked. Thought that adding radius would fix it, but it's still doing that.
list.append( ("", "", {'radius':1.0,'invertible':False,'range':99,'weapons': (0,) }))
Also where can one find the latest AI files? I've got AI Chart 2.3, and while that mentions popup.py it doesn't have one. The one from Starcore AI v4 seems to only fire when something enters that zone(so if the chassis enters it fires once but then stops), think that was mentioned some time before in this thread. Jaydee's seems to crash the game.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on August 09, 2016, 12:28:17 PM
Sounds like your bot is turning too fast and is having to continuously correct itself. Try reducing the turn value in the bindings.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 09090901 on August 09, 2016, 12:29:48 PM
anyone know of a .py that works like fbs_2, but reverses direction while inverted and isn't a meltybrain .py?

@ro1 this has alot .pys
http://beetlebros.gametechmods.com/files/AIessentials.zip

alot of ai packs like ASAI have a ton .pys aswell
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 09, 2016, 12:30:23 PM
The bot drives well manually? What AI does it use? Does that AI use the Engage tactic (like 90% of all AIs)
What might be happening is that the AI overshoots its intended heading as the bot turns too quick for the standard tickInterval. Either cap turnspeed, maximum Turn input, or increase tickInterval.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 09, 2016, 12:30:39 PM
Sounds like your bot is turning too fast and is having to continuously correct itself. Try reducing the turn value in the bindings.
I wonder why that happens to begin with. Both bots start on one side of the arena so they should move in a straight line. Isn't it supposed to use the wired Forward key instead of using the motors independently? And wouldn't that have a negative impact on turning for Left/Right movement?

The bot drives well manually? What AI does it use? Does that AI use the Engage tactic (like 90% of all AIs)
What might be happening is that the AI overshoots its intended heading as the bot turns too quick for the standard tickInterval. Either cap turnspeed, maximum Turn input, or increase tickInterval.
It's a popup which uses popup.ai, I've had a similar thing happen with my VS before and both of them drive well manually.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 09, 2016, 01:27:20 PM
anyone know of a .py that works like fbs_2, but reverses direction while inverted and isn't a meltybrain .py?
Something like this ;)
https://github.com/apanx/RA2_AI/blob/master/SnS_2Invertible.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 09, 2016, 05:26:54 PM
Tried messing around with turn and turnspeed(which made it worse), turn didn't seem to help but what's odd is that if my bot starts in the player 1 spawn of the combat arena it drives in a straight line, player2's start point however does that shuffling.
Also what about the moving backwards straight/always face the AI and best place to get the most updated AI files?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 09090901 on August 09, 2016, 05:40:58 PM
anyone know of a .py that works like fbs_2, but reverses direction while inverted and isn't a meltybrain .py?
Something like this ;)
https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=265
Yeah, thanks apanx
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on August 09, 2016, 06:07:50 PM
Tried messing around with turn and turnspeed(which made it worse), turn didn't seem to help but what's odd is that if my bot starts in the player 1 spawn of the combat arena it drives in a straight line, player2's start point however does that shuffling.
Also what about the moving backwards straight/always face the AI and best place to get the most updated AI files?
Can you send me the bot? I'd like to have a crack at it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 16, 2016, 07:19:04 AM
Excuse me if this is rude, but can I finally get an answer to the "always face the bot even when moving away" problem as well as the py AI files?
I honestly don't care if my bot drives into hazards/the pit/off the arena as long as it doesn't stop moving in that position, facing the AI sideways, after moving backwards.

As for the AI files, I've heard that the AI Chart was the most up to date one/what's usually used, but that one's missing the popup(and probably a few other) files(by the way, said bot I'm trying to fix isn't a popup), isn't there a master py AI pack that everyone uses?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 16, 2016, 10:55:12 AM
Not sure how many Python coders we still have active in the community. I do RA2 python for fun, and rewriting the entire drive logic to do something else than turning towards target and driving forward is going to time to do, mostly testing to make sure that everything works as intended. I have a rough idea of what commands in the available python commands would be useful, but there are a lot of questions remaining. For example, when should the bot move forward or backwards? Through what data would it decide that?
The most basic code would just be aiming for enemy and setting Forward to 100. The bot would always try facing the enemy and attempt to move forward. Take a look at the existing python files and try to do something like that. I am currently too busy to spend time on RA2, might maybe look at it during the end of next week. Hope you understand.

The closest thing to a master AI pack is the AI_essentials on Beetlebros' site.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 16, 2016, 02:06:40 PM
Not sure how many Python coders we still have active in the community. I do RA2 python for fun, and rewriting the entire drive logic to do something else than turning towards target and driving forward is going to time to do, mostly testing to make sure that everything works as intended. I have a rough idea of what commands in the available python commands would be useful, but there are a lot of questions remaining. For example, when should the bot move forward or backwards? Through what data would it decide that?
The most basic code would just be aiming for enemy and setting Forward to 100. The bot would always try facing the enemy and attempt to move forward. Take a look at the existing python files and try to do something like that. I am currently too busy to spend time on RA2, might maybe look at it during the end of next week. Hope you understand.

The closest thing to a master AI pack is the AI_essentials on Beetlebros' site.
I didn't know this, take all the time you need as that's way more important than any of this AI stuff. I only wanted for this to not go under in all the posts here like it somewhat already did.
While having a new drive logic that instantly targets the enemy would be interesting(and definitely something I'd like to do later) I'd want to simply fix the "stuck" part so that the robot doesn't stop driving backwards, facing sideways.
Would you be ok if I sent you a video, showing what goes wrong, in PM?

I'll try to mess around with it for a bit, the Unstuck Tactic is inherited from Tactics.py? I've noticed that Eternal Flame(which is apparently based on Omni.py) doesn't have a Stuck Handler.
I checked AI_essentials, that doesn't really have that many, so I guess all those AI files were done on a version of another AI file, guess that means it's best to copy over something that works and ask if it doesn't work/if you can't find something?

I hope that this community can get this AI file chaos a bit more sorted/get more into python files because it seems like most only copy something that works from a similar bot and are then done with it. Thanks for doing all this for the community.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on August 16, 2016, 05:44:11 PM
phil's semi-famous AI chart that comes with a bunch of .py files (https://gametechmods.com/uploads/files/43968459AI-Chart-23.rar)

All the .py files that come with Nar AI 2.7, IIRC some of them don't work. (https://gametechmods.com/uploads/files/4816py files.zip)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 16, 2016, 06:29:18 PM
I didn't know this, take all the time you need as that's way more important than any of this AI stuff. I only wanted for this to not go under in all the posts here like it somewhat already did.
While having a new drive logic that instantly targets the enemy would be interesting(and definitely something I'd like to do later) I'd want to simply fix the "stuck" part so that the robot doesn't stop driving backwards, facing sideways.
Would you be ok if I sent you a video, showing what goes wrong, in PM?

I'll try to mess around with it for a bit, the Unstuck Tactic is inherited from Tactics.py? I've noticed that Eternal Flame(which is apparently based on Omni.py) doesn't have a Stuck Handler.
I checked AI_essentials, that doesn't really have that many, so I guess all those AI files were done on a version of another AI file, guess that means it's best to copy over something that works and ask if it doesn't work/if you can't find something?

I hope that this community can get this AI file chaos a bit more sorted/get more into python files because it seems like most only copy something that works from a similar bot and are then done with it. Thanks for doing all this for the community.
Check the AI files that come with the game. All AI inherit the SuperAI which is located in __init__.py in the AI folder. If you don't put in separate handlers, then the code in the SuperAI will be used.
Also check out the Tactics.py.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 16, 2016, 07:18:39 PM
phil's semi-famous AI chart that comes with a bunch of .py files (https://gametechmods.com/uploads/files/43968459AI-Chart-23.rar)

All the .py files that come with Nar AI 2.7, IIRC some of them don't work. (https://gametechmods.com/uploads/files/4816py files.zip)
What's the difference between 8459AI-Chart-2.3.rar and 43968459AI-Chart-23.rar? I checked your link and like the one I have it's still mentioning popup.py and missing it(like I said about a page ago), size of the rar also seems to be the same. I'm not annoyed, I just find it funny, was someone like "I'm tired of all those popups, there, file deleted, have fun"  :laughing one of the most used designs isn't there. Will check Nar AI 2.7.

Check the AI files that come with the game. All AI inherit the SuperAI which is located in __init__.py in the AI folder. If you don't put in separate handlers, then the code in the SuperAI will be used.
Also check out the Tactics.py.
Thanks, will do.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on August 16, 2016, 07:26:07 PM
phil's semi-famous AI chart that comes with a bunch of .py files (https://gametechmods.com/uploads/files/43968459AI-Chart-23.rar)

All the .py files that come with Nar AI 2.7, IIRC some of them don't work. (https://gametechmods.com/uploads/files/4816py files.zip)
What's the difference between 8459AI-Chart-2.3.rar and 43968459AI-Chart-23.rar? I checked your link and like the one I have it's still mentioning popup.py and missing it(like I said about a page ago), size of the rar also seems to be the same. I'm not annoyed, I just find it funny, was someone like "I'm tired of all those popups, there, file deleted, have fun"  :laughing one of the most used designs isn't there. Will check Nar AI 2.7.
No idea what's different. phil probably just forgot to include Popup.py when he complied it all like 6 years ago, plus that's before it was really popular to use.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 27, 2016, 06:31:13 PM
I think I've found out the issue I had with my bot not turning.
Basically both bots would end up in a situation where one is pinned to the wall, countdown starts and the bot that's pinning drives away. Because the other bot couldn't move that much now, the countdown is still going on for it while it starts driving forwards. In the meantime the other bot that drived away stopped driving in a rotated position(because the code tells it to not move if the other bot is getting counted out before it), giving the pinned bot a free hit.
Guess I'll just have to remove the "do nothing when other bot gets counted out" part.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 29, 2016, 12:46:08 PM
More testing shows it's definitely that. Problem is, as far as I understand, that this is inherited from tactics.py or other files, and I have no idea how to overwrite that behaviour so that the robot keeps on targeting the AI, doesn't help that I only have like two days for the tournament, but please do the more important things in life first, doesn't matter if I lose this.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Trovaner on August 29, 2016, 08:25:47 PM
Just copy the Unstuck class form Tactics.py, call it "Unstuck2", remove the check that you don't want, and add these two lines to the __init__ method of your AI.py:
Code: [Select]
self.RemoveTactic("Unstuck")
self.tactics.append(Tactics.Unstuck2(self, self.StuckHandler()))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on August 29, 2016, 11:58:30 PM
Put in your own Stuck Tactic in the py for your bot and don't mess with Tactics.py
https://gametechmods.com/forums/index.php?topic=2207.msg55033#msg55033

Code: [Select]
self.RemoveTactic("Unstuck")
self.tactics.append(Unstuck2(self, self.StuckHandler()))

Code: [Select]
   
class Unstuck2(AI.Tactic):
    name = "Unstuck2"
   
    def __init__(self, ai, unstuck_function):
        self.UnstuckFunction = unstuck_function
        AI.Tactic.__init__(self, ai)
       
    def Evaluate(self):
        # try to move if we're immobile and we either have no enemy
        #  or he was pinned after us
        self.priority = 200
       
        ai = self.ai
       
        # move to free ourselves unless our most recent enemy was stuck first
        if not ai.bImmobile: self.priority = -1000
        elif ai.GetID() in ai.immobile_list and \
            ai.enemy_id in ai.immobile_list and \
            ai.immobile_list[ai.GetID()] > ai.immobile_list[ai.enemy_id]:
                self.priority = -1000
       
    def Execute(self):
        self.ai.Throttle(0)
        self.ai.Turn(0)
        self.UnstuckFunction.next()
               
        return True

I have made a rudimentary Flee Tactic that always point the bot towards the enemy and drives backwards. It needs a lot of work before it is good, but still.
Code: [Select]
class Flee(AI.Tactic):
    name = "Flee"
   
    def Evaluate(self):
        self.priority = 0
        self.target_id, range = self.ai.GetNearestEnemy()
       
        # TODO: come up with a priority scale for "engaging"
       
        if self.target_id != None:
            self.priority = 170
        else:
            self.priority -= 1000
               
    def Execute(self):
        if self.target_id != None:
            self.ai.enemy_id = self.target_id
           
            # default turning & throttle off
            self.ai.Throttle(0)
            self.ai.Turn(0)
           
            target = plus.getLocation(self.target_id)
           
            # try to get out of range of chassis...
            if self.ai.GetDistanceToID(self.target_id) < 40 and self.ai.GetDistanceToID(self.target_id) > 10:
               # ... then aim for center of chassis
               h = self.ai.GetHeadingTo(target, False)
               self.ai.AimToHeading(h)
               self.ai.Throttle(-100)
            if self.ai.GetDistanceToID(self.target_id) < 10:
               h = self.ai.GetHeadingTo(target, False)
               self.ai.AimToHeading(h + math.pi / 2)
               self.ai.Throttle(-100)
            return True
        else:
            return False
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on August 30, 2016, 03:43:52 PM
Thanks guys, will try to build them into the py file.
I did read the tactics.py some time ago and remember reading about the unstuck handler, however when searching it yesterday I searched for time or countdown and couldn't find it because of that, think apanx also once mentioned how you can add something that then overwrites the default behaviour.

The driving backwards while always pointing towards the enemy tactic is nice, will try to work with it and try to learn this AI stuff so I won't have to ask "how to do X".
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Philippa on October 02, 2016, 02:54:10 PM
(https://gametechmods.com/uploads/images/90399screenshot_3.jpg)
Code: [Select]
    list.append(("Drunken Robot Pornography","LittleMetalFriend",{'nose':math.pi,'radius':0.5,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(0,)}))
https://gametechmods.com/uploads/files/5864Bot5.rar (https://gametechmods.com/uploads/files/5864Bot5.rar)


Saw on a servo, dunno how to get the arm working right, needs to self-right, riddled with AGOD.
Anyone know how to help? Please and thank you.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on October 05, 2016, 06:52:57 PM
I think an adaptation of OmniServo would fit best, it might need some adjustments so work optimally for the bot.
https://github.com/apanx/RA2_AI/blob/master/OmniServo.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on October 12, 2016, 02:52:58 PM
(https://gametechmods.com/uploads/images/90399screenshot_3.jpg)
Code: [Select]
    list.append(("Drunken Robot Pornography","LittleMetalFriend",{'nose':math.pi,'radius':0.5,'range':99,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(0,)}))
https://gametechmods.com/uploads/files/5864Bot5.rar (https://gametechmods.com/uploads/files/5864Bot5.rar)


Saw on a servo, dunno how to get the arm working right, needs to self-right, riddled with AGOD.
Anyone know how to help? Please and thank you.
Just curious, how did you get it working

Also OmniServo.py "verticvaly" just a minor detail :P
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on October 12, 2016, 03:55:28 PM
Well, don't just stand there, fix it.
Fork, commit, do pull request
http://crunchify.com/how-to-fork-github-repository-create-pull-request-and-merge/

https://github.com/apanx/RA2_AI/
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on October 12, 2016, 04:29:14 PM
Well, don't just stand there, fix it.
Fork, commit, do pull request
http://crunchify.com/how-to-fork-github-repository-create-pull-request-and-merge/

https://github.com/apanx/RA2_AI/
I do have a github account even and understand the basics, but still felt like this is such a minor thing that it's better done in a bigger change instead of filling up the changelog like that(at least that's what I was once told, still think it depends on case) is it possible to do a pull request without adding the file to one's own github?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 29, 2016, 11:09:25 PM
Code: [Select]
    list.append(("Casualty","Bee",{'invertible':True,'nose':math.pi,'whip':around,'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'range':99,'weapons':(1,2,3,4,5,6,7,8,9,10,11,12)}))
Every single robot past this bindings line crashes the game, including this one. What's the deal?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on October 30, 2016, 07:05:41 AM
You missed some double quotes for the whip function specification
Code: [Select]
    list.append(("Casualty","Bee",{'invertible':True,'nose':math.pi,'whip':"around",'topspeed':99,'throttle':130,'turnspeed':2.5,'turn':60,'radius':0.3,'range':99,'weapons':(1,2,3,4,5,6,7,8,9,10,11,12)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 02, 2016, 08:32:24 AM
Managed to edit together a new AI code. No idea if this has been done before, but I figured it'd be useful.

https://gametechmods.com/uploads/files/7620WimpOmni.rar (https://gametechmods.com/uploads/files/7620WimpOmni.rar)

This AI, as you can probably tell by its name, is a small variation on the standard Omni py file. Instead of switching to the Shove tactic when its weapons runs out, it instead switches to Evade (which is within Tactics_2.py, which I've included in the rar for ease of access). So instead of suiciding onto the opponent's remaining weapons, it runs away.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on November 02, 2016, 02:40:02 PM
Modified and added to repo
https://github.com/apanx/RA2_AI/blob/master/WimpOmni.py
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 04, 2016, 08:46:32 PM
Anyone have an AI .py file that works with full-body spinners? Not SnS, I'm talking something like this:

(https://images-2.discordapp.net/.eJwFwdENhCAMANBdGICWBiq6DUGC5pQSqPHjcrvfe1_zjMts5lDtcwPYz5ll7HaqjFSLrSL1Kqmf02a5IammfNyl6QTCldiFyMyIHCgikPdEzuGCzoc1cmB42qfJ22xv1fz-BT0izw.ZNPuJeLVSfiOAJzw54srbQ7CIDI)
where the chassis spins, but the drive doesn't.

I talked to apanx on discord about it but it doesn't seem like there's one readily available. I'm still kinda clueless about the whole python thing (the one i posted a few days ago was a pretty easy copy/paste job) so I'm basically stuck.

Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: R01 on November 05, 2016, 01:14:48 PM
Anyone have an AI .py file that works with full-body spinners? Not SnS, I'm talking something like this:

(https://images-2.discordapp.net/.eJwFwdENhCAMANBdGICWBiq6DUGC5pQSqPHjcrvfe1_zjMts5lDtcwPYz5ll7HaqjFSLrSL1Kqmf02a5IammfNyl6QTCldiFyMyIHCgikPdEzuGCzoc1cmB42qfJ22xv1fz-BT0izw.ZNPuJeLVSfiOAJzw54srbQ7CIDI)
where the chassis spins, but the drive doesn't.

I talked to apanx on discord about it but it doesn't seem like there's one readily available. I'm still kinda clueless about the whole python thing (the one i posted a few days ago was a pretty easy copy/paste job) so I'm basically stuck.
I guess the regular HS ones won't work for some reason because the AI's using the chassis for directions?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on November 05, 2016, 01:58:03 PM
Anyone have an AI .py file that works with full-body spinners? Not SnS, I'm talking something like this:

(https://images-2.discordapp.net/.eJwFwdENhCAMANBdGICWBiq6DUGC5pQSqPHjcrvfe1_zjMts5lDtcwPYz5ll7HaqjFSLrSL1Kqmf02a5IammfNyl6QTCldiFyMyIHCgikPdEzuGCzoc1cmB42qfJ22xv1fz-BT0izw.ZNPuJeLVSfiOAJzw54srbQ7CIDI)
where the chassis spins, but the drive doesn't.

I talked to apanx on discord about it but it doesn't seem like there's one readily available. I'm still kinda clueless about the whole python thing (the one i posted a few days ago was a pretty easy copy/paste job) so I'm basically stuck.
I guess the regular HS ones won't work for some reason because the AI's using the chassis for directions?
Yes, obviously.


Maybe you could try AI-ing it like a non-melty SnS, so it just spins in place then moves when its getting counted out?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on November 05, 2016, 07:48:34 PM
https://youtu.be/yJN7XCPvQlc
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Starcore on February 05, 2017, 02:42:10 AM
Managed to edit together a new AI code. No idea if this has been done before, but I figured it'd be useful.

https://gametechmods.com/uploads/files/7620WimpOmni.rar (https://gametechmods.com/uploads/files/7620WimpOmni.rar)

This AI, as you can probably tell by its name, is a small variation on the standard Omni py file. Instead of switching to the Shove tactic when its weapons runs out, it instead switches to Evade (which is within Tactics_2.py, which I've included in the rar for ease of access). So instead of suiciding onto the opponent's remaining weapons, it runs away.

Bump

Glad to see people are still using and adapting my Omni.py

Didn't know if it was still useful for people to AI their bots or if they had moved to something majorily different. That was some 12ish years ago.

Starcore
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Meganerdbomb on February 06, 2017, 11:39:02 AM
Managed to edit together a new AI code. No idea if this has been done before, but I figured it'd be useful.

https://gametechmods.com/uploads/files/7620WimpOmni.rar (https://gametechmods.com/uploads/files/7620WimpOmni.rar)

This AI, as you can probably tell by its name, is a small variation on the standard Omni py file. Instead of switching to the Shove tactic when its weapons runs out, it instead switches to Evade (which is within Tactics_2.py, which I've included in the rar for ease of access). So instead of suiciding onto the opponent's remaining weapons, it runs away.

Bump

Glad to see people are still using and adapting my Omni.py

Didn't know if it was still useful for people to AI their bots or if they had moved to something majorily different. That was some 12ish years ago.

Starcore
Yeah omni is still the standard for most bots.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: IceCreamRulez on May 04, 2017, 08:37:12 AM
I've got a question. Is it possible for me to do some AI-ing for the Robot Wars 2013 AI Pack? I've noticed that there are 3 copies of The Bull in the AI Teams and I want to replace 2 of them with my Dextrus and Granite Grinder replicas. But because it's just a beta, I'm not sure if it's possible to do it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on May 04, 2017, 12:34:16 PM
what

every copy of ra2 is the same, you can ai in all of them
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: IceCreamRulez on May 05, 2017, 03:38:07 PM
Never mind it's fine. While scrolling through the Robot Wars 2013 AI Pack thread, I found some files that Wham had uploaded which contained the AOD and ED robots. Beckatron and Dextrus were in those files and since they were AI-d, I figured I could just add them to the mod  :mrgreen: Still no sign of The Plague though, no idea where that one is at.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Asbestosstar on May 12, 2017, 09:38:34 PM
If I were to start my Tournament, would anyone AI for me?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Gulden on May 12, 2017, 09:45:17 PM
If I were to start my Tournament, would anyone AI for me?
I'm afraid not...

3)   If you cannot AI, do not start a thread until you have found someone who is willing to AI for you learn how to! The best place to ask for help is the General Tournament Discussion Thread.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on October 11, 2017, 08:05:27 PM
Managed to edit together a new AI code. No idea if this has been done before, but I figured it'd be useful.

https://gametechmods.com/uploads/files/7620WimpOmni.rar (https://gametechmods.com/uploads/files/7620WimpOmni.rar)

This AI, as you can probably tell by its name, is a small variation on the standard Omni py file. Instead of switching to the Shove tactic when its weapons runs out, it instead switches to Evade (which is within Tactics_2.py, which I've included in the rar for ease of access). So instead of suiciding onto the opponent's remaining weapons, it runs away.
do you know if there's a way to get this ai to evade without losing any components first?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 12, 2017, 01:31:04 AM
yeah, just replace engage (the standard tactic) with evade
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on October 13, 2017, 11:31:15 PM
in the bindings?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on October 18, 2017, 05:01:16 PM
in the .py itself
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on October 18, 2017, 05:26:24 PM
i changed all the "engage"s to "evade"s in the wimpomni py file and that didn't seem to do anything. is there a specific line/lines i need to copy and paste over?
sorry if these are stupid questions btw
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Asbestosstar on October 18, 2017, 06:56:44 PM
Managed to edit together a new AI code. No idea if this has been done before, but I figured it'd be useful.

https://gametechmods.com/uploads/files/7620WimpOmni.rar (https://gametechmods.com/uploads/files/7620WimpOmni.rar)

This AI, as you can probably tell by its name, is a small variation on the standard Omni py file. Instead of switching to the Shove tactic when its weapons runs out, it instead switches to Evade (which is within Tactics_2.py, which I've included in the rar for ease of access). So instead of suiciding onto the opponent's remaining weapons, it runs away.

Bump

Glad to see people are still using and adapting my Omni.py

Didn't know if it was still useful for people to AI their bots or if they had moved to something majorily different. That was some 12ish years ago.

Starcore
Wow, YOu made that?

I cant belive, i still use it. IT AWWSOME
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: PopsicleStick :D on October 21, 2017, 01:43:31 AM
I didn't took enough time time (an hour maybe) to search about "How to determine a component ID in the bindings.py file", but I couldn't find any info about that. So actually, how DO you (or I,whatever), determine a component ID? :confused:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Fracture on October 21, 2017, 09:53:35 AM
Do you mean how to fill out the weapons tuple for a bot's AI line, like 'weapons':(16,17,18,19)? Easiest way is to download apanx's .bot exporter as it tells you all the components and their corresponding IDs. Or you can go into the file with Notepad++ and count in which order each component was attached with the first attached component being ID 1.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: PopsicleStick :D on October 21, 2017, 02:25:20 PM
Do you mean how to fill out the weapons tuple for a bot's AI line, like 'weapons':(16,17,18,19)? Easiest way is to download apanx's .bot exporter as it tells you all the components and their corresponding IDs. Or you can go into the file with Notepad++ and count in which order each component was attached with the first attached component being ID 1.
Nice man!! I should be doing that tomorrow right after I wake up, err... Thanks a lot Fracture! I actually already came across the bot exporter but never thought it would be useful :claping
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on November 09, 2017, 01:51:31 PM
trying to ai a heroic  sacrifice type bot (the kind that flips then fights because they run upside down). inverts just fine, but this happens once it's up:
https://www.youtube.com/watch?v=p5jsKQIciS4
bindings:
Code: [Select]
    list.append(("BANNED","Popup",{'nose':math.pi,'invertible':True,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'NoChassisTime':2,'RunUpsideDown':1,'weapons':(0,)}))

please help me
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badnik96 on November 09, 2017, 01:58:08 PM
looks like your drive is wired backwards and your turnspeed is too high
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Lightning S. on November 09, 2017, 02:23:53 PM
working now, thanks. wondering if i can make it more aggressive though, as its smartzone is kinda high up and it just stops moving forward upon simply touching another bot
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: jdg37 on November 30, 2017, 07:35:45 PM
So any ideas for AIing a Gabriel style vertical thwack? Maybe same as TRFBD?

Trying to run it like Gadreel from SoG, but that AI seems currently mia with Rob.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on November 30, 2017, 09:10:03 PM
link to overhead thwackbots ive made with ai if you want to look at it (https://gametechmods.com/uploads/files/4216badgers_angels.zip)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: SagarisRA2 on December 01, 2017, 07:06:44 AM
https://gametechmods.com/uploads/files/4216badgers_angels.zip (http://overhead thwack bots i've made with ai for you to look at)

Link doesn't work for me
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on December 01, 2017, 08:38:37 AM
fixxed
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: jdg37 on December 01, 2017, 11:28:53 AM
Gracias, will hopefully test this evening
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: RedAce on July 07, 2018, 03:54:43 PM
So I'm having a bit of trouble AI'ing this thing.  By that, I mean the weapon really doesn't want to work.  I was suggested to fix the MotorID, I messed around with the StartAngle, and yet it doesn't want to attack.  Anyone know how to fix this?

 [ This attachment cannot be displayed inline in 'Print Page' view ]  

Code: [Select]
    list.append(("Executioner","Judge",{'beta':-64000,'MotorID':0,'StartAngle':-math.pi/2,'reload':5,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':2.5,'weapons':(0,)}))
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: apanx on July 08, 2018, 09:04:07 AM
Set MotorID to the component ID of the spinmotor for the weapon. Setting it to 0 is wrong.
Check the basic things as well: Hammer spinmotor wired to analog control named Hammer, smart zone named weapon

Also negative beta applies constant downward force on the robot using plus.force
Avoid setting turn to 100 as this makes the minimum input on Turning to 100, which leads to crabbing motions when combined with low turnspeed.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: FOTEPX on August 11, 2018, 02:08:10 AM
How do I get the 'weapons' value right at the end of a bot's AI string? I want to have a bot that, once it loses all it's weapons, it runs inverted - I'll program the .py, just need to know how to get the weapons value right so it properly detects when it's lost them.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Pwnator on August 11, 2018, 02:26:36 AM
Use apanx's bot exporter (https://gametechmods.com/forums/downloads/?sa=view;down=97).
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: CrustyRaisins on February 04, 2019, 03:52:14 PM
How would I AI a robot with a geared beta motor and a flaming hammer?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Redalert on February 04, 2019, 04:13:04 PM
That's rather tricky, but...
>wire a button titled "Fire" to the flamethrower and hammer. Have the hammer fire down.
>wire another button titled "Srimech." Have it move the hammer back to the loaded position.
>Incorporate your chassis into the hammer so this works properly, and use an Omni binding for it.

Still not getting it? ask me to post a tutorial about it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: pokebro14 on February 04, 2019, 04:52:48 PM
dont ask him to make a tutorial on it.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on February 04, 2019, 07:13:03 PM
what redalert said is 100% wrong, if you're going to ai something with a geared beta you'll want to use electrichammer.py or thz.py and wire the flamethrower to the same analog control that controls the forward hammer swing.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: CrustyRaisins on February 05, 2019, 08:51:40 AM
Ok, thanks 090901. Do you know where I can find those scripts?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on February 05, 2019, 10:05:47 AM
Ok, thanks 090901. Do you know where I can find those scripts?
https://github.com/apanx/RA2_AI - This link contains all the latest versions of all the AI files the community has made for RA2

Click the green "Clone or Download" button, then click "download ZIP". Extract all the files inside the .zip into the AI folder of your RA2 install.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Billy5545 on February 05, 2019, 04:16:56 PM
what redalert said is 100% wrong, if you're going to ai something with a geared beta you'll want to use electrichammer.py or thz.py and wire the flamethrower to the same analog control that controls the forward hammer swing.
Just curious, but what about the Judge py? Because IIRC, I have been AI'ing my hammerbots that uses geared beta with the Judge py, according to the beta rep on DSL
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 090901 on February 05, 2019, 04:31:48 PM
forgot about that one, yeah it works too
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: CrustyRaisins on February 06, 2019, 08:17:21 PM
Which script would I use for a bot with a saw on a retractable arm? (like S.O.B. or SawBlaze)
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: IceCreamRulez on February 22, 2019, 08:30:55 AM
I need some help. I've been trying get Gravity's flipper to work in RWRA2 for months on end and still nothing is working. I've tried using different smart zones, renaming the controls, changing the bindings but Gravity just won't flip. The bot itself is controlling just fine, it's just the flipper won't work despite me putting a smart zone in.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: 09090901 on February 22, 2019, 05:10:49 PM
did you name the smartzone accordingly?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: IceCreamRulez on February 22, 2019, 07:16:37 PM
Yes. I named the smartzone as flip and the control as flip (also tried changing them both to fire but to no avail) as well. Every other robot that I've AI'd with a flipper has worked fine, it's just Gravity that doesn't seem to want to cooperate.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: TheRoboteer on February 22, 2019, 07:20:53 PM
Yes. I named the smartzone as flip and the control as flip (also tried changing them both to fire but to no avail) as well. Every other robot that I've AI'd with a flipper has worked fine, it's just Gravity that doesn't seem to want to cooperate.
The control should be Flip with a capital F
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Badger on February 23, 2019, 04:05:00 AM
Yes. I named the smartzone as flip and the control as flip (also tried changing them both to fire but to no avail) as well. Every other robot that I've AI'd with a flipper has worked fine, it's just Gravity that doesn't seem to want to cooperate.
The control should be Flip with a capital F
Just as a note, this is for Flipper2.py. Omni.py should have the smartzone be named "weapon" and the control called "Fire". Smartzones are all lowercase, controls have their first letter capitalised.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Yoloskater224 on February 23, 2019, 05:19:31 PM
On The topic of making an AI With a flaming hammer, i don't really understand? What do you call the controlls, and what do you mean "put the flame and the hammer on the same one"  :dead:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Billy5545 on February 23, 2019, 05:49:43 PM
On The topic of making an AI With a flaming hammer, i don't really understand? What do you call the controlls, and what do you mean "put the flame and the hammer on the same one"  :dead:
It's named Fire for both the hammer and flamethrower. And the flamethrower and hammer are wired to a single control since it's both easier to AI and the flamethrower is supposed to activate when the hammer fires
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Yoloskater224 on February 23, 2019, 05:50:57 PM
Cool thanks!  :beer:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Yoloskater224 on February 23, 2019, 06:26:33 PM
Hate to double post, and i don't mean to keep asking questions but where do you find the MotorID for different motors? i've checked different files and throught the component .txt file things but i cant seem to find it anywhere...  :confused:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Billy5545 on February 23, 2019, 07:58:57 PM
Hate to double post, and i don't mean to keep asking questions but where do you find the MotorID for different motors? i've checked different files and throught the component .txt file things but i cant seem to find it anywhere...  :confused:
You have to count the components manually in the bot file,as the ID is based on the order you put the components. The MotorID is the same as component ID. First component placed has the ID of 1, with chassis being 0.

Alternatively, you can use Apanx's Bot Exporter, which is far easier to find ID's
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: IceCreamRulez on March 04, 2019, 04:56:25 PM
Got Gravity's flipper working. The problem? The control was named "fire" instead of "flip"  :facepalm:
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: KidDelta on March 05, 2019, 06:46:33 AM
Got Gravity's flipper working. The problem? The control was named "fire" instead of "flip"  :facepalm:
OOF
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Redalert on April 29, 2019, 02:04:26 PM
Sorry to bump-
What's the difference between a flipper and an omni binding, in how it performs? I know the weapon controls and smartzones are labeled different, but is there really anything special about the flipper binding, or can I just use the omni to Ai a flipper bot?
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: UberPyro on April 29, 2019, 04:01:57 PM
from the very top of clickbeetle's flipper2.py

Quote
# Flipper2.py last updated 7/24/12 by Clickbeetle
# Update 7/24/12: Renamed this file to Flipper2.py so Flipper.py is not overwritten.  Added customizable srimech firing interval.

# This AI will act normally as long as the opponent is moving.  If the opponent stops moving, this AI will also stop and wait for the opponent to be counted out.  If the opponent starts moving again, so will this AI.  In a rumble, this AI will ignore any bots that aren't moving and will only stop if all opponents stop.
# Has support for two smart zone-based weapons and one analog-controlled spinner.  Name the smart zones "flip" and "weapon" and the controls "Flip", "Fire", and "Spin".  "Srimech" control for self-righting.  Note you must put 'UseSrimech':1 in Bindings.py to self-right with the Srimech control; otherwise it will use Flip.
# CUSTOMIZABLE SETTINGS:
# 'EnemyMoveRadius' sets how far the enemy must move in order to be considered mobile.  Default is 1.
# 'EnemyMoveTime' sets how long (in seconds) the enemy has to move the required distance before being considered immobile.  Default is 3.
# 'PrioritizeFlipper' if set to 1, the AI won't fire the other weapon until the flipper fires.  Useful for bots that use the flipper to get under opponents.  When all of self.weapons are lost, the flipper will stop firing and the other weapon will fire even when the flipper doesn't.  The flipper component id's should therefore be set in self.weapons and no other id's for this to work.  Default is 0.
# 'NoChassisTime' sets how long (in half-seconds) the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.  ONLY WORKS FOR SECONDARY WEAPON, NOT FLIPPER so wire the bot and name the controls like you are using Omni or Popup.py if you use this.  Default is 1.
# 'SrimechInterval' sets how often the AI fires the srimech when attempting to self-right.  Srimech will fire once every X seconds.  Default is 1.
it tries to be smart by not flipping things that are immobilized
the stock flipper.py is mostly the same thing except without the extra controls to fire, spin, and srimech. I'm not sure how well it works though and at the end of the day I don't think the ai is that important.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Redalert on April 30, 2019, 08:40:38 AM
from the very top of clickbeetle's flipper2.py

Quote
# Flipper2.py last updated 7/24/12 by Clickbeetle
# Update 7/24/12: Renamed this file to Flipper2.py so Flipper.py is not overwritten.  Added customizable srimech firing interval.

# This AI will act normally as long as the opponent is moving.  If the opponent stops moving, this AI will also stop and wait for the opponent to be counted out.  If the opponent starts moving again, so will this AI.  In a rumble, this AI will ignore any bots that aren't moving and will only stop if all opponents stop.
# Has support for two smart zone-based weapons and one analog-controlled spinner.  Name the smart zones "flip" and "weapon" and the controls "Flip", "Fire", and "Spin".  "Srimech" control for self-righting.  Note you must put 'UseSrimech':1 in Bindings.py to self-right with the Srimech control; otherwise it will use Flip.
# CUSTOMIZABLE SETTINGS:
# 'EnemyMoveRadius' sets how far the enemy must move in order to be considered mobile.  Default is 1.
# 'EnemyMoveTime' sets how long (in seconds) the enemy has to move the required distance before being considered immobile.  Default is 3.
# 'PrioritizeFlipper' if set to 1, the AI won't fire the other weapon until the flipper fires.  Useful for bots that use the flipper to get under opponents.  When all of self.weapons are lost, the flipper will stop firing and the other weapon will fire even when the flipper doesn't.  The flipper component id's should therefore be set in self.weapons and no other id's for this to work.  Default is 0.
# 'NoChassisTime' sets how long (in half-seconds) the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.  ONLY WORKS FOR SECONDARY WEAPON, NOT FLIPPER so wire the bot and name the controls like you are using Omni or Popup.py if you use this.  Default is 1.
# 'SrimechInterval' sets how often the AI fires the srimech when attempting to self-right.  Srimech will fire once every X seconds.  Default is 1.
it tries to be smart by not flipping things that are immobilized
the stock flipper.py is mostly the same thing except without the extra controls to fire, spin, and srimech. I'm not sure how well it works though and at the end of the day I don't think the ai is that important.

Good point. I guess the omni is better for the most part, but when it comes to fighting a non-invertible bot, then flipper is better.
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: UberPyro on April 30, 2019, 09:23:06 AM
from the very top of clickbeetle's flipper2.py

Quote
# Flipper2.py last updated 7/24/12 by Clickbeetle
# Update 7/24/12: Renamed this file to Flipper2.py so Flipper.py is not overwritten.  Added customizable srimech firing interval.

# This AI will act normally as long as the opponent is moving.  If the opponent stops moving, this AI will also stop and wait for the opponent to be counted out.  If the opponent starts moving again, so will this AI.  In a rumble, this AI will ignore any bots that aren't moving and will only stop if all opponents stop.
# Has support for two smart zone-based weapons and one analog-controlled spinner.  Name the smart zones "flip" and "weapon" and the controls "Flip", "Fire", and "Spin".  "Srimech" control for self-righting.  Note you must put 'UseSrimech':1 in Bindings.py to self-right with the Srimech control; otherwise it will use Flip.
# CUSTOMIZABLE SETTINGS:
# 'EnemyMoveRadius' sets how far the enemy must move in order to be considered mobile.  Default is 1.
# 'EnemyMoveTime' sets how long (in seconds) the enemy has to move the required distance before being considered immobile.  Default is 3.
# 'PrioritizeFlipper' if set to 1, the AI won't fire the other weapon until the flipper fires.  Useful for bots that use the flipper to get under opponents.  When all of self.weapons are lost, the flipper will stop firing and the other weapon will fire even when the flipper doesn't.  The flipper component id's should therefore be set in self.weapons and no other id's for this to work.  Default is 0.
# 'NoChassisTime' sets how long (in half-seconds) the AI will wait to find the chassis before giving up and firing, when there are components in the smart zone.  ONLY WORKS FOR SECONDARY WEAPON, NOT FLIPPER so wire the bot and name the controls like you are using Omni or Popup.py if you use this.  Default is 1.
# 'SrimechInterval' sets how often the AI fires the srimech when attempting to self-right.  Srimech will fire once every X seconds.  Default is 1.
it tries to be smart by not flipping things that are immobilized
the stock flipper.py is mostly the same thing except without the extra controls to fire, spin, and srimech. I'm not sure how well it works though and at the end of the day I don't think the ai is that important.

Good point. I guess the omni is better for the most part, but when it comes to fighting a non-invertible bot, then flipper is better.
flipper checks if its opponent has set invertible to true in its AI
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Redalert on May 02, 2019, 09:25:43 AM
How do you make your own PY file? I was looking into making one for my Wandering Spinner bot type...
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: UberPyro on May 02, 2019, 10:54:49 PM
How do you make your own PY file? I was looking into making one for my Wandering Spinner bot type...
Philetbabe's AI Chart (https://gametechmods.com/uploads/files/8459AI-Chart-2.3.rar)
but without a decent working understanding of python programming there's no point
Title: Re: AI-ing (.py files, coding, nose-orienting R+D, and help)
Post by: Redalert on May 03, 2019, 08:58:17 AM
Thank you!