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

ground tiles not aligned with buildings/units #2807

Open
jmdejong opened this Issue May 3, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@jmdejong
Contributor

jmdejong commented May 3, 2018

For a tile to be drawn on the correct position, the bottom of the tile should be at the bottom of the image, and the center of the tile should be at the image bottom - image width/4.
Ground tiles don't follow this.
Beach tiles are one or 2 pixels to high, and grass tiles are 4 or 5 pixels too high.
(you have to look at the images in a separate page to see the difference)
0 0 0

It looks like this has been done on puropose in an attempt to simulate elevation. Transitions of ground types also include this difference.
0 0

The problem with this is that the buildings are not aligned to this (including trees). If a building is placed in the grass it is will be slightly misaligned with the grass tiles. If this would be corrected, then the buildings would be misaligned on the beach.

Also, the effect that it is supposed to give is not really noticable when playing the game. The only thing you see is that the beach looks smaller when looking from the side of the island than when looking from the sea, but it does not give the impression that the island is higher than the sea

To fix the alignment issues I think it would be best to change the sprites so they don't simulate elevation. If elevation would be simulated this is better done elsewhere.

The current code in master tries to correct for these aligment problems by moving the buildings up a little, but this only causes misalignment on the beaches.
grass_alignment_old beach_alignment_old

The code in PR #2804 does not do this correction, and therefore building-gound alignment is somewhat incorrect on the grass.
grass_alignment_new beach_alignment_new
(here you also see the ground-beach transition, which looks even weirder)

@AndyMender

This comment has been minimized.

Member

AndyMender commented May 5, 2018

@jmdejong seeing that introducing x/y-shifts is a pain, we have the following options I believe:

  • drop "simulated elevation" entirely; it's hardly visible in-game anyway.
  • introduce per-tile type x/y-shifts, which frankly only enhances the original problem
@jmdejong

This comment has been minimized.

Contributor

jmdejong commented May 5, 2018

I think I would prefer dropping this simulated elevation.
Elevation could be a nice feature, but to properly implement it would require careful changes in several places of the codebase.
The challenge with dropping this is that the transition tiles would have to be flattened and re-rendered.

If we do want to go with elevation, I think it it possible to set a z position for buildings/units, so it could be fixed in a clean way. The main problem would be that the transitions/slopes will still look weird.

@AndyMender

This comment has been minimized.

Member

AndyMender commented May 5, 2018

Another thing is that elevation would probably need to be implemented on the level of the map grid itself, a la SimCity, otherwise it only complicates object positioning and isn't really visible in-game. I would be in favor of dropping it also.

@LinuxDonald @janexx thoughts?

@janexx

This comment has been minimized.

Member

janexx commented May 5, 2018

The challenge with dropping this is that the transition tiles would have to be flattened and re-rendered.

I think that should be not a very big issue. I can do that or at least test it out.

@LinuxDonald

This comment has been minimized.

Member

LinuxDonald commented May 5, 2018

@janexx if you have the time do it please

@janexx janexx self-assigned this May 5, 2018

@jmdejong jmdejong added the A-graphics label May 6, 2018

@jmdejong

This comment has been minimized.

Contributor

jmdejong commented May 7, 2018

By the way, the biggest problem with simulating elevation in code is the transitions (slopes).
It wouldn't really be a problem if it is impossible to build on slopes, and if units can't cross slopes (eg shores/cliffs/mountains).
The main problem here is the ground-beach transition since buildings can be built on both tiles, and streets for example have to be connected.

@jmdejong jmdejong referenced this issue May 13, 2018

Closed

Image Origins #2824

@LinuxDonald LinuxDonald added this to the 2018.1 milestone May 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment