Integrate better bot support into mastercomfig.
See original GitHub issueIs your feature request related to a problem? Please describe.
Bots are horribly configured in stock TF2. The bot cvars (e.g tf_bot_notice_backstab_chance
) aren’t matched up with the bot difficulty (determined by tf_bot_difficulty
), and/or are set to bad parameters.
For instance:
-
Archer Sniper and Demo bots will always fire with the same slope (set through
tf_bot_arrow_elevation_rate
andtf_bot_ballistic_elevation_rate
respectively). The slope should vary based on difficulty. -
tf_bot_pyro_shove_away_range
should be set to01 to 50 for Hard and Expert difficulty configurations. -
tf_bot_health_critical_ratio
andtf_bot_health_ok_ratio
should be raised higher by ≥0.1 to match community-defined critical/ok health ratios. -
tf_bot_always_full_reload
should be set to 0 for easy difficulty, and 1 for the other difficulty configurations.
Describe the solution you’d like Integrate better bot optimization into mastercomfig. Maybe there could a module to determine the bot difficulty, and a new command to summon a preset of bots.
To automatically fix an issue where RED bots cannot move in Mann Vs. Machine, due to the RED flag not existing, an item_teamflag
entity that performs ForceReset
upon itself on pickup could be created upon a custom command.
EDIT: I was also thinking there could be an addon to add improved navigation meshes as not all of the stock TF2 maps have navigation meshes by default. nav_generate
can somewhat remedy this problem, but the result is often a terrible navigation mesh, making bots act poorer than with a custom made nav mesh. However the size of the addon could get pretty large (due to the sizes of nav mesh files) and override other nav meshes, so I’m leaving it as a suggestion for an addon.
Describe alternatives you’ve considered None.
Additional context Since there’s not much already-existing documentation on Team Fortress 2 bots, I posted as much information as I can get on the VDC wiki.[1][2] (EDIT: Sigsegv has also posted information on difficulty levels themselves) I don’t have any skill in reverse engineering, so I’m unable to test for any discrepancies in information, but judging by how bots weren’t updated that much in Jungle Inferno and after, it should be close enough to current TF2.
NOTE: When I say Bot, I do not mean cheating bots; I am referring to the regular bots made by Valve back in 2010.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Why do you want to hack using mastercomfig? You just raised a big red flag. Do you know what flag was there? USA flag, Union Jack. Replacing freedom with communism…
W dniu czwartek, 15 lipca 2021 WhyTheHellIsEvery4thYearGarbage? < @.***> napisał(a):
Here is my mockup for bot support so far. The names are probably going to need to be changed.
Commands
bot_mvm_patch
- Creates an invisible item_teamflag that runs ForceReset upon the OnPickup output. This command should be used to make RED bots function in Mann Vs. Machine.The action in code form:
This command will not be able to be run automatically as that would require mvm map configs, unless if the creator is ok with this.
bot_add_6s
- Add bots in the layout of 6s matches. (2 scouts, 2 soldiers, 1 demo, and 1 medic per team. Will runtf_bot_reevaluate_class_in_spawnroom 0; tf_bot_keep_class_after_death 1
)bot_add_highlander
- Add bots in the layout of highlander matches. (1 of each class per team. Will runtf_bot_reevaluate_class_in_spawnroom 0; tf_bot_keep_class_after_death 1
)mp_highlander
, as they won’t choose another class if they end up selecting a class they can’t select, so it’s best to disable mp_highlander.bot_add_mvm
- Add RED bots in the layout of a default team in Mann Vs. Machine (usually 1 scout, 1 pyro, 1 heavy, 1 engineer, 1 medic, and 1 sniper). This command may need to be split up (probably into missions).Modules
bot_skill
- Sets the skill level.none
- Applies no changes. (Default)easy
- Set bot difficulty to easy and make improvements relative to that difficulty.normal
- Set bot difficulty to normal and make improvements relative to that difficulty.hard
- Set bot difficulty to hard and make improvements relative to that difficulty.expert
- Set bot difficulty to expert and make improvements relative to that difficulty.Since some cvars that will be changed by this moudle are game cvars, meaning they’ll be changed upon joining a server, I think the best file to execute this module in would be game.cfg, since dedicated servers and listenservers should be able to execute this module.
Addons
improved-navigation-meshes
- Gives all maps included in stock TF2 a custom navigation mesh to improve bot functionality. This idea and the sources of the custom nav meshes are up to discussion.Problems/Challeges
tf_bot_keep_class_after_death
is definitely going to screw up RED and BLU bots in MvM, since I think BLU bots respawn as different classes to match the popfile. That cvar also applies constantly to the bot, so it will still apply to bots summoned before that cvar is changed.I’m not sure if
tf_bot_reevaluate_class_in_spawnroom
would do so, since I don’t know when the game reads that cvar. I’d have to figure out when it is used by the game, but sincetf_bot_reevaluate_class_in_spawnroom
is found nowhere in the Jungle Inferno leak, reverse engineering is required to do this, and I don’t have any skill in reverse engineering, so someone else is going to need to do it.EDIT: I remembered that MvM maps typically reset themselves (meaning custom entities added by players or mods are removed), so to avert this problem and automatically respawn the RED flag, I have to create a
point_servercommand
and tell it to exec just before the map clears, and have it exec await
for further delay to after the map has reset and then performbot_mvm_patch
.However I’m really against this solution as it requires the use of wait, and it assumes a map will always use an enabled
func_capturezone
entity, so I’d rather just relegate the function to making the RED flag.Better code for
bot_mvm_patch
would be:I’ll setup a pull request for bot support when I setup the initial modules. For the time being further discussions are welcome.