Undo only changes visible to player
Posted: Wed Sep 25, 2019 8:28 pm
Hello Factorio fans!
tl;dr: When using an "undo" functionality from newest release, apply it only to a point where change to undo is still visible on screen.
Longer:
So title and tl;dr says it all
As to why I think it is a good idea - when using undo function would undo an item that has been put somewhere outside of field of view, player may have (and I suppose usually won't have) an idea as to what was mark to be undone. This may lead to broken belts, rails and production chains and player won't even know about it.
Imagine situation - you've placed N items of a construction, but want to place it somewhere else, so you ctrl+z them. Upsy... ctrl+z used N+1 times and that 1 item has been set to be removed. Maybe even on the other end of your base. And let's be honest here - you don't memorise where you placed items for previous module/chain or where you made some amendments. In small bases maybe...
How do I propose it to work? Just let player undo last action only if it is visible on screen. Or (it may be simpler to implement) if that change is within certain radius from player (which can be fetched/calculated for given zoom level, so again - it can be done just to allow change to be undone if it is visible for player).
tl;dr: When using an "undo" functionality from newest release, apply it only to a point where change to undo is still visible on screen.
Longer:
So title and tl;dr says it all
As to why I think it is a good idea - when using undo function would undo an item that has been put somewhere outside of field of view, player may have (and I suppose usually won't have) an idea as to what was mark to be undone. This may lead to broken belts, rails and production chains and player won't even know about it.
Imagine situation - you've placed N items of a construction, but want to place it somewhere else, so you ctrl+z them. Upsy... ctrl+z used N+1 times and that 1 item has been set to be removed. Maybe even on the other end of your base. And let's be honest here - you don't memorise where you placed items for previous module/chain or where you made some amendments. In small bases maybe...
How do I propose it to work? Just let player undo last action only if it is visible on screen. Or (it may be simpler to implement) if that change is within certain radius from player (which can be fetched/calculated for given zoom level, so again - it can be done just to allow change to be undone if it is visible for player).