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

[Enhancement] Display Stars on the Galaxy Map #9709

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

Azure3141
Copy link
Contributor

@Azure3141 Azure3141 commented Jan 22, 2024

Feature

This PR addresses the feature requested by {{definitely so many people, please merge this Derpy I'm begging you}}

Summary

This is a complete rewrite of #7197, which I asked Derpy to close because I was too busy at the time to implement the changes he suggested.

This adds a new map display mode, toggleable via a button, that changes out the system rings at close zooms for star icons tied to each star definition. These automatically populate the map based on the contents of each system, with support for multi-star systems.

When the starry map mode is displayed, at close zooms the system rings become transparent and system colors (showing government, commodity prices, etc) are transferred to the system names instead, blended with the default system name color for visibility purposes. This goes away as you zoom out, with the system names becoming more grey and the rings returning to their full opacity.

The entire map mode can also be disabled by clicking the toggle button, which is located above the zoom buttons in the bottom right.

The new star icons are located in a new map folder inside images, and I've relocated the milky way sprite (but not the deprecated galaxy sprite for backwards compatibility) there.

Screenshots

Close in view with starry map on:
9c9d8868a42303a450f9a7105a97be01

Another close in view with starry map on:
49d996a566507193d7b472cfb747e277

Close in view with starry map on and a commodity selected:
d99aec2b58c525d1b8395b20b230c48c

Zoomed out view with starry map on:
36fa73ad7c5ed972884e78233fcce0d7

Zoomed out view with starry map on and a commodity selected:
a3f6e43ee370635454472f41a91fa564

Zoomed out view with starry map off (same as vanilla):
c06a13420388ba038ad041d1550a316a

Usage examples

A star (as in stars.txt) can have a n icon sprite defined for it using the icon attribute.

star "star/k-supergiant"
	power 1.8
	wind 3
	icon map/k-supergiant-star
star "star/m-supergiant"
	power 1.6
	wind 3.1
	icon map/m-supergiant-star

Testing Done

Looked at the map. Pressed the button. Saw stars.

Artwork Checklist

Will do laterz

  • I updated the copyright attributions, or decline to claim copyright of any assets produced or modified
  • I created a PR to the endless-sky-assets repo with the necessary image, blend, and texture assets: {{insert PR link}}
  • I created a PR to the endless-sky-high-dpi repo with the @2x versions of these art assets: {{insert PR link}}

Performance Impact

Hopefully none? BatchShader is used to draw the star sprites so it shouldn't affect things too much, and I haven't noticed anything in testing.

@Tangle10
Copy link
Contributor

This is a beautiful implementation of a sorely needed internal reference tool. Aside from its aesthetic value, without something like this the only ways to take advantage of systems with good solar power or solar wind are to memorize which ones are best or to make one's own map. As such, playstyles and ship designs reliant on solar power gain a path towards greater viability- and anyone needing a refuel doesn't have to go "wait, was Anbrim the supernova or Cshudlye?"

@mOctave
Copy link
Contributor

mOctave commented Jan 22, 2024

Looking at your screenshots, I really like this. It's beautiful, it's useful, and have I mentioned that it's beautiful?

However:

  1. Having the stars on in zoomed out view clutters the screen up a lot, and doesn't really add any value since in order to see the stars clearly I would need to have my eyes a centimetre away from my screen. The stars also overlap with the rings, which gets a little confusing. Maybe it would work better if the "ring" in this mode was an outline of the star that was a certain colour, although I don't think that would fix the busyness issue.
  2. The coloured text is beautiful, but when it's an uninhabited system the grey seems more transparent than usual. As a result, it is difficult to read against the background. Perhaps uninhabited systems could use a lighter grey or even a white when star mode was enabled?
  3. When the star sprites are large enough, they overlap with the text. This makes it even harder to read the text, especially since most of the systems with large stars are also uninhabited and therefore their names are harder to make out.

@Azure3141
Copy link
Contributor Author

Having the stars on in zoomed out view clutters the screen up a lot, and doesn't really add any value since in order to see the stars clearly I would need to have my eyes a centimetre away from my screen. The stars also overlap with the rings, which gets a little confusing. Maybe it would work better if the "ring" in this mode was an outline of the star that was a certain colour, although I don't think that would fix the busyness issue.

I personally think it looks better, but that's what the toggle is for. I could maybe make the stars shrink more when zoomed out?

The coloured text is beautiful, but when it's an uninhabited system the grey seems more transparent than usual. As a result, it is difficult to read against the background. Perhaps uninhabited systems could use a lighter grey or even a white when star mode was enabled?

I've increased the opacity to see if that helps.

When the star sprites are large enough, they overlap with the text. This makes it even harder to read the text, especially since most of the systems with large stars are also uninhabited and therefore their names are harder to make out.

I've made the spacing scale with the number of stars in the system (which would result in an wider icon) to help alleviate this. This also stops trinary+ systems from becoming blobs with the new additive blending.

@Koranir
Copy link
Contributor

Koranir commented Jan 22, 2024

  • The star sprites are too bright compared to the text and everything else, add some transparency.
  • If a system doesn't have a star sprite, it just disappears and leaves a conspicuous spot on the map.

I've opened a pull request on your repo that has fixes for these issues.

@Azure3141
Copy link
Contributor Author

I've implemented those changes with some slight differences on my end (which is why I did it manually instead of via committing your PR)

The system ring now does not vanish if there is no star in that system. The stars also become more transparent when you zoom out, hopefully addressing @mOctave's concerns.

@bene-dictator bene-dictator added enhancement A suggestion for new content or functionality that requires code changes artwork Everything related to images, sprites, and graphics UI Everything related to the User Interface & Design (both artwork and code) labels Jan 22, 2024
Azure3141 and others added 3 commits January 23, 2024 11:42
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
data/_ui/interfaces.txt Outdated Show resolved Hide resolved
source/MapPanel.cpp Outdated Show resolved Hide resolved
source/MapPanel.cpp Outdated Show resolved Hide resolved
source/MapPanel.cpp Outdated Show resolved Hide resolved
source/MapPanel.h Outdated Show resolved Hide resolved
source/PlayerInfo.h Outdated Show resolved Hide resolved
source/UniverseObjects.h Show resolved Hide resolved
Azure3141 and others added 5 commits January 28, 2024 10:33
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
Co-authored-by: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com>
@Ferociousfeind
Copy link
Contributor

All I'd want is a way to disable the rings, so I can just see the stars, the way apollo astronauts did not see any political borders, just the natural beauty of their pale blue dot. It would help with visually gauging distribution data, like where there are many bright stars, where there are many dim stars, how density and composition change in different places, where the interesting things even are...

@Koranir
Copy link
Contributor

Koranir commented Jan 31, 2024

All I'd want is a way to disable the rings, so I can just see the stars, the way apollo astronauts did not see any political borders, just the natural beauty of their pale blue dot. It would help with visually gauging distribution data, like where there are many bright stars, where there are many dim stars, how density and composition change in different places, where the interesting things even are...

Perhaps we could have a third mode in which the stars are full alpha and there are no rings, maybe could reduce the transparency of the rest of the map elements as well.

@Hecter94 Hecter94 mentioned this pull request Feb 9, 2024
@SomeTroglodyte
Copy link

Oh my, this is so beautiful I'll pull this, compile, and stop updating until the release notes mention it...

@@ -132,6 +132,7 @@ class UniverseObjects {
std::map<const Sprite *, std::string> landingMessages;
std::map<const Sprite *, double> solarPower;
std::map<const Sprite *, double> solarWind;
std::map<const Sprite *, std::string> starIcon;
Copy link
Member

Choose a reason for hiding this comment

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

Like leaf said, this should be a Sprite pointer and not a string. No use in passing strings around everywhere to then just get the Spriter pointer in the end anyways.

@TomGoodIdea TomGoodIdea added the waiting on OP The OP needs to provide something, e.g, making requested changes, posting assets, etc. label May 2, 2024
Copy link
Member

@bene-dictator bene-dictator left a comment

Choose a reason for hiding this comment

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

(I'll do Ejo's job.) Code comments all look good.

@Amazinite Amazinite added waiting on dev A developer needs to do something, e.g. reviewing, merging, resolving disputes, etc. and removed waiting on OP The OP needs to provide something, e.g, making requested changes, posting assets, etc. labels May 5, 2024
Copy link
Contributor

@RisingLeaf RisingLeaf left a comment

Choose a reason for hiding this comment

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

smth like this

@@ -1091,10 +1103,15 @@ void MapPanel::UpdateCache()
}
}

static const vector<string> unmappedSystem = {"map/unexplored-star"};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static const vector<string> unmappedSystem = {"map/unexplored-star"};
static const vector<const Sprite*> unmappedSystem = {SpriteSet::Get("map/unexplored-star")};

@@ -422,6 +422,8 @@ void UniverseObjects::LoadFile(const string &path, bool debugMode)
solarPower[sprite] = child.Value(1);
else if(child.Token(0) == "wind" && child.Size() >= 2)
solarWind[sprite] = child.Value(1);
else if(child.Token(0) == "icon" && child.Size() >= 2)
starIcon[sprite] = child.Token(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
starIcon[sprite] = child.Token(1);
starIcon[sprite] = SpriteSet::Get(child.Token(1));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artwork Everything related to images, sprites, and graphics enhancement A suggestion for new content or functionality that requires code changes UI Everything related to the User Interface & Design (both artwork and code) waiting on dev A developer needs to do something, e.g. reviewing, merging, resolving disputes, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet