Tiled Terrain Editor Project – Initial Code Exposure

Greetings,

Apologies for taking so long at this, available time has not been good and I’ve been doing a lot of experimenting and learning as I go. So far I have image tile generation running and the menu system for the rest of it going.

I’ve uploaded the current code state to a new svn repository here:

https://code.google.com/p/radanz-game-code/source/browse/#svn/TiledTerrainEditor

You’ll need the library pngj added to the jMonkeyEngine SDK to compile it or download the compiled dist.zip file here

So far the menu works but the only real function working is: “Generate New Terrain” > “From HeightMap Image” > load any 16-bit Gray-scale PNG image > “Generate” > “Create Image Tiles”.

Only 16-bit Gray-scale png images are supported at the moment, any size, I have two test maps, one small at 10241024 and one very large at 81928192. The image is loaded one strip of tiles at a time so very large maps can be processed with exceeding memory requirements.

You can choose how many tiles to generate in both directions and the base image map will be scaled and interpolated as required, both bigger and smaller. Number of tiles is 8 minimum to 4096 maximum in each direction. Tile size selectable from 256 to 2048. PNG images will then be created and saved into the selected location under a new directory of the entered name (optional) with the file name: tilexxxxyyyy.png

Not much use for my terraintiler library at this stage but those who use jMe’s TerrainGrid will be able to use the generated tiles right away. Code to load the tiles like this:
[java]
assetManager.registerLocator(“path/to/tiles”, FileLocator.class);
this.terrain = new TerrainGrid(“terrain”, 65, 513,
new ImageTileLoader(assetManager, new Namer() {

        public String getName(int x, int y) {
            String fileName = String.format("tile%04d%04d.png", x, y);
            return fileName;
        }
    }));

[/java]

Next I’ll be working on the generation of terrainQuads with material saved to .j3o files for both my terraintiler library and terrainGrid. Material will use textures that can be loaded on the generation screen. More on that later.

Any comments of the code so far would be very appreciated.

Cheers.

3 Likes

So what is it intended for ? Any screenshots?

<cite>@ghoust said:</cite> So what is it intended for ? Any screenshots?

As the name suggests it’s a Terrain Editor (terraforming) program designed to work with massive terrains broken into a grid of tiles. Resulting tiles can then be used by jMe’s TerrainGrid, my own TerrainTiler lib or any other paging system.

The program (when I ever finish it) will do generation, editing, and saving of tiles terrains of any size up to 4096x4096 tiles. (at tiles of 1024 units this makes for a huge world…)

Most of my progress and screenshots are on my game blog @ thegame.radans.net
Unfortunately development has been delayed by other more important life factors at the moment but it’s not forgotten.

I have had thoughts however on deviating my ideas toward a more advanced “marching cubes” landscape system, not done any tests on this yet tho so no idea if I’ll ever implement it but certainly the resulting terrain is much better.

Anyways, thanks for the response, honestly not sure if anyone would use this when I do finish it…

Cheers.

@radanz said: I have had thoughts however on deviating my ideas toward a more advanced "marching cubes" landscape system, not done any tests on this yet tho so no idea if I'll ever implement it but certainly the resulting terrain is much better.
Have you seen this existing marching cubes project yet? They seem to be making great head-way, so whenever you wanna jump on board I'm sure you're welcome to.
<cite>@erlend_sh said:</cite> Have you seen this existing marching cubes project yet? They seem to be making great head-way, so whenever you wanna jump on board I'm sure you're welcome to.

Wow, a paging marching cubes terrain would be awesome… even the Ogre folks haven’t achieved that much yet. :slight_smile:

I personally have been hoping someone will finish an “infinite” terrain + editor of some sort for JME for a long time, there have been several attempts but no-one ever seems to finish. I don’t really have the time to spend on that stuff myself but I will certainly give it a go and help out where I can if someone makes one :slight_smile: