OrionFive / Hospitality

Orion's "Hospitality" and more
https://www.patreon.com/orionmods
GNU General Public License v3.0
91 stars 53 forks source link

Hospitality: TPS Drop and thoughts on potential optimization #639

Open skyarkhangel opened 2 years ago

skyarkhangel commented 2 years ago

Problem place: https://github.com/OrionFive/Hospitality/blob/6edae90b7985ced8ba04ef8cb3994462108c67f0/Source/Source/JoyGiver_BuyStuff.cs#L43 Some players forgot to select a trading zone and used the home zone. The number of things, especially when playing with mods, is very high in the late-game and this jobgiver could lead to significant tps drop. Its necessary to think about optimizing the method and might be good idea to add a notification to the player about the trading area, if it equals home area or too big.

OrionFive commented 2 years ago

If they just forget to set a shopping area (I assume that's what you mean) then shopping is off.

skyarkhangel commented 2 years ago

Players may unknowingly set the home zone. I have a save game in which the home zone is set as a trade zone and every time a guest accesses this class lead to a stutters.

OrionFive commented 2 years ago

Maybe the issue can be improved with some caching.