-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add graph/timeline colors based on country flags #80
Comments
Yes, having consistent (or at least similar) colors would be a huge improvement! I tried this before but could never finish it due to time limitations.
I had the same question and didn't manage to fully figure it out at the time. I believe it's actually a different file that is relevant here:
This is also one of the files that is modified by country color mods like this one, so I'm pretty sure that it's the right place. I am not sure how the colors in the save file map to this. I think one of the additional colors might be used if the country is part of a federation or some similar in-game condition? But this is just a guess.
I researched this before and at some point just accepted that there will be breaking changes like this from time to time and decided not to worry too much about backwards compatibility. It means that users will have to start a new game, but this usually happens with every major game update anyway. When I have time to work on the dashboard, I usually start with non-breaking updates first so anyone stuck on the old version can at least get one more round of bug fixes. That said, if you have some idea or experience for handling migrations in sqlalchemy that doesn't add much work, I would reconsider it.
Good question, we can first try draw some borders as you suggested. I'll have another look at the scipy Voronoi data structure. Maybe I can make some small example work. Alternatively (or additionally), we can apply some small hue offset based on a hash of the country name, similar to the current approach. Or we check the number of countries with the same color and space it out evenly over some range Overall from taking a look at the code, I think your solution is quite good. The only bigger change I would add is to obtain the available colors at runtime, similar to how the localization of names is handled. I think it is quite common to mod and it would be great to have compatibility with that. |
Wow, that looks great! |
I agree, it looks much clearer with the borders. I pushed my changes here but I'll have another look tomorrow to clean up the duplicated code a bit: #84 This was faster than I expected, so maybe I can try something else for the colors tomorrow. Maybe I'll try the part I mentioned about parsing them from the game files, I think your branch actually covers most other changes already. |
Updated the branch to lastest master to include the lined borders I changed the names to medium size, white outlined by black as I found it the most readable, though I didn't like losing the color name. Maybe the text outline should be a different discussion/PR as it's a small change separate to map colors matching empire flag. |
@eliasdoehne are you working or planning on working on this? If not, I can take a look |
I am not working on this, but thought a bit about it previously. It would be great if you want to pick it up! You'll probably need to add the colors to the Country, populate that from the save file here (can they change over time?) and map to a color value at runtime (replacing/extending this). I am not sure about duplicate color assignments, so maybe it makes sense to keep the random colors for line graphs, or apply some random offsets to the country colors. (I think for the map this is no problem) |
Thanks for the pointers to relevant code; that helps.
yes, though the only case I know of is color changing to red when forming the galactic imperium
maybe we can detect duplicate colors, and lighten/darken the duplicates to be distinct (but preserve the hue for consistency) |
The above is a screenshot implementing lightness-shifting to avoid conflicts. Originally, the 2 top lines were the same color (see below): Thoughts @eliasdoehne? |
Hi, so first off, I have a branch where this is "done", but there's several maybe-issues and I'm not sure I like the design. So this is to discuss.
Second, it looks like this: https://imgur.com/a/f75FweM (Serious Empire is shadow_blue/white, Vulpes is orange/black, Mandasura is blue/black, and Zaxxod is dark_brown/blue)
Discussion:
visualization_data.get_color_vals()
which is the lowest-level color picking function and now does a database call. So I also implemented some storing of the colors in a few higher places. I'm not sure I like this design. But I wasn't sure where else to do the database calls, or where best to cache the retrieved colors. Thoughts?The text was updated successfully, but these errors were encountered: