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

SystemView Atlas Mode #5239

Merged
merged 12 commits into from
Jan 21, 2022
Merged

Conversation

Web-eWorks
Copy link
Member

@Web-eWorks Web-eWorks commented Aug 14, 2021

image
image

This PR reimplements the SystemInfoView as an Atlas display mode for the SystemView, similar to Elite: Dangerous' system map screen. It leverages the existing info box of the SystemView to display detailed information about a stellar body, and has a layout algorithm that produces (mostly) good results.

There are still several issues to be resolved; label positioning relative to the body and selection/interaction are two major glaring issues, as are several corner-case bugs with the layout algorithm in systems containing excessive amounts of gravpoints, like the below.

image

New body icons would also be very nice to have for this PR, as they're rather... low resolution and not meant to be zoomed upon, as this new screen allows.

TODO List:

  • Offset labels so they don't overlap other bodies further down the layout
  • Improve selection to use apparent body radius as hit-tested region
  • Cleanup label drawing code
  • Fix layout algorithm for systems with several gravpoints
  • Add screen-effect shader to stellar background Cut from this release, can be picked up by others.
  • Add centering / pan-to functionality Cut from this release, fairly trivial if one wants to walk the tree or add a cached offset value.

Fixes #5236, fixes #2985, fixes #4473, fixes #5213, fixes #5308.

@impaktor
Copy link
Member

Very nice!

I know it's been discussed before to replace our mixed-resolution atlas objects with toy icons, but I think these mini-pictures really adds a sense of feeling for a system. Only problem is the "mini" part. I was curious what would hapen if one tried some "deep learning" to do image upscaling (result is not that good, but showing it anyway) :

Example star

Original:
object_star_f
Upscaled:
output

Example planet - (Fail?)

Not so good example:

Original:
object_planet_large_gas_giant_hot
Upscaled:
output

@bszlrd bszlrd self-assigned this Aug 15, 2021
@Web-eWorks
Copy link
Member Author

The ideal plan is to simply render the same body objects we use for the world view - that is, actual stars and planets - at small sizes in the system view for both orrery (orbit mode) and atlas body images. This would mean you can plan your landing site from the SystemView, and means that the bodies you see in the system view match what you'll see in the system when you get there.

However, this is rather impractical at the moment because all of the code actually responsible for drawing a body is very tied to the world view and viewing the body from the perspective of a ship many millions of km away, and would need to be significantly refactored to produce good results in the SystemView. Also... we'd need to actually make our planets and stars look at least half as good as the icons do in both the SystemView and the world view for this to be a viable replacement.

@Bodasey
Copy link

Bodasey commented Aug 18, 2021

just to remember #4473

@impaktor
Copy link
Member

Some good/better results of image upscaling on the dev forum:
zQ21CVD
OXTUt7D

@Bodasey
Copy link

Bodasey commented Aug 20, 2021

I know, this is work in progress, hope you are open for a little test report (It's not written to tell you did bad work!):

Nice first screenshot from Web-eWorks to present the new wiev - but this is what I have seen first:

Sol_not_fit_to_window

So next task for the player is to reach the overview Web-eWorks has presented. To zoom with the mouse wheel works well, but how to move the display? Click, hold and drag ... no. Aaaah, first press the hold down to rotate view button!

Improvement Suggestions:

  • better autozoom to present the whole system in Atlas view;
  • hold down to rotate view function is on by default, also in the sector map, so the hold down to rotate button was obsolete.

Next thing i had a look on was the grid display mode. It can not be switched off in Atlas view, i also got no idea what could be the use of it there, and when you come back from another star system, it can be displayed even somewhere outside:

grid_out

Suggestion:

  • No grid in Atlas view

Now let's play a little bit: Carry a package to one of the numerous orbital starports in the Gliese 667 system. So let's look where this orbital starport is - nowhere?

Gliese_667

Aha, no orbital starports there (any more), so it must be on ground, checking all planets for a starport ... looking for information ... no, no information about starports available.

Suggestion/Fix:

  • Starports on ground are part of the object info;
  • Bodies with starports are marked/highlighted/underlined/... in Atlas view.

This is important to hyperjump to the right star (Gliese 667 A, B, or C)

Anyway ... great work you do!

@impaktor
Copy link
Member

Not sure I'd agree to remove grid. It highlights that the player is in "atlas mode", and watching a toy-representation of the system, where things are not to scale, relative each other (at least not distances).

@Gliese852
Copy link
Contributor

Why do we need to zoom in on the planets very much, imho the meaning of this view is to see on one screen what the system is like?

@bszlrd bszlrd mentioned this pull request Sep 18, 2021
@Bodasey
Copy link

Bodasey commented Dec 3, 2021

Do you plan a stable version for next February? If yes, it could be good to have a master branch who can be tested by playing (during Christmas time) - but to play without system view requires annoying research for stations in systems you are not familiar with.

Concerning grid: No distance function in Atlas view (so no need for) - and no scale in system map (1 AU in our solar system, but elsewhere?)

Another bug found in the sector map: Star systems cannot be selected by just clicking on them (you have to use the search window and there, you can click on the name for the system being selected)

There is also a grid in the sector map - without scale, without switch grid mode button, and without documented orientation? (assumed year 2000 celestial equator, of course good for today's players, but remember earth's precession)

And I think, System Atlas should get back it's button at the top row (unless you integrate all maps in one button there)

A completely other way we could go: The overview window (when flying) is added/integrated to the left side of the system map, it can be used as Atlas as well, it even displays distances yet!

@Web-eWorks
Copy link
Member Author

A completely other way we could go: The overview window (when flying) is added/integrated to the left side of the system map, it can be used as Atlas as well, it even displays distances yet!

@Bodasey it's funny you mention that - that's already been done and dusted in one of my development branches, it's just been waiting for this branch to be finished before I PR it in!

@Bodasey
Copy link

Bodasey commented Dec 3, 2021

I'd say bring your "dust" to master via a separate PR for playability sooner - the illustrated atlas can wait. Or is it here yet, ready to be tested? The files I see here are dated Aug 11.

@Web-eWorks
Copy link
Member Author

I'd say bring your "dust" to master via a separate PR for playability sooner - the illustrated atlas can wait. Or is it here yet, ready to be tested? The files I see here are dated Aug 11.

Patience good sir! All will be done in good time, but do remember that the developers still working on the project have their own jobs and lives which take priority over Pioneer development time. I do appreciate your willingness to test, but the time it takes to disentangle the overview window from its dependency on this and other work branches is time much better spent finishing this PR.

Speaking of which, I've been able to put some work in on this branch today; label drawing, body selection, and the layout of most systems have been massively improved. There's a bit more fundamental layout work needed on this branch (size reporting for layouts, better framing of system contents, etc), but it's getting close to a viable replacement of the old SystemInfoView and a point where I'd be happy to merge the branch in.

Some screenshots:
Screenshot from 2021-12-04 01-15-56
Screenshot from 2021-12-04 01-19-36
Screenshot from 2021-12-04 01-35-29

Now to address some of the feedback raised here:

So next task for the player is to reach the overview Web-eWorks has presented. To zoom with the mouse wheel works well, but how to move the display? Click, hold and drag ... no. Aaaah, first press the hold down to rotate view button!

The display is panned using the middle mouse button, which is the same across the world view, the system orrery view, and the system atlas view.

Next thing i had a look on was the grid display mode. It can not be switched off in Atlas view, i also got no idea what could be the use of it there, and when you come back from another star system, it can be displayed even somewhere outside:

The trio of buttons on the right side apply only to the orrery view; they will likely be hidden when in the atlas view.

Now let's play a little bit: Carry a package to one of the numerous orbital starports in the Gliese 667 system. So let's look where this orbital starport is - nowhere?

...Gliese 667 has no starports. I checked. Twice.

Bodies with starports are marked/highlighted/underlined/... in Atlas view.

I would like to do this, but it requires a further refactor of the way the Projectable system works for displaying bodies in both the system views, which I do not have time for at this junction.

Another bug found in the sector map: Star systems cannot be selected by just clicking on them (you have to use the search window and there, you can click on the name for the system being selected)

This is working correctly for me, not sure what you're doing.

@Bodasey
Copy link

Bodasey commented Dec 4, 2021

Web-eWorks, please don't feel chased - and please excuse me if you feel so.

Now let's play a little bit: Carry a package to one of the numerous orbital starports in the Gliese 667 system. So let's look where this orbital starport is - nowhere?

...Gliese 667 has no starports. I checked. Twice.

Had starports in #4473 and because it has been mentioned there, has become a test object assuming the starports or something else are still there. There was no transport commission on a bulletin board. (btw, #4473 is still not on the list of bugs fixed wit this PR)

@Bodasey
Copy link

Bodasey commented Dec 10, 2021

A short test report:

Another bug found in the sector map: Star systems cannot be selected by just clicking on them (you have to use the search window and there, you can click on the name for the system being selected)

This is working correctly for me, not sure what you're doing.

not observed any more

The display is panned using the middle mouse button, which is the same across the world view, the system orrery view, and the system atlas view.
The trio of buttons on the right side apply only to the orrery view; they will likely be hidden when in the atlas view.

pioneerwiki (read only?) says right mouse button, I expected left one - what if there is no middle mouse button/wheel?

some things to improve:

Oyamuri

known: many satellites cross
new: Info keeps displaying data from a system looked to before

Ethzelia

Overlaps can be in a way so that one object is not accessible any more, in this case Ethzelia C although displayed in foreground.

It may be a fine idea to keep closely bound stars tight together also in the Atlas view, but then the right ones have to stay together (A/B and C/D, displayed are A/C and B/D). And the planets of the deselected star have to go in a darkened background.

Ediskhir

Same as above
Nice to see that the more massive brown dwarf is smaller than the less massive one.
Two pairs of brown dwarfs? I wonder when such systems are discovered in nature - good phantastic system! (But to be honest, i think that even four so close brown dwarfs together are hardly brighter than a nearby giant star)
Is there a unit "Jupiter mass" defined in pioneer? Brown dwarf's masses are usually given with it.
Hasn't there been surface temperature data earlier?

@impaktor
Copy link
Member

pioneerwiki (read only?) says right mouse button, I expected left one - what if there is no middle mouse button/wheel?

  1. Would be good if you could find all places on the wiki where it says RMB is used for rotation, and even better if you could update it (or let us know).
  2. if there is no middle mouse button, you left click and hold the rotate-icon.

@Bodasey
Copy link

Bodasey commented Dec 10, 2021

and even better if you could update it (or let us know).

tried - no edit field found...
(in fact, half of the manual had to be rewritten, e.g. F5 for sector map now undocks ship, flight controls are contradictory, graphics outdated etc etc)

@impaktor
Copy link
Member

@Bodasey sounds strange, do you have a link? (you must login to the wiki to edit)

- Hover to show labels next to systemview icons
- Fix for uninitialized variable warnings
- Drawables::Disk now generates UVs as well
- Spruce up the atlas view with a background and zoom functionality
- Adjust star and planet perceptual sizes.
- Add a detailed display of system body information
Single-click to select and deselect objects in system map view.
Double-click to zoom to selected or reset viewpoint.

Fixes a few runtime bugs and expands the SystemView API.

Added text shadow for object names in SystemMap.
- Add screen size to projectable groups
- Render body names using offset and arrow
- Improve font / layout of body labels in atlas view
- Clean up view reset behavior
- Add icon indicator for body selection
- Improve initial layout for most systems
(Trinary+ star systems are still borked.)
Switch from single-pass algorithm to two-pass layout + render approach.
This is overall cheaper, and produces much better results in complex systems.
The algorithm could be tuned further, but I have no plans to do so in the near future.
Add an operator[] and vector / vector overloads to vector2.h
@Bodasey
Copy link

Bodasey commented Jan 18, 2022

no time for a deep test at the moment, only found time to download and compile - twice:

@nozmajner Please be prepared to update kanara model files also if this error keeps on

CreateCollisionMesh for : (kanara)
Created shader sphereimpostor (address=0x2d48450)
Speicherzugriffsfehler (Speicherabzug geschrieben)

with assimp5 while starting a new game

@Web-eWorks
Copy link
Member Author

@Bodasey you are the first person to my knowledge in multiple years to have issues loading these model files, and we've had people playing with all versions of assimp from 3-5. This is not a problem with the mesh files themselves, they have not changed in years and you are the only person to report this error - I'd recommend checking Pioneer out to a completely different part of your filesystem (make a directory in /opt and chown it to your username) and building from scratch there.

I would like to resolve the issue that is causing you to have errors loading models, but I can't currently allocate time to trying to reproduce a problem that no one else has ever encountered. As an alternative, you can clean the SGM model cache files and rebuild them (git clean -xf *.sgm; make -C build build-data) and see if that helps with the problem.

Other than that, if no one encounters an error with this branch I'm going to merge it ~Thursday and open a PR with the system body list window.

@Bodasey
Copy link

Bodasey commented Jan 19, 2022

Info keeps displaying data from a system looked to before
still there
Screenshot_20220119_010224

Overlaps: still happen, but everything is accessible
Ethzelia_B

played a while - no errors / crashes occurred

I would like to resolve the issue that is causing you to have errors loading models, but I can't currently allocate time to trying to reproduce a problem that no one else has ever encountered.

This is not a problem with the mesh files themselves, they have not changed in years

But the assimp package changed. Don't worry too much about this - i just observe and post what i see. Save the model files in an actual format should resolve this problem.

Properly track gravpoint radius parameter to avoid layout overlaps.
Clear the selected object when the active system changes.
@Web-eWorks
Copy link
Member Author

Info keeps displaying data from a system looked to before
Overlaps: still happen, but everything is accessible

Fixed. There should theoretically be no further edge-cases with gravpoint handling to produce this behavior. Also fixed the object label mouseover popup opening when under another window.

Going to merge this now, I've spent long enough on this code and any further hidden warts can be addressed another time.

@Web-eWorks Web-eWorks merged commit 7975d23 into pioneerspacesim:master Jan 21, 2022
@impaktor
Copy link
Member

Hooray! Great work @Web-eWorks and thanks @Bodasey for testing it!

@Web-eWorks Web-eWorks deleted the systemview-atlas branch May 14, 2022 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment