Revolutionary-Games / Thrive

The main repository for the development of the evolution game Thrive.
https://revolutionarygamesstudio.com/
Other
2.81k stars 501 forks source link

Fix evolutionary tree species circles having cutoff bottom sides at certain zoom levels #3715

Open hhyyrylainen opened 2 years ago

hhyyrylainen commented 2 years ago

See this screenshot for example: 2022-08-15_16 59 29 9418

the bottoms of the circles don't appear round

84634E1A607A commented 2 years ago

The cause of the problem is the small size of a circle - the bottom round part seems to be cut off by Godot.

hhyyrylainen commented 2 years ago

I think we could perhaps reasonably do something like round the button size up or something to avoid the specific pixel sizes this issue occurs at.

84634E1A607A commented 2 years ago

30x30 (100%) image

5x5 image

6x6 (20%) image

8x8 (26.67%) image

10x10 (33.33%) image

15x15 (50%) image

Summary:

This happens when size is less than 10x10

Kiloku commented 2 years ago

Disabling mipmapping in the import settings for this asset avoids this issue, but makes the icon look pixelly.
I tried replacing the asset with a 10x10 version imported without mipmapping, and it mostly worked but had a small bit weirdly cutoff in the second to last zoom level.
Another choice I thought of but didn't have the time to try using this: https://github.com/godot-extended-libraries/godot-antialiased-line2d and render the icon procedurally as 3 layered circles rather than from a png. Using the default Polygon2D Node doesn't work too well because antialiasing doesn't work properly for it.

hhyyrylainen commented 2 years ago

The rest of the evolutionary tree already uses the direct control drawing methods so using the calls to draw a circle etc. would be directly usable. I don't know what kind of performance impact that would have as you need to set the vertex count (and antialiasing) high for circles to be really circular looking.