question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integrate better bot support into mastercomfig.

See original GitHub issue

Is 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 and tf_bot_ballistic_elevation_rate respectively). The slope should vary based on difficulty.

  • tf_bot_pyro_shove_away_range should be set to 0 1 to 50 for Hard and Expert difficulty configurations.

  • tf_bot_health_critical_ratio and tf_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:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
micwoj92commented, Jul 15, 2021

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):

Is 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 and tf_bot_ballistic_elevation_rate respectively). The slope should vary based on difficulty.

tf_bot_pyro_shove_away_range should be set to 0 for Hard and Expert difficulty configurations.

tf_bot_health_critical_ratio and tf_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.

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] https://developer.valvesoftware.com/wiki/Tf_bot[2] https://developer.valvesoftware.com/wiki/Talk:Navigation_Meshes#Team_Fortress_2_Nav_meshes 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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mastercomfig/mastercomfig/issues/558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3YG4U36JWBRXEJ3JTIWS3TX5HW5ANCNFSM5AOLOEHQ .

1reaction
WhyIsEvery4thYearAlwaysBadcommented, Jul 17, 2021

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:

incrementvar sv_cheats 0 2 1
ent_create item_teamflag targetname <temporary name that no one will ever realistically use> teamnum 2
ent_fire <temporary name that no one will ever realistically use> addoutput "OnPickup !self,ForceReset,,0,-1"
ent_fire <temporary name that no one will ever realistically use> addoutput "targetname"
incrementvar sv_cheats 0 2 -1

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 run tf_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 run tf_bot_reevaluate_class_in_spawnroom 0; tf_bot_keep_class_after_death 1)

    • From what I found out through experimentation, bots don’t mesh nicely with 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 since tf_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 a wait for further delay to after the map has reset and then perform bot_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:

incrementvar 0 2 1
ent_remove <temporary name that no one will ever realistically use>
ent_create item_teamflag targetname <temporary name that no one will ever realistically use> GameType 2 teamnum 2 ReturnBetweenWaves false OnPickup "!self,ForceReset" flag_model models/props_td/atom_bomb.mdl
ent_fire <temporary name that no one will ever realistically use> addoutput "origin 0 0 0"
incrementvar 0 2 -1

I’ll setup a pull request for bot support when I setup the initial modules. For the time being further discussions are welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick Fixes - mastercomfig docs
This is a list of common issues users experience with mastercomfig, and how to solve them. If you find that you need more...
Read more >
Contributing - mastercomfig docs
Learn how to get involved with mastercomfig and help out! ... As an open source project, mastercomfig appreciates the community's help in improving...
Read more >
mastercomfig
Looking for more performance, or quality? Easily customize looks to your exact preference using the many config customization presets.
Read more >
Custom Configs - mastercomfig docs
Learn how to do advanced customization and scripting with mastercomfig.
Read more >
Modules - mastercomfig docs
To set a custom module level, put it in overrides/modules.cfg . ... snapshot_buffer=anim : Adjusts the smoothing to be more ideal for animations...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found