Bots and Simulations > The Gene depository
True Aiming using only physics
rsucoop:
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.
goffrie:
--- Quote from: rsucoop ---
--- Code: ---*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
--- End code ---
--- End quote ---
You could just use
--- Code: ---*.refxpos *.xpos sub *.refypos *.ypos sub pyth
--- End code ---
rsucoop:
--- Quote from: goffrie ---
--- Quote from: rsucoop ---
--- Code: ---*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
--- End code ---
--- End quote ---
You could just use
--- Code: ---*.refxpos *.xpos sub *.refypos *.ypos sub pyth
--- End code ---
--- End quote ---
If only I had known how to use the pyth command to begin with..
d-EVO:
You spelt aimshot wrong! It is spelt aimshoot, not aimshot.
ikke:
--- Quote from: goffrie ---
--- Quote from: rsucoop ---
--- Code: ---*.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr
--- End code ---
--- End quote ---
You could just use
--- Code: ---*.refxpos *.xpos sub *.refypos *.ypos sub pyth
--- End code ---
--- End quote ---
=
*.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
Navigation
[0] Message Index
[#] Next page
Go to full version