Author Topic: True Aiming using only physics  (Read 5197 times)

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
True Aiming using only physics
« on: February 15, 2008, 03:45:56 PM »
Trying to calculate shots using miniscule amounts of time makes aiming genes difficult to perfect, but take a look at this one I've developed for Slim Evo. It uses the idea of time, distance divided by speed (constant 40) and the angle method with a velocity vector adder. Hope you enjoy it, I have:

*.refxpos *.refypos angle .setaim store
*.refxpos *.refypos angle *.refaim *.refvel mult 40 *.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr div mult 60 *.focuseye mult mult .aimdx store
*.refxpos *.refypos angle `(*.refaim *.aim sub abs mult) .aimshot store

`Note: the inserted piece I did not use, but may be helpful for a corrective shot procedure.

The aimdx is extremely accurate. The distance formula under 40 (speed of a shot) gives you time, multiplied by the angle by the focuseye angle half-point multiplied by theta (angle to the bot) and the bots vector; it leaves some room for mutations to improve upon it, but it works very well for me.

Offline goffrie

  • Bot Builder
  • **
  • Posts: 65
    • View Profile
True Aiming using only physics
« Reply #1 on: March 02, 2008, 05:24:42 PM »
Quote from: rsucoop
Code: [Select]
*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
You could just use
Code: [Select]
*.refxpos *.xpos sub *.refypos *.ypos sub pyth

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
True Aiming using only physics
« Reply #2 on: March 03, 2008, 12:19:19 AM »
Quote from: goffrie
Quote from: rsucoop
Code: [Select]
*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
You could just use
Code: [Select]
*.refxpos *.xpos sub *.refypos *.ypos sub pyth
If only I had known how to use the pyth command to begin with..  

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
True Aiming using only physics
« Reply #3 on: November 16, 2008, 04:43:11 PM »
You spelt aimshot wrong! It is spelt aimshoot, not aimshot.
1:      2 is true
2:      1 is false

Offline ikke

  • Bot Destroyer
  • ***
  • Posts: 300
    • View Profile
True Aiming using only physics
« Reply #4 on: November 17, 2008, 05:49:14 AM »
Quote from: goffrie
Quote from: rsucoop
Code: [Select]
*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
You could just use
Code: [Select]
*.refxpos *.xpos sub *.refypos *.ypos sub pyth
=
*.refxpos *.refypos dist
I am working on the same thing. Didn't know shot speed was 40 and was about to figure it out empyrically. Will post my (firing) solution when finished
Thanks

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
True Aiming using only physics
« Reply #5 on: November 17, 2008, 06:50:04 PM »
If I were you, I wouldn't use .aimshoot. It's got the nasty tendency to do unpredictable things, although I did manage to find out that a.) it either uses a scale different to the other aiming features b.) it's measured going the wrong way or c.) it has a different starting point. Point is, it's very messy to work with.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline rayz

  • Bot Neophyte
  • *
  • Posts: 19
    • View Profile
True Aiming using only physics
« Reply #6 on: April 02, 2009, 12:54:27 PM »
Quote from: bacillus
If I were you, I wouldn't use .aimshoot. It's got the nasty tendency to do unpredictable things, although I did manage to find out that a.) it either uses a scale different to the other aiming features b.) it's measured going the wrong way or c.) it has a different starting point. Point is, it's very messy to work with.

I think it goes the wrong way.  These two lines of code make eye5 and the shot direction point the same way:

*.aimHeading *.aim sub .eye5dir store
*.aim *.aimHeading sub .aimshoot store



Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
True Aiming using only physics
« Reply #7 on: April 02, 2009, 04:14:08 PM »
This is from my shot at true dog figher bot. I got as far as a funcional bot that allways faces up. It actually used .refaim for part of it's conspec.

*.refxpos *.refypos angle 314 sub - .aimshoot store


Trafalgar (he designed the monster-bot Guardian) did empirical studies and ended at shot speed 39. I recommend reading his posts if you intend to make a true aiming bot. Also I recommend reading abyaly's bot's, especially Aura.