yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.32k stars 1.56k forks source link

Road visual bug #4672

Closed AdityaMH closed 3 years ago

AdityaMH commented 3 years ago

Why i can't show my unique road from my own mod? Road keep showing default road even my unique road was added to mod (game.png, game.atlas).

AdityaMH commented 3 years ago

My road location was placed with no wrong. Screenshot_2021-07-29-15-04-37-099_com estrongs android pop

and the result, only railroad work perfectly but not with road. Screenshot_2021-07-29-15-06-55-037_com unciv app

SomeTroglodyte commented 3 years ago

I already explained that somewhere. That road png in your PR is dead, too. TileGroup.kt line 508. Walk the file's history if you want to find out who when or why, I'm too lazy.

AdityaMH commented 3 years ago

val image = if (roadStatus == RoadStatus.Road) ImageGetter.getImage(tileSetStrings.road) else ImageGetter.getImage(tileSetStrings.railroad) roadImage.image = image

should we change to this?

SomeTroglodyte commented 3 years ago

You're learning. Unfortunately tileSetStrings.road doesn't exist - so val image = ImageGetter.getImage(tileSetStrings.tileSetLocation + roadStatus.name) would be tempting, but then you would also have to rename road.png to Road.png and force an atlas repack, and get: image

A bit squashed... ...as I said, that Brown dot code is so surprising, I wouldn't touch this without knowing the original reason, and the unexpected (for the modder) non-proportional scaling may well be the reason.

AdityaMH commented 3 years ago

You're learning. Unfortunately tileSetStrings.road doesn't exist - so val image = ImageGetter.getImage(tileSetStrings.tileSetLocation + roadStatus.name) would be tempting, but then you would also have to rename road.png to Road.png and force an atlas repack,

Atleast make tileset modder like 5hex can create own road even image scale is so small like railroad.

and get: image

Don't worry i will trying to make road more realistic even hard (test it with my mod) after this code implemented.

A bit squashed... ...as I said, that Brown dot code is so surprising, I wouldn't touch this without knowing the original reason, and the unexpected (for the modder) non-proportional scaling may well be the reason.

Just one question, who made this code and he still continue to contribute? Let @yairm210 to take this decision later.

AdityaMH commented 3 years ago

For temporary, i will add this as default. Road

SomeTroglodyte commented 3 years ago

who

As I said, one could find that out using github's history - you could, too, to save 'our' time. I haven't yet found some function 'when did this change', so the only way I know is to open the 'view file at this point in time' (actual tooltip of the button may differ) and compare, repeat in a binary search pattern until you found which commit changed or introduced 'it', then look for commit comments or an associated PR or issue... Or wait for someone with some memory of this to explain.

xlenstra commented 3 years ago

Have you heard of git blame? It does basically exactly that, find out who last changed a line of code. Using that, finding out who wrote that exact line of code takes ~2 minutes at most: image

SomeTroglodyte commented 3 years ago

Ah, yes, command line versus GUI lazies... :+1: ... and the change's previous state was: val image = if (roadStatus == RoadStatus.Road) ImageGetter.getWhiteDot().apply { color = Color.BROWN } - no functional change ... and the real answer is: There never was a loader for road.png, but there was a time when Railroad was just a grey line, and that changed 2018-07-24 in commit "Railroad now looks like a railroad and visible on tundra"(https://github.com/yairm210/Unciv/commit/b4614fc1f546f6b82f99914a92e61143def17c2c#diff-652b642e3f12f7a976f680df09eb0e000de6f225604e8927dd9a7c3a194b0c95), direct commit no PR no comments.

So - not using the image is a remnant, not a conscious decision. We should patch to actually load the image.

AdityaMH commented 3 years ago

Have you heard of git blame? It does basically exactly that, find out who last changed a line of code. Using that, finding out who wrote that exact line of code takes ~2 minutes at most: image

I having join github many year. But never get touch on their repo. I'm just giving ideas, find solution and report bug (less). So, i never heard that.

Ah, yes, command line versus GUI lazies... 👍 ... and the change's previous state was: val image = if (roadStatus == RoadStatus.Road) ImageGetter.getWhiteDot().apply { color = Color.BROWN } - no functional change ... and the real answer is: There never was a loader for road.png, but there was a time when Railroad was just a grey line, and that changed 2018-07-24 in commit "Railroad now looks like a railroad and visible on tundra"(b4614fc#diff-652b642e3f12f7a976f680df09eb0e000de6f225604e8927dd9a7c3a194b0c95), direct commit no PR no comments.

So - not using the image is a remnant, not a conscious decision. We should patch to actually load the image.

So from beginning, we should patch this. because our dev not notice this from 3 years until now.