[Fixed]Terrain generation glitch

Do you have any issues? Don't hesitate to tell us about it.
User avatar
CommanderABab
AB
Posts: 11246
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

#1

Post by CommanderABab »

The different depths look nice! It might be purposeful.

User avatar
Sometheotown mayor
Has uncountable inhabitants
Posts: 1548
Joined: 28 Jan 2017, 21:37
Location: Somewhere in the middle of russia
Plugins: Showcase Store

Platform

#2

Post by Sometheotown mayor »

Not a glitch, look at the effect on the minimap ;)

User avatar
Lobby
Developer
Posts: 3719
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

#3

Post by Lobby »

:shock:
I didn't expect such an issue, but you're right

User avatar
Sometheotown mayor
Has uncountable inhabitants
Posts: 1548
Joined: 28 Jan 2017, 21:37
Location: Somewhere in the middle of russia
Plugins: Showcase Store

Platform

#4

Post by Sometheotown mayor »

That's not much of an issue, I think it looks nice

User avatar
Lobby
Developer
Posts: 3719
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

#5

Post by Lobby »

It's a bug in a recent saving optimization of ground tiles.

For the optimization I packed the height (16 bit value) and surface slope heightDX, heightDY (each 8 bit values) into a single variable hxy:

Code: Select all

int hxy = &#40;height << 16&#41; | &#40;heightDX << 8&#41; | heightDY;
This code is absolutely fine, as long as heightDX and heightDY are not negative. If they are, they will be proceeded by 1s so the OR opteration will always yield 1s for the first 16 bits. This results in a height value of -1 after the next loading.

The solution is to apply masks so that proceeding bits will be cropped:

Code: Select all

int hxy = &#40;height << 16&#41; | &#40;&#40;heightDX << 8&#41; & 0xF0&#41; | &#40;heightDY & 0xF&#41;;
Unfortunately it's a saving problem and therefore cities which already have this issue will continue to have it.

User avatar
Sometheotown mayor
Has uncountable inhabitants
Posts: 1548
Joined: 28 Jan 2017, 21:37
Location: Somewhere in the middle of russia
Plugins: Showcase Store

Platform

#6

Post by Sometheotown mayor »

*off topic*

Lobby I heard that you don't check the general discussion thread that often but please check it there's a message for you and Theo in it

Ty

*back to topic*
I didn't think it was a bug, I just thought it was like that to give an effect to the minimap

User avatar
Sometheotown mayor
Has uncountable inhabitants
Posts: 1548
Joined: 28 Jan 2017, 21:37
Location: Somewhere in the middle of russia
Plugins: Showcase Store

Platform

#7

Post by Sometheotown mayor »

Yes I agree that when sudden, it doesn't look very good

Oh, then my info is wrong thank you

User avatar
AndrewIsCool1111
Villager
Posts: 16
Joined: 05 Mar 2017, 22:56
Location: Guatemala
Plugins: Showcase Store

Platform

#8

Post by AndrewIsCool1111 »

I have the same problem, but I'm OK with it

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Posts: 8260
Joined: 25 Oct 2016, 15:20
Location: Johor Bahru
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

#9

Post by Ahmad Nur Aizat »

My old cities had these deep ocean trenches... I found few at Sedile

Maybe an option to customize our own ocean depths?

User avatar
Mayor Jeffrey IX
TheoTown Cartographer
Posts: 988
Joined: 05 Apr 2017, 16:48
Location: Right here
Plugins: Showcase Store

Platform

#10

Post by Mayor Jeffrey IX »

same with me

Post Reply Previous topicNext topic

Return to “Problems and Errors (bugs)”