Intro Let physics rule the world

Palaxin

New Member
Some explanations regarding the plots: the units of the intensity axis should be multiplied with 10^4 meters (except for the first plot) with the ocean water table being at height 0. I defined the ocean floor to be at 4 km depth (-0.4 in the plots) with some trenches going down to 11 km (like Mariana trench) and the highest elevation going up to nearly 9 km (like Mount Everest). For plots 4-6 I added a small noise at the end of the whole procedure, so heights are more extreme in these cases. Of course the heights are quite arbitrary and must be rescaled for proper in-game use...

And please don't judge the code architecture too much, I know classes would be nice, the functions could use parameters etc. I also know that adding 256 sine functions for each height value is more than stupid performance-wise... This is just a first experiment :D
 
Last edited:

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hey @Palaxin - awesome looking ore in that mod you linked! :)

Got me confused on your algorithm comment - do you mean the ocean basin shaping or something more fundamental to height maps? We got working height maps but one of the items on the PlaTec wishlist is for it to be feeding its data tick-by-tick into a preview screen a la Dwarf Fortress so you can see the world generation since ancient times up till the present. With PlaTec native that would take some sort of JNI bridge, but you're also talking about rewriting PlaTec into Java? I think we noted somewhere there was an alternative version now on GitHub (a Java port? I forgot what / where already, doh), generating in 100% Java would certainly be easier.

In any case we could definitely use the extra effort on world gen, and there's a whole series of ideas of advancing pre-play world stages (like the world gen process playing in a preview window). Would be sweet to see continents clash together and ocean basins getting carved as you're preparing to play a world :)
 

Palaxin

New Member
Thank you @Cervator :) I think also an RTS could benefit from a little more realism regarding ores... Was mainly texture and .xml file editing work though.

Regarding the algorithm: The initial noise is rescaled depending on the height range. To make this effect more visible, I increased the respective parameters and did some more plots seen below. If h is the current height, Hmax the maximum height of the highest mountains, the algorithm works approximately like that:

if (h >= 0) h = (h/Hmax)^2 * Hmax

Because h/Hmax is in the range 0..1, low areas get even lower and plains are forming next to the ocean. To make mountains have sharp tops I made the exponent change dynamically from 2 to 4 depending on the height, e.g. at h = Hmax/2 it would be 3. I also added a little noise after that to make some artifacts of this algorithm (e.g. sharp edges of the height profile at shorelines) less obvious.
A similar transformation is done for the terrain below height 0 so that heights are leveled towards the defined ocean basin depth. So you can notice that heights around sea level and around the ocean basin depth occur more often similar to the real world. This also allows to define continental and oceanic plates at the beginning of the PlaTec algorithm.

Yes I would like to rewrite PlaTec completely. For me, it's not about having the least effort but learning the most about terrain generation and I think the best way to do that is writing a height generator from scratch. Last time I really used Java is also about 4 years ago, so I think it's also a good way to get into the language again. There seems to be a Java library for loading files created by WorldEngine which is based on PlaTec so I certainly will evaluate this possibility before I start to write own code. Probably it won't allow to implement the tick-by-tick preview you mentioned which would be nice, you are right! I would also like to implement erosion after each tick, but not sure if this would make world generation too slow...

Since my thesis is quite demanding and there are plenty more potential students for Terasology I decided to not apply. I want to work on this project nevertheless, but don't expect to hear from me sooner than in a month or so from now...

noise7.png
noise8.png
noise9.png
 
Last edited:

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Thanks for letting us know :)

Hope to hear from you again later with Java code and more scary numbers and graphs!
 
Top