Ability to lock entities in place
Posted: Sun Jan 24, 2021 8:26 pm
TL;DR
It's very easy to accidentally remove an entity, so let's make it a bit harder by adding explicit user intent. This has probably been suggested in the past, but I haven't found it.What ?
Right-clicking removes placed entities and ground tiles like stone brick and concrete. I propose adding a per-entity user-toggleable property to placed entities to "lock in place," visible when you click them like their other properties and off by default to retain the existing removal behavior. This property if "on" would outright prevent right-clicking to remove and, depending on the feasibility of the idea, prevent being queueable for deconstruction as well. In the event of right-clicking it the standard "cannot X" notifications (e.g. "can't reach" with error buzz sound and flyout text) can be used to alert the player, otherwise some more obvious visual and audio feedback. In the event of deconstruction probably do whatever is already done when you try to highlight an entity that can't be queued for deconstruction, like display an appropriate warning icon or something.Additionally, maybe add the ability to drag a box to highlight a region of multiple placed entities to mass toggle locking in place. Optionally, such a locking property may also be exposed to blueprints as "include existing locking in place" or something similar to other blueprint toggles, or have blueprinting default all lock-in-place to "off" but let the player know that current values won't get saved. If an entity is on the ground waiting to be picked up for whatever reason or otherwise unplaced, the property should be "off" similar to how unplaced assemblers don't retain what recipe they last made and how unplaced filter inserters don't retain whitelist/blacklist.
This wouldn't apply to ground tiles nor should it change entity behavior when taking damage. I'm not yet sure if such a toggle should be added to belts and pipes, but if they're treated as entities rather than tiles (being able to click on them and see properties would seem to support the former, and belts and pipes can certainly be removed just as easily as other entities) then probably yes.
Why ?
To remove placed ground tiles you must first have a tile in your hand, either landfill or any of the ground tiles, and then right-click will successfully remove them. This adds user intent and entities have no such limitation, therefore it is much easier to accidentally remove them if you simply rest your hand on the mouse or if you have twitchy fingers or something, and when this happens you're likely unaware of where the mouse is while you're distracted or thinking about your next move. It's less prevalent with laptop trackpads rather than external mice, but that is almost entirely due to the physical construction and placement of a trackpad in a laptop shell, and may actually be a worse problem than with regular mice if touch-tap is enabled. Yes there already is a minimum button hold time for removing entities already in place, but simply increasing it would slow most players down and the timer bar that displays isn't enough feedback (and currently is the only feedback the game offers) to let a more distracted player know that right-click removal is happening.For most use cases, the addition of this toggle wouldn't affect normal player action; being off by default retains the existing removal behaviors. Computationally, checking an entity for "is locked in place" should only be done at the beginning of a right-click removal action (probably immediately at the start of on-mouse-down) or when a deconstruction rectangle is highlighting it (basically however often the game already checks for "can-be-deconstructed," probably roll that entity property into the list of things the game already checks for entities). Adding this toggle adds "user intent," specifically the ability for the user to choose if they actively want an entity in place or not and later if they actively want to remove the entity or not, and the immediate benefit is preventing accidental removals. The most significant drawback is if a player tries to remove a locked-in-place entity and has forgotten (most likely due to time passing) or is otherwise unaware that it is locked-in-place (maybe on a multiplayer server and someone else locked it in place or something), therefore has to know about being able to click on the entity and toggle that property off before attempting to remove it again. I'm not sure if there should be some time throttling in place to prevent rapid toggling, but whatever other toggleable entity properties already have in place to prevent such obvious trolling should be good enough if there already exists such a measure.
For general "can-be-deconstructed" checking, being within player reach probably takes priority for the flyout notifications and any "locked-in-place" checking should probably only be done if the entity is otherwise normally within "can-be-deconstructed" conditions.