.:: 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
Bug in botmans changepitch function
Old
  (#1)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Bug in botmans changepitch function - 15-04-2004

There is a bug in botmans changepitch function;
Code:
 current = pEdict->v.v_angle.x;
should be
Code:
 current = -pEdict->v.v_angle.x;
This is because the x angle is reverted...
  
Reply With Quote
Re: Bug in botmans changepitch function
Old
  (#2)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Bug in botmans changepitch function - 15-04-2004

hmm, i think you are applying here the fix that later on Paulo-la-frite once did? (did i spell his name right?). AS the X axis gets 'fixed' later on


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Bug in botmans changepitch function
Old
  (#3)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Bug in botmans changepitch function - 16-04-2004

The pitch of your view angles (v.v_angle) is inverted from the angle of the vector from your origin to your enemies origin. The view pitch is also 1/3 of the angle between the enemies origin and your origin, thus...

Code:
Vector v = (enemy.origin - my.origin);
angle = VectorToAngles(v);
view_pitch = (-1 * angle.pitch) / 3;
botman
  
Reply With Quote
Re: Bug in botmans changepitch function
Old
  (#4)
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: Bug in botmans changepitch function - 16-04-2004

I once had made a little sketch that described all this Half-Life angle stuff. Too bad it's gone during the last website tidy-up.

Basically you have to consider the body and the view angles on the X plane as by reference to two vectors that point backwards from each other.



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: Bug in botmans changepitch function
Old
  (#5)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: Bug in botmans changepitch function - 16-04-2004

I guess you all mean this code?
Code:
 	// set the body angles to aim correctly
 	pEdict->v.angles.x = pEdict->v.v_angle.x / 3;
 	pEdict->v.angles.y = pEdict->v.v_angle.y;
 	pEdict->v.angles.z = 0;
 
 	pEdict->v.v_angle.x = -pEdict->v.v_angle.x; // Aim bug-fix
(For me)This happens after the botchangepitch function.
And since the ideal angle isn't inverted I guess I had to do this, atleast for me it fixed the aiming code
  
Reply With Quote
Re: Bug in botmans changepitch function
Old
  (#6)
Wei Mingzhi
Member
 
Status: Offline
Posts: 11
Join Date: Apr 2004
Default Re: Bug in botmans changepitch function - 22-04-2004

You can invert the pEdict->v.idealpitch and it will be OK.

Of course, the way you are doing seems to work too.
  
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