![]() |
my reload fix
I thought that bots were reloading way too infrequently. They sometimes engage the enemy with nearly-empty clips. So i decided to try to fix this. I wrote a method in bot.cpp. here:
Code:
If all these conditions are satisfied, i proceed and get the clip capacity of the current weapon that the bot is using. the switch-case block server this purpose. I do this because there is no variable in the code that keeps track of this already (or i missed it). After i got maxClip for current weapon, i check if current number of bullets in the clip is less than %80 of maxclip. (for instance, if the bot is using mp5navy and has 23 bullets, he reloads, but if it has, say, 24 bullets or more, it doesn't) If it is less, then the bot reloads. If not, they don't reload. I call this method in bot think, at the beginning of these tasks: TASK_NORMAL, TASK_ENEMYHUNT, TASK_SEEKCOVER (but here not at the beginning of the task, but just after " // Enter look direction from previously calculated positions" code (after the else), TASK_PAUSE, TASK_CAMP, TASK_HIDE, TASK_MOVETOPOSITION and finally TASK_FOLLOWUSER. I have tested my modifications for about 1 hour now, and it seems to work well. I already sent this code to SPlorYGon but i'm not sure if he will decide to include it or not, i just wrote this thread to get some feedback. If you guys request, i may prepare a binary for you. Also, it is likely that this will be my last coding about podbot, since i'll work on something else, anyway i always remain as a part of this "warm" community :) |
Re: my reload fix
Awwww, man! What a pity - you come, post 2-3 very useful things, and now you tell us this is probably the last thing you'll ever do with PODBot! :'(
Ok, in any case I think the stuff you coded here really makes sense; at least it's the way I'd prefer bots to behave. No reloading orgies whenever 1 or 2 bullets have been fired, yet no facing enemies with the final bullet left... thumbs up! You only made some tiny mistakes concerning clip capacity: M3 Shotgun is 8, not 7 XM1014 Auto-Shottie is 7, not 8 SG 550 is 30, not 20 ...and why do your FAMAS and GALIL have 0? I can't check right now, cause my CS 1.6 is unavailable due to the last CS update... as usual... 9_9 Anyway, thanks for this contribution and good luck with whatever you're up to... ;) :) :| :( :'( !! |
Re: my reload fix
okay, thanks for your corrections Wrecks, I edited the code to reflect the right values now. Also, i forgot to mention, they are zero because i haven't played 1.6 therefore i don't know the values for galil and famas (have no clue about CS_WEAPON_SHIELDGUN also) . So if somebody can supply me with the correct maxclip values, i'll update them. C ya :)
|
Re: my reload fix
galil: 35 shots/clip
famas: 25 shots/clip to the shieldgun <- what does that thing mean? |
Re: my reload fix
yea you already gave this to me..
and i cleaned it up and made it easier to read.. Code:
void BotCheckReload (bot_t *pBot) // bluebyte |
Re: my reload fix
Hmmm... smart guy! :D You're right... this IS less complicated.
|
All times are GMT +2. The time now is 16:08. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.