.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Re: Bot Aiming
Old
  (#11)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Bot Aiming - 26-12-2004

this is something in Michael Booth's docs about the official CZero bot, it seems to be different from the above algorithm, also I don't quite understand it

(the greek characters just messed up if I post it as text so I have to post it as picture)
Attached Thumbnails
Click image for larger version

Name:	f.jpg
Views:	555
Size:	38.0 KB
ID:	566  
  
Reply With Quote
Re: Bot Aiming
Old
  (#12)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Bot Aiming - 26-12-2004

ok, he looks at the speed, which isnt a bad idea neither. It's pretty similar to my code, but in my code k and d are a directly related ( k = 1-d ). looks a bit scary though since dw is normally used when having differentials, which he does not ... anyway, might be a simpler way to go, avoiding this time expensive log / exp stuff when calculating time independant angels instead of their derivatives. gotta put that to my win32 aiming test application



Last edited by @$3.1415rin; 26-12-2004 at 13:22..
  
Reply With Quote
Re: Bot Aiming
Old
  (#13)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Bot Aiming - 26-12-2004

Quote:
time independant angels
Feeling metaphysical, aspirin ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Bot Aiming
Old
  (#14)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Bot Aiming - 31-12-2004

didnt knew my own code that well ... my code actually is the same, just that I think there is the need for framerate dep d and k


  
Reply With Quote
Re: Bot Aiming
Old
  (#15)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Bot Aiming - 31-12-2004

if you run around a bot using this aiming algorithm with a constant angular velocity, you won't be hit ( if momentum, speed are not at instant aiming and the bullet spread isnt that big ).

some more info : http://johannes.lampel.net/joebotxp/botaim/index.html

the difference between the current angle will stay at a constant value, see diagram 1. This difference is related to the speed as (1-c)*currentSpeed. Thus the last diagram is the corrected one, which should allow a bot to kill you when you are running around a bot . so just a bit of correction is needed, and of course a local storage of the current state of the algorithm, before correcting

Code:
float a=.95,  // momemtum
 idealSpeed,
 c=.02,   // overall_speed
 aNow,   // recalculated momentum based on framerate
 fADiff;
float fmsecCount50 = m_fmsecCount / 50.0f;
float fAngleChange;
fADiff = abs(m_VIdealAngles.y - m_VCurrentAngles.y);
if(fADiff>180.0f){if(m_VIdealAngles.y > 0){m_VIdealAngles.y -= 360.0f;}
 else{m_VIdealAngles.y += 360.0f;}}
// compute the ideal angle speed (i.e, the amount of turning we WOULD want to do)
idealSpeed = (m_VIdealAngles.y - m_VCurrentAngles.y);
idealSpeed = idealSpeed*c;
// compute the new momentum given the previous one
aNow = exp(log(a) * fmsecCount50);
// compute the angle speed (i.e, the amount of turning we will actually achieve this frame)
m_fAngleSpeedYaw = m_fAngleSpeedYaw*aNow + idealSpeed*(1.f-aNow);
// calculate how big the actual angel change is
fAngleChange = m_fAngleSpeedYaw * (fmsecCount50);
m_VCurrentAngles.y += fAngleChange;
// ((1.f - c) * fAngleChange) to compensate 'shooting behind enemy'
m_pEntity.getEntity()->v.angles.y = m_VCurrentAngles.y + (1.f - c) * fAngleChange;
at least it's better than before, but I gotta test it in more different situations ... testing aiming inside the game isnt funny



Last edited by @$3.1415rin; 31-12-2004 at 23:28..
  
Reply With Quote
Re: Bot Aiming
Old
  (#16)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Bot Aiming - 04-01-2005

the more i think about this exp log stuff, the less sense it makes ....


  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com