Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-architect System Map to operate on Object Tracks #5607

Merged
merged 6 commits into from
Aug 25, 2023

Conversation

sturnclaw
Copy link
Member

This PR redesigns the way the System Map generates and consumes Projectables to allow external systems to push (nearly) any kind of sensor contact data into the map to be rendered and inspected as icons. The SystemView is now responsible for providing the game glue code, while the SystemMapViewport is only concerned with visualizing SystemBodies and operating on the abstract interface provided by a list of Projectables.

This has a secondary benefit of being able to integrate the system map into other contexts such as an editor, in addition to improving the technical possibility of adding additional sensor-based gameplay.

There should be no (or almost no) change to the end-user experience of using the SystemView, but the developer experience is much improved.

Part one of a general decoupling of the map rendering from game logic. The map consumes a list of Projectables ("object tracks"), but is only responsible for generating and rendering SystemBody tracks for the current system being displayed.

Any external system (e.g. Sensors) can push tracks and orbits into the map to be displayed, including "fake" object tracks (e.g. sensor ghosts, e-war interference, etc.) using a unified interface.

Responsibility for understanding and rendering the contents of an unknown object track is reserved for the consumer of the final screenspace-positioned Projectables. This allows the map to be used in the context of the current game system, rendering cartography data on an unloaded system, or in an editor context.
SystemView is now responsible for only game-related functionality, and the SystemMapViewport is a reusable system inspector which can be used and embedded in various places.

- Added surface distance metric to prevent zooming inside of a planet's surface.
- Nothing in SystemMapViewport depends on the Pi:: architecture.
- Ships and associated orbits are now pushed by the SystemView class instead of the map itself.
Make the system map icon group heuristic a reusable function taking a list of special objects.
@impaktor
Copy link
Member

Sounds fantastic!
(I know @ecraven used to dream of playing with the sensors, however I believe that was for a gadget in WorldView.)

Copy link
Member

@impaktor impaktor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked your high level write up in the PR, I wonder if it should be documented somewhere else? In the head of the header file, for our doxygen?

src/SystemView.cpp Show resolved Hide resolved
src/SystemView.cpp Show resolved Hide resolved
src/SystemView.cpp Show resolved Hide resolved
@sturnclaw
Copy link
Member Author

I keep forgetting we technically still use doxygen. I'll try to write up a long header comment at some point to document the way the map is intended to be used and any gotchas that might need to be avoided.

@impaktor
Copy link
Member

I keep forgetting we technically still use doxygen

I've never seen anyone actually use it. But it's there at least.

@sturnclaw sturnclaw merged commit a181439 into pioneerspacesim:master Aug 25, 2023
4 of 5 checks passed
@sturnclaw sturnclaw deleted the system-map-viewport branch August 26, 2023 02:49
@impaktor
Copy link
Member

Thanks for the documentation strings 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants