[MIRROR] Overmap movement refactor #3257
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Оригинальный PR: Baystation12#35014
🆑 Atebite
tweak: Refactor overmap objects to allow all objects on the overmap to move
tweak: Movement indicators on the overmap have been adjusted to work with multiple object types
tweak: The sub-tile position of all overmap objects is now slightly randomized
bugfix: Fixed ships wrapping around the overmap too early into edges
bugfix: Fixed minimum speed checks on overmap movement
/🆑
Port overmap movement code from ships up to
/obj/overmap
. Acceleration logic is tightly coupled with ship thrusters, so I've left that alone. Icons are changed, but otherwise, from the player's POV, nothing has changed. The idea is to build new features on this refactor later.Overmap object movement
All overmap objects are now capable of moving on the overmap. Note that this PR doesn't make anything that didn't move before move. It just adds the technical capability for them to do so.
The picture below is only for illustrating the capabilities added by the refactor (that is, this is done with VV):

Heading indicators
Heading indicators are now 8-directional overlays on objects.


Also thought about doing a heading indicator which is accurate to the real heading/movement path, but it didn't look very good at most angles in my opinion.

Judging by the code I didn't get the impression that sensors should be able to perfectly know ship headings, either. Though if this is desired it's simple to re-introduce it.
Sub-tile position randomization
The initial spawn subtile position of most overmap objects is now randomized by up to 3 pixels in any direction. The effect is subtle but makes the overmap look less rigid. Subtile position randomization does not apply to ships, so the Torch (and other ships) will continue to spawn dead center on its starting tile.
Bug fixes
Minimum speed logic
An important note is that the old movement code had a bug related to minimum speed, making ships report as moving even when below minimum speed. To preserve the old feel of ship handling, the minimum speed has been lowered to 1 tile / 10 minutes (roughly 0.17Gm/h).
Wraparound
Previously, ships would wrap around when hitting the tile before the northern and eastern edges, and wrap around into the opposite edge tile. Objects now correctly wrap around on touching the map edge to the other map edge's boundary.