Author Topic: S.O.W.  (Read 10790 times)

Offline JoeBlo

S.O.W.
« Reply #60 on: June 02, 2009, 07:38:02 AM »

Offline Madiaba

S.O.W.
« Reply #61 on: June 02, 2009, 08:32:00 AM »
That's cool Phil, nice work. Yea, how about a vid?
I experimented with something like this 'specific weapon at specific servo angle'. It was called 'InferNo-Way'. It had the weapons at 3.14 radians from one another. On one side the main weapon was 10 flame throwers, that would take the life out of the opponent real quickly. When the life of the opponent reached < .1, the servo would turn the flames away and instead point a dozen or so piston-mounted pointy tip arrows at the wounded enemy and easily finish him off (usually) in one stroke.
Can you expound a bit more on some detail about your cool bot here...
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
S.O.W.
« Reply #62 on: June 02, 2009, 08:35:20 AM »
Quote from: Madiaba;42071
That's cool Phil, nice work. Yea, how about a vid? .

i'm slow (i suck ?)  at video because, most of the time, i wrote AI between 12h to 14h in my work and there i have not Fraps and, even if i had it, i am not allowed to upload/download video.

so i have to do them when i'm back home, and there, i have so much to do that i am distracted most of the time.

about the bot you talk above, is it the one in your showcase that looks like ACAM ?

BTW, this is not flattery, but your showcase is one of the best with flying planes, tanks, grasshoper, etc.
i like it much .

Quote
Can you expound a bit more on some detail about your cool bot here..
the cool bot is JoeBlo one. i just try to ai it.

the idea of the previous bot is to have extender attached to servo motor, this last one will change its position after a certain amount of time (role of the countdown parameter). Each change of position will make the servo motor rotate a certain angle which is calculated from the value of the parameter 'servoNbPos'.

this AI should be a basis for other AI that change servo motor position according to a special condition :  for instance, once you've reached a certain amount of damage, or once one  of your component reached a certain amount of damage

I will post a better version of this AI soon. it has a bug : crash the game when i stop a match (may be because the tick function takes to long to be executed).

here is the video :
[media]https://gametechmods.com/includes/flvfiles/joebloeai.flv[/media]
« Last Edit: June 02, 2009, 04:39:03 PM by philetbabe »

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
S.O.W.
« Reply #63 on: June 03, 2009, 07:51:26 AM »
... continuation of post above ...

here is the corrected shiftWeapon AI. (servo motor change angle from time to time)

Bug corrected : no more crash after stoping a fight / parameter servospeed taken into account
improvment : localized code :  yet the change of angle is conditionned by a timer. other condition may
be defined (written in python) in the function  ShiftConditionOk(self).

bindings parameter : all are optionnal
'range' :  range for spin motor, defualt 99
'servodelta' : optionnal : angle tolerance. the higher, the less the servo oscillates
               but the servo may stabilizes in an ngle far from the 'aiming' one.
            default : 0.05 (low)
'servospeed' : speed turn of the servo, default 100
'servonose'  :angle correction due to attachement of mototrs or extenders. default value 1
              typical calue : -1, 0.25,-0.25,1
'servoNbPos'  : number of different position switched.
                default : 2
            if value = 2, servo change from angle 0 to angle math.pi
             value = 3 is good for tribar
             value = 4 is good for attachement with 4 extenders.
'servoTimer'  : duration (abstract value)  between 2 switch of position. default 15 (low)

Sample bindings (for the bots below)
Code: [Select]

    list.append( (&quot;shiftweapon I&quot;, &quot;ShiftWeapon3&quot;, { 'nose': math.pi, 'servospeed':60, 'servodelta':0.15, 'servoTimer':25, 'servoNbPos':2,'weapons': (1,2,3,4) }) )
    list.append( (&quot;shiftweapon II&quot;, &quot;ShiftWeapon3&quot;, { 'nose': math.pi, 'servospeed':30,'servodelta':0.05, 'servoTimer':35, 'servoNbPos':4,'weapons': (1,2,3,4) }) )

the sample bots (stock) in the .rar :


the Ai :
https://gametechmods.com/uploads/files/2762shiftweapon.rar

next subject of work : a 2 servo motor bots, mounted on each of its flank, and that should works like 'arms' ... to  think about.

Offline Madiaba

S.O.W.
« Reply #64 on: June 03, 2009, 09:01:54 AM »
Looks real nice, Phil.
Thought-1: It would be very cool to check the kind of bot the enemy is, so that, like a switch blade, you could put forth your best weapons system to face it.
 
These may be some useful commands:
....-plus.describe(BotID)
....-self.GetComponentType
....-one to find the AI.py of your opponent?(maybe Trov,BB's, or Apanx ran into one)
 
If there is a way one can gleen enough info to discover the type of the opponent bot, then this would work.
--------------
Thought-2: Another thought on your bot above, is that you could attach a SZ to the extender that would move with and trigger that particular weapons system on the bi/tri-bar; and only run the particular weapon that is engaging the enemy. *Of course that's BFE.... but cool.*
.
« Last Edit: June 03, 2009, 04:02:13 PM by Madiaba »
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
S.O.W.
« Reply #65 on: June 03, 2009, 05:52:05 PM »
self.GetComponentType(CompID) wouldn't work because it is the opponent's components but AI.running_ai[AIBotID].GetComponentType(CompID) might... (AIBotID is different than the BotID because it is only looking at the AI bots but you could use AI.running_ai[AIBotID].GetID() for conversion). You can see what AI.py is being used by an opponent by typing in the coding above without the command at the end. Unfortunately, it isn't very easy to get the name of the AI.py without the extra text around it...

If you would like any more help or explaination, feel free to ask.

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
S.O.W.
« Reply #66 on: June 04, 2009, 03:07:39 AM »
i will have a look at that.... Trovaner, do you have try any experiment on this information before ?

i've seen there is also
Code: [Select]

#ai_bindings = []        # list of AI scripts & which bots use them

which should give me  quickly the information bot<->AI

the use of such information should be to switch between HS and VS

to study so.

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
S.O.W.
« Reply #67 on: June 04, 2009, 05:53:29 PM »
The coding I gave you, I've tested before and I know it works but be careful not to over do things because you can also control your opponent using this or temporarily change coding for them. In the past, I've tried working on something that could tell apart bot types but ran into so many problems that I haven't touched it in months.

AI.ai_bindings contains everything in Bindings.py including bots that aren't fighting and the extra info so I think you'll run into the same problem as before (having troubles taking everything else out)

For similar weapon setups (such as HS, VS, FS, etc.), I would recommend using this:  
Code: [Select]
plus.rayTest(XYZ-StartingLocation, XYZ-EndingLocation)
It will return the BotID, CompID+1 (but still 0 if chassis), X-Coordinate, Y-Coordinate, and Z-Coordinate (in that order) of the first point that it hits between the starting and ending locations (on a side note, it will return -1 for the first two values if it doesn't touch anything or if its hits something other than a bot).

Offline Madiaba

S.O.W.
« Reply #68 on: June 04, 2009, 06:20:32 PM »
One of the big problems is that, even if one can:
......-ID all of the enemy's components
......-ID which AI.py the enemy's using
......-ID even which Tactics mode ('Engage',...) the enemy's running in
all of this is still not enough info to distinguish between a HS, VS, FS or TS, for instance.
Only a few like Poker.py or a Rammer.py would devulge enough of the needed info.
 
 
(Trov, could you IM me when you can on Yahoo...)
.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
S.O.W.
« Reply #69 on: June 09, 2009, 04:47:44 PM »
i've not work much on AI that reconize other AI yet ...

as i'm working on an AI that 'open arms' while far from foe and close its arms while foe are near (in custom zone), here are the first images (foes bots are from gigafrost AI pack).

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

the AI have still to be improved ... or will be rejected if no good.

Offline Madiaba

S.O.W.
« Reply #70 on: June 09, 2009, 08:00:48 PM »
Phil, nice work.
In my experience, articulating servo motors accurately with SZs is a thankless effort. Please post any progress you make here, Phil, because I'm interested.
IMHO, I would try:
-triggering combine:
....-range and self.GetHeadingToID(enemy, False).
-servo control use:
....-self.GetMotorAngle(13).
....-self.Input('Grab', 0, +/-100)
 
Thus, if enemy is in range and in front, then adjust (analog controller) servo motor in radians to close weapon-arms; else default (open) mode.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
S.O.W.
« Reply #71 on: June 10, 2009, 02:54:08 AM »
the idea of this AI is resume in this code extract from the tick() function :

Code: [Select]
      haveToOpenArms = True
        targets = [x for x in self.sensors.itervalues() if x.contacts >  0    \
        and not plus.isDefeated(x.robot)]
        if len(targets) >    0  :
            haveToOpenArms = False
           
        if  haveToOpenArms  :
                self.isOpenArms1 = self.openArms(self.MotorOne, &quot;Servo1&quot;, 0 )
                self.isOpenArms2 = self.openArms(self.MotorTwo, &quot;Servo2&quot;, 1 )  
        else :
                self.isCloseArms1 = self.closeArms(self.MotorOne, &quot;Servo1&quot;, 0  )
                self.isCloseArms2 = self.closeArms(self.MotorTwo, &quot;Servo2&quot;, 1 )


with closeArms and openArms  both with something like that :
Code: [Select]
   def openArms(self, idMotor, CtrlServo, anglePositif):
        selfangle = self.GetMotorAngle(idMotor)
        if anglePositif == 1 :
            winkel = self.servoOpenArmsAngle - selfangle
        else :  
            winkel = -self.servoOpenArmsAngle - selfangle
        return  self.AimTowards(winkel, CtrlServo)

and a binding
Code: [Select]
   list.append( ("testBotX", "InMyArms", {  'servoopenangle':0.3, 'servocloseangle':2.9, 'servodelta':0.28, 'servospeed':60,'weapons': (1,2,3,4) }) )



in fact, the problem i meet is about stability : aiming to open or to close, the arms still oscillate,
even if i change the THRESHOLD value of AimTowards().

what should be fine would be to attach piston to those arms, but a long as i did not resolve this
oscillation trouble, i can't.

and in fact, i wonder if 2 servo pointing always to ennemy is more efficient than this idea of open/close arms to (theorically) range attack the side of the ennemy.

Edit 2009/06/11 : Yeah ! i get it  !!! the bot open its arms, let the foe get in, than close it arms and rip its flank ! i post soon video + bots + AI. just the time to 'improve the AI' : let attach firing meccanism to the extender so the bot may fire when it is in a 'closing' position.


Edit 2009/06/17 : here is the link to tha AI :
https://gametechmods.com/uploads/files/inMyArms.rar
the movie i'd made cannot be upload here, so i will make another...
Still a big problem : when attaching piston to those arms -> the servo had problem to stabilize and, sonner or later there is an havock explosion. Bots givent in the .rar are stock ones.
« Last Edit: June 17, 2009, 02:50:00 AM by philetbabe »