narc0tiq / YARM

Yet another variant of the Resource Monitor for Factorio
https://mods.factorio.com/mod/YARM
MIT License
53 stars 40 forks source link

Click/action often "missed" (nothing happens) [multiplayer] #16

Open markheloking opened 8 years ago

markheloking commented 8 years ago

Factorio 0.12.10, Mods: Bobs mods (all), Landfill (2.1.6), RSO (1.4.2), YARM (0.6.23)

Playing multiplayer (Daniel34's server) often gives the problem that the buttons (the eye and the cross) for interacting with the YARM mod do not respond/don't do anything half the time. You have to press it a multitude of times and only every once in a while will it respond. Not sure if the same behaviour is seen in single player.

narc0tiq commented 8 years ago

Thank you for the concise and complete report. This is kind of a nasty one and needs YARM to become more clever (usually something I try to avoid).

What's happening is that every time the GUI updates (to show the current state of the tracked ore sites), all the site listings and their relevant buttons are destroyed and new ones put in their place. Visually this tends to seem static (site recounting updates happen on a different, slower cycle), but the game will tend to cancel your clicks on the buttons because they're being caused by a deleted UI element (which Factorio needs to do to avoid things like the FARL "exit train and crash all the players because you hit Enter" bug). Trying repeatedly will eventually make your click (press and release) happen while the button is still valid, which allows it to go through -- which is why it sometimes works.

I've been thinking about it, off and on, since I first noticed it in my games, and it's not easy. The reason I'm deleting all the GUI elements is to reorder them when needed; the only guaranteed way to avoid it is to stop maintaining the dynamic order by remaining ore percentage and move to something static like when the site was created.

Rest assured, I will continue thinking about the best way to resolve the issue; probably a combination of the first two options will end up being the final fix. In the meantime, give this in-dev package (direct download: YARM v0.6.24) a try -- it changes the GUI update timer to 5 seconds, which should make the cancelled clicks far less common (as per the third option).

markheloking commented 8 years ago

I am most in favor of the extra abstraction actually, but I agree that a combination of the first and second option might be better overall as well.

Thanks for maintaining this awesome mod!