Raised This Month: $ Target: $400
 0% 

[csgo] is it possible to change a bots skill?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 01-16-2025 , 02:26   [csgo] is it possible to change a bots skill?
Reply With Quote #1

Once a bot is in game is there a way to change its skill level (0-3) instead of kicking the bot and adding another one at the different skill level?

Last edited by Austin; 01-16-2025 at 02:27.
Austin is offline
101
Senior Member
Join Date: Nov 2023
Old 01-20-2025 , 06:38   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #2

yes , but it would be complex with the many built-in functions that manage bots actions .
here is an example of how to improve bot aim accuracy , but it would not be efficient , since bots are being tracked in each frame by another functions like (pre_think) . and these functions set their (buttons / flags / angles ... ) in order to re-act with environment .

Example to improve bot aim or modifying damage based on difficulty:
PHP Code:
#include <sdkhooks> 
#include <sdktools> 

Handle Cvar_Level;

public 
OnPluginStart()
{
    
Cvar_Level CreateConVar("bot_difficulty_level""1""1: easy ,  2:Normal ,  3:Hard , 4:Expert "FCVAR_NONEtrue1.0true4.0);
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_TraceAttackOnTraceAttack);
}

public 
Action OnTraceAttack(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &ammotypeint hitboxint hitgroup)
{
    if (
IsFakeClient(attacker))
    {
        
int x GetRandomInt(10 20) * (GetConVarInt(Cvar_Level) ) ;   // random accuracy factor based on difficulty

        
static float APos[3], HPos[3], Vector[3], Angles[3];

        
        
GetClientEyePosition(attackerAPos);
        
GetClientEyePosition(victimHPos);
       
        
HPos[2] -=  ;
        
MakeVectorFromPoints(APosHPos Vector);  //connect bot eyes position with victim head position (head aim)
        
GetVectorAngles(VectorAngles);


        
Angles[GetRandomInt(0,1)] += GetRandomInt(-1,1) * x/10;  //Optional

        
TeleportEntity(attacker,NULL_VECTOR,Angles,NULL_VECTOR);
        
LogMessage("%d",hitgroup);


        
damage *= Pow(2.0 GetConVarFloat(Cvar_Level) - 2.0 );
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;

* Note : this may not be a working code , that was just an example of how to improve bots aim skills based on difficulty , because the built-in structure already handled that .

Last edited by 101; 01-21-2025 at 09:25.
101 is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 01-25-2025 , 23:05   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #3

Quote:
Originally Posted by Austin View Post
Once a bot is in game is there a way to change its skill level (0-3) instead of kicking the bot and adding another one at the different skill level?
It's possible
Code above - this isn't solution
Vit_amin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-28-2025 , 10:37   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #4

PHP Code:
"bot_difficulty" "1"
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE 
Defines the skill of bots joining the game.  Values are0=easy1=normal2=hard3=expert.



"sv_auto_adjust_bot_difficulty" "1"
FCVAR_GAMEDLL FCVAR_RELEASE 
Adjust the difficulty of bots each round based on contribution score.



"sv_bots_get_easier_each_win" "0"
FCVAR_GAMEDLL FCVAR_RELEASE 
- If > 0some # of bots will lower thier difficulty each time they win. The argument defines how many will lower their difficulty each time.

"sv_compute_per_bot_difficulty" "0"
FCVAR_DEVELOPMENTONLY FCVAR_GAMEDLL FCVAR_REPLICATED 
compute all bot difficulties equallycompute unique bot difficulty for each bot 



"sv_show_bot_difficulty_in_name" "0"
FCVAR_DEVELOPMENTONLY FCVAR_GAMEDLL FCVAR_REPLICATED 
hide bot difficulty in bot nameshow bot difficulty in bot name



"bot_autodifficulty_threshold_high" "0.0" def"5.0" min. -20.000000 max20.000000
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE 
Upper bound above Average Human Contribution Score that a bot must be above to change its difficulty

"bot_autodifficulty_threshold_low" "-2.0" min. -20.000000 max20.000000
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE 
Lower bound below Average Human Contribution Score that a bot must be below to change its difficulty 
https://github.com/ambaca/Bacardi-Du...2022-04-26.txt


*edit
Some cvars require sm_cvar to change.
Use these in game mode config (override) file
__________________
Do not Private Message @me

Last edited by Bacardi; 01-28-2025 at 10:39.
Bacardi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 02-04-2025 , 15:16   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #5

Hey,
Its nice to have everyone back together again!
I haven't been around as much since totally moving over to cs2 and cs#.
Here is the place to be now for cs2 and cs# plugins.
https://discord.gg/EcNWNGRQ

I should have been more specific with my question
and thanks for all the info but I know all about bot cvars
tx.

First I said bot skill and then mentioned difficultly levels which are two different things sorry!

My question is about changing a bots difficulty level -while the bot is in game- without having to do this
1) bot_difficulty newlevel
2) bot_kick
3) bot_add (add a totally new bot at this new bot_difficulty level just set)
4) set bot_difficulty back to default

That was my question.

And also what is Skill? And how does this affect bots?
Skill is a setting in the botprofile.db template and goes from 0 to 100
It is totally different from the 0-3 difficulty level that maps to and chooses the the templates.

These difficulty levels 0-3 gives these templates and notice the game decides between 2-3 different ones on all levels besides level 0
bot_difficulty 0 = Easy, 1 = fair+normal, 2 = tough+hard+veryHard, 3 = expert+elite At least for the default botoprofile.db

Again how does Skill affect the bots?

I have only been focused on difficulty 0-3 and using the
Templates that are associated with those levels to set the things like ReactionTime AttackDelay etc.
But this Skill is also a setting in the template.
What does it do?

// EXPERT
Template Expert
Skill = 60 // <= what does this do? How does it change the bots?
Aggression = 45
ReactionTime = 0.50
AttackDelay = 0.50
Cost = 2
Difficulty = EXPERT
VoicePitch = 96
AimFocusInitial = 11
AimFocusDecay = 0.50
AimFocusOffsetScale = 0.50
AimfocusInterval = 0.50
End
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-05-2025 , 02:55   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #6

"Skill" personality, 0 = terrible, 100 = expert
"Aggression", 0 = coward, 100 = berserker

"Difficulty", you 'flag' this specific profile as 'X' difficulty, you not change difficulty. This affect loading profile when bot created. ["EASY", "NORMAL", "HARD", "EXPERT"]


About "Skill"
Code:
- bot aim accuracy, when aiming enemy, affect aim accuracy = turn distance calculate with skill

- bot aim At Part, Is Using Machinegun, aim GUT (non-skill)
- bot aim At Part, Is Using AWP or Is Using Shotgun, aim GUT (non-skill)
- bot aim At Part, when active weapon recoil is at the moment high (sprayin and prayin) -> skill over 50% aim GUT
- bot aim At Part, skill less 80% aim GUT (don't go for headshots)
- bot aim At Part, skill 80% and over, aim HEAD

- bot vision, bot Is using sniper rifle, skill over 40% pre-zoom (when view is not moving)
- bot vision, map NAV have so called 'encounter spots', how long bot glance those spots, low skill look longer.
- bot vision, chance of noticing player by skill (there are on top, lot of non-skill based stuff what trigger 'noticing')

- bot attack, high skill bots (over 50%) bigger chance to dodge fight when outnumbered or see sniper.
"Aggression" affect also, is bot bailing out of fight. (m_isCoward)

- bot dodging, move towards or away from enemy when using knife and enemy facing, skill less than 66% move backwards when in min. combat range.
Combat range is random on each bot when created.
- bot dodging, slide right or left, high-skill bots keep moving and don't jump when they see sniper (over 50%)

- bot using pistol, fire as fast as possible in pistol range (360 unit) when skill over 75%
- bot not using pistol, skill less than 50% 'spray and pray'
(there are also non-skill based stuff, sprayRange 400 unit or Is Using Machinegun)

- bot aim offset, aim error based skill

- bot avoid enemy grenades, skill less than 60% do not avoid grenades.

- bot active weapon clip empty, skill over 50% switch to pistol instead reloading in combat.
- bot use all ammo and switch to pistol instead realoading in combat (skill over 50%)
- bot hide to reload chance based by skill

- bot using silencer skill over 70% (there is also "prefer silencer" by bot name { m_name[0] % 2 } start letters  A C E G I K M O Q)

- bot buy defusekit chance, based skill

- high-skill bots run with knife, unless using scout (over 33%)
These examples are taken from CS:S unfortunally
__________________
Do not Private Message @me

Last edited by Bacardi; 02-05-2025 at 04:49.
Bacardi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 02-05-2025 , 14:09   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #7

Quote:
Originally Posted by Vit_amin View Post
It's possible
Code above - this isn't solution
If you have a solution I am interested!
Austin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 02-05-2025 , 14:12   Re: [csgo] is it possible to change a bots skill?
Reply With Quote #8

Quote:
Originally Posted by Bacardi View Post
"Skill" personality, 0 = terrible, 100 = expert
"Aggression", 0 = coward, 100 = berserker

About "Skill"
[/CODE]

These examples are taken from CS:S unfortunally
Thanks for this!
It almost certainty works like this in cs2 since the bot seem to work mostly the same, and have the same settings. The only things I noticed is there is a total new non editable nav system and the bots are way better at following most all of the radio commands

The ones in these menus
radio
radio1
radio2
Austin is offline
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 04:00.


Powered by vBulletin®
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Theme made by Freecode