Page 1 of 1
[Rseding91] FlowStatistics gui resets on player inventory size changed
Posted: Thu Jun 29, 2017 5:49 pm
by Mylon
While viewing a FlowStatistics window (like kills, power, or production stats), every time a player joins the timeframe is reset to 5s.
To recreate:
Open a FlowStatistics window (such as production stats)
Change time frame to 10m
Have another player join the game.
Time frame window is reset to 5s
Expected behavior:
Time frame remains at 10m
Re: FlowStatistics gui resets on player join
Posted: Thu Jun 29, 2017 6:32 pm
by Mylon
And now I can't seem to recreate it. :/
Re: FlowStatistics gui resets on player join
Posted: Fri Jun 30, 2017 12:14 pm
by Rseding91
I'm not able to reproduce any such problem either. If you find out for sure how to reproduce it let us know. In the mean time I'm going to move this to pending.
Re: FlowStatistics gui resets on player join
Posted: Tue Jul 18, 2017 11:58 pm
by Mylon
It just happened to me. Player "juusatsi" was dropped for the game. My power display screen is currently set to filter only miners and is set to 10 minutes. Juusatsi rejoins the game. Power display screen is back to the 5s view.
This occurred in 0.15.30
I knew I wasn't crazy.
Re: FlowStatistics gui resets on player join
Posted: Wed Jul 19, 2017 7:37 pm
by rorror
Mylon wrote:It just happened to me. Player "juusatsi" was dropped for the game. My power display screen is currently set to filter only miners and is set to 10 minutes. Juusatsi rejoins the game. Power display screen is back to the 5s view.
This occurred in 0.15.30
I knew I wasn't crazy.
Something like this happens also in the blueprint librairy, when you scroll down in the user list (when i user joins the list gets resetted back to the top)
Also very annoying.
Re: FlowStatistics gui resets on player join
Posted: Wed Jul 19, 2017 8:03 pm
by Rseding91
I still can't reproduce what you describe. Are you sure there's no other steps involved? Are you on the very latest (0.15.30 as of writing this)?
Re: FlowStatistics gui resets on player join
Posted: Thu Jul 20, 2017 2:45 am
by Mylon
On testing I found that the gui is reset by modifying the player inventory size.
Altering player.character_inventory_slots_bonus or force.character_inventory_slots_bonus or calling force.reset_technology_effects() (if force.character_inventory_slots_bonus is non-zero) will reset several guis, but only if the number is changed. This all happens on player login as part of my server so that is why I was seeing it happen then.
Production stats will be reset, power production will be reset, logistic network gui, achievements gui, and probably more will be reset all as if they had been closed and re-opened.
Re: FlowStatistics gui resets on player join
Posted: Thu Jul 20, 2017 3:47 pm
by Rseding91
Mylon wrote:On testing I found that the gui is reset by modifying the player inventory size.
Altering player.character_inventory_slots_bonus or force.character_inventory_slots_bonus or calling force.reset_technology_effects() (if force.character_inventory_slots_bonus is non-zero) will reset several guis, but only if the number is changed. This all happens on player login as part of my server so that is why I was seeing it happen then.
Production stats will be reset, power production will be reset, logistic network gui, achievements gui, and probably more will be reset all as if they had been closed and re-opened.
Ah, that's a known thing that we plan on addressing in 0.16.
Although I do wonder why would your inventory size change on login/disconnect? That makes no sense to me and sounds like what ever mod(s) you're using might be broken.
Re: [Rseding91] FlowStatistics gui resets on player inventory size changed
Posted: Thu Jul 20, 2017 4:09 pm
by Mylon
It's my RPG mod. Players contribute bonuses to the team, but only when online. So players can boost team carrying capacity when they log in. This involves calling force.reset_technology_effects() and setting the force.character_inventory_slots_bonus.
I'm running into a different bug where force.reset_technology_effects() causes players to dump inventory, even if the inventory space is readded within the same tick. Players shouldn't reduce inventory on logout
Eg:
Code: Select all
/c game.player.force.character_inventory_slots_bonus = 5
/c game.player.insert{name="iron-plate", count=10000}
/c game.player.force.reset_technology_effects(); game.player.force.character_inventory_slots_bonus = 5
Re: [Rseding91] FlowStatistics gui resets on player inventory size changed
Posted: Thu Jul 20, 2017 6:30 pm
by Rseding91
Mylon wrote:It's my RPG mod. Players contribute bonuses to the team, but only when online. So players can boost team carrying capacity when they log in. This involves calling force.reset_technology_effects() and setting the force.character_inventory_slots_bonus.
I'm running into a different bug where force.reset_technology_effects() causes players to dump inventory, even if the inventory space is readded within the same tick. Players shouldn't reduce inventory on logout
Eg:
Code: Select all
/c game.player.force.character_inventory_slots_bonus = 5
/c game.player.insert{name="iron-plate", count=10000}
/c game.player.force.reset_technology_effects(); game.player.force.character_inventory_slots_bonus = 5
Why are you resetting the technology effects? You can modify the slot bonus count and it immediately updates everyones inventory size.
Re: [Rseding91] FlowStatistics gui resets on player inventory size changed
Posted: Thu Jul 20, 2017 8:13 pm
by Mylon
I'm modifying a LOT of other factors at the same time. For example, I want to nerf ammo damage by 20%. This means nerfing base damage as well as the bonus damage from technology. Then I add back to ammo damage some variable based upon player's RPG stats. The easiest way to calculate this is to call reset_technology_effects(), then do "for each, ammo in pairs(ammotypes) do force.set_ammo_modifier(ammo, 0.8 * force.ammo_modifier - 0.2 + team_ammo_bonus) end"
I had a method to do this without reset_technology_effects(), but I had some kinks and it was giving bad numbers, and it was one hurdle among many.
Re: [Rseding91] FlowStatistics gui resets on player inventory size changed
Posted: Wed Sep 06, 2017 6:01 am
by Rseding91
I've fixed it for 0.16 so the game won't reset GUIs on inventory size change if the GUI has nothing to do with the inventory that changed.