Infinite terrain work in progress

Feb 26, 2011 at 4:22 AM
Edited Feb 26, 2011 at 4:34 AM

Bamyazi gave me some code from another project, to implement infinite terrain ( RegionCache in latest source version on mercurial).

I adapted it to the existing code, it compiles but it's currently not in use.

But something I have done completely is "rebuild the map generator with a far smarter one which can produce the landscape for any region on demand" . 

I had just to port it from my old java project , the only difficulties were to not multiply by regionWidth 2 times (because region.position is already multiplied and in my java code it was not ) and to understand how to overrides a method in c-sharp ;) 

There are now 3 new terrains : FlatReferenceTerrain, SimpleTerrain, and TerrainWithCaves. The code originally came from the minepackage unity project ( Big thanks to the minepackage guys ! ) .

For now I just plugged it in gameclient.cs . There are no trees and water, and the region height must be equal to map height , tuned for 128 blocks like a certain game named minecraft ;)   

 FlatReferenceTerrain is for debugging : 

Image and video hosting by TinyPic

SimpleTerrain is just valleys :

 Image and video hosting by TinyPic

And terrainWithCaves has ... caves :

 Image and video hosting by TinyPic

Next step : adding and removing regions with the multithreaded regionCache & cleaning and debugging the code, then only reimplement trees, water, snow, lava , anything.

Bamyasi can you help with the regionCache ?

Feb 26, 2011 at 6:25 AM

Wow looks really good.  Texture pack is such an eye sore!  Let me see if I can find something.

Feb 26, 2011 at 9:51 PM

If you want to play with textures, try to adapt the code to use 32*32 textures instead of 16*16, and post the patch :)

And please check the license of the textures you use and show us where they came from ! 

Feb 27, 2011 at 10:59 AM

I modified the client to allow for minecraft terrain.png files to be loaded. They can be of any resolution theoretically (I've only tested 16/32/64/128/256) and do not require  any magic number changes. Once I get finished with a few other things I've been working on and have a chance to clean up the code, I will post it up if you'd like.

Feb 27, 2011 at 1:13 PM
Edited Feb 27, 2011 at 7:12 PM

go on, post it if it works, even if its not perfect !