![]() |
Bot aiming (the /=-3 part)
Hey, ive been HL modding for a long time, but not with bots. Ive come across code in the SDK which divides a players pitch by -3 but never knew why. Now that im making a bot, ive noticed that sometimes they aim at the ground in front of a player by mistake, and i think its to do with this 3 business.
ATM my code works like this: Code:
|
Re: Bot aiming (the /=-3 part)
I suppose you are not completely aware of the difference between view angles and body angles. The view angles can be seen as the angles of the head, while the body angles can be seen as the angles of the rest of the body.
When a player looks upwards at let's say +45 degrees, his body should bend back about 15 degrees. Since this value is function of the head's angles, we found that body angles pitch = - view angles pitch / 3 was a good value. I don't think your problem with the bots aiming at the ground is related to this fact in any way. I would rather look at the waypoint navigation. |
Re: Bot aiming (the /=-3 part)
yeh im aware that angles is the rotation of the model while v_angles is the roation of the view, i just assumed that the server would use the 'angles' for firing bullets, but i just realised that it makes its aim vector from "m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle", so i guess my assumption was wrong.
thanks anyway for the answer tho (that player models pitch is out of 30 rather than 90 so that players dont run around horizontally). allthough i dont know what u mean by "we found that .. was a good value" seeing valve/ID used -3 in the SDK.. im using some fairly basic aiming code atm, which ill list below for discussive purposes (allthough if theres any other bot n00bs like me on here, feel free to use it) Code:
|
Re: Bot aiming (the /=-3 part)
Ah, I forgot to tell you too: for some weirdass reason, when working with ideal angles, the pitch must be reverted :)
Look in the BotAim 2 plugin code for an example of this. |
All times are GMT +2. The time now is 14:39. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.