[Rseding91] FlowStatistics gui resets on player inventory size changed

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

[Rseding91] FlowStatistics gui resets on player inventory size changed

Post 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

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: FlowStatistics gui resets on player join

Post by Mylon »

And now I can't seem to recreate it. :/

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: FlowStatistics gui resets on player join

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: FlowStatistics gui resets on player join

Post 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.

rorror
Fast Inserter
Fast Inserter
Posts: 241
Joined: Fri Nov 21, 2014 9:02 pm
Contact:

Re: FlowStatistics gui resets on player join

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: FlowStatistics gui resets on player join

Post 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)?
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: FlowStatistics gui resets on player join

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: FlowStatistics gui resets on player join

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: [Rseding91] FlowStatistics gui resets on player inventory size changed

Post 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

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] FlowStatistics gui resets on player inventory size changed

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: [Rseding91] FlowStatistics gui resets on player inventory size changed

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] FlowStatistics gui resets on player inventory size changed

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”