mastercomfig / tf2-patches

Team Fortress 2, but with a lot of fixes, QoL improvements and performance optimizations!
Other
221 stars 27 forks source link

T-posing bots #645

Closed kittyron closed 1 year ago

kittyron commented 1 year ago

Description

Bots in offline practice are T-posing

Checklist

Reproduction

  1. Click find a game in main menu
  2. Select training
  3. Then offline practice
  4. Select any mode, map and amount of bots (happens on all modes and maps I checked, Bot difficulty doesn't matter as well)
  5. Click start practice
  6. See T-posing bots

Screenshots

Untitled

Setup Details

Client Settings

mastercoms commented 1 year ago

how did you start the map

kittyron commented 1 year ago

how did you start the map

https://user-images.githubusercontent.com/127242677/224422904-7c81667c-4a69-4124-b7fc-804318da1ce0.mp4

treacherousfiend commented 1 year ago

Reproduced on 1.2.0 as well, TF bots in general seem to be broken no matter how they're spawned? I tried your method, tf_bot_add and bot and all of them were broken. It seems that for some reason the bots do not have any valid weapons Something I did notice was that engis are mostly unaffected? they seem to spawn with the toolbox out and can place a building, but then can't swap off of it to the wrench and kind of get stuck because they want to upgrade their buildings. Spies also wander around with their sapper out but thats it

treacherousfiend commented 1 year ago

I did some more testing, this isn't a bot issue, stock weapons in general are completely bugged right now? If you have a stock weapon in your loadout you will just not be given it.

kittyron commented 1 year ago

I just noticed there are 2 the same stock weapons. One is loaded from loadout from vanilla game and the other one is from team comtress. Not working one is from team comtress. (you can hear that I can't use pistol)

https://user-images.githubusercontent.com/127242677/224430729-9a703e51-3a38-430e-bc37-5b47356314c8.mp4

kittyron commented 1 year ago

Also spy has PDA instead of sapper.

https://user-images.githubusercontent.com/127242677/224430986-4ff9bec8-fb16-49f7-8d59-f58eb69a98a0.mp4

kittyron commented 1 year ago

The only weapon that seems to be working is PDA.

treacherousfiend commented 1 year ago

The pistol that works here is one that has a skin on it on the live game. A few of us looked into this issue and it seems to be a regression with how the game initializes the inventory system on local servers, so any "economy" items (i.e. cosmetics, weapons aside from stock, weapons with skins on them) load fine, but the base stock weapons do not. Hopefully will be fixed soon.

kittyron commented 1 year ago

The pistol that works here is one that has a skin on it on the live game. A few of us looked into this issue and it seems to be a regression with how the game initializes the inventory system on local servers, so any "economy" items (i.e. cosmetics, weapons aside from stock, weapons with skins on them) load fine, but the base stock weapons do not. Hopefully will be fixed soon.

Makes sense forgot that I had skins on these weapons

ReplayCoding commented 1 year ago

Not sure if this is the proper fix, but GenerateBaseItems isn't called anywhere else in the code:

diff --git a/src/game/shared/tf/tf_item_inventory.cpp b/src/game/shared/tf/tf_item_inventory.cpp
index 6c3ee4a5..0e321f95 100644
--- a/src/game/shared/tf/tf_item_inventory.cpp
+++ b/src/game/shared/tf/tf_item_inventory.cpp
@@ -225,12 +225,7 @@ void CTFInventoryManager::PostInit( void )
 void CTFInventoryManager::InitializeInventory()
 {
    BaseClass::InitializeInventory();
-#ifdef GAME_DLL
-   if ( engine->IsDedicatedServer() )
-#endif
-   {
-       GenerateBaseItems();
-   }
+   GenerateBaseItems();
 }

 //-----------------------------------------------------------------------------