Made a terrain in terrain editor, but how do I import it in my game?

I’ve spend couple hours looking in howto make the terrain using heightmaps, alphamaps and textures, and that went well, I was able to modify the hills using heightmaps etc.
Now I decided to use the terrain editor, I made a new terrain textured it, … but now I’m stuck with the following: How do I extract the heightmaps, alphamaps and textures from the terrain to use it in game? Or is there any other way to do it?

Regards

The editor doesn’t support loading in heightmaps. However you can create a test level and in your app load that level, then create your terrain using your heightmap in code. Save out the scene again and open it in the terrain editor.

The terrain editor has full editing tools to create hills, valleys, ledges, slopes, and bumps. It is there so you don’t have to modify heightmaps manually or in a paint program.

EDIT: I may have misread your question. You add the terrain to a scene, then just load that scene in your game like you would any asset: using the asset manager.

Could you perhaps point me in the right direction to load the .j3o file containing the terrain into the game? I am able to spawn j3o objects converted from .obj files without an issue, but when I try the same with the j3o terrain I get an error

    Spatial terrain = assetManager.loadModel("Scenes/Map.j3o");
    rootNode.attachChild(terrain);

^ Just crashes
Spatial terrain = assetManager.loadModel(“Models/box.j3o”);
rootNode.attachChild(terrain);
^ Works fine

I know this is probably one of the most basic things to do and I apologise for asking such basic stuf, but I am unable to find the right documentation on this cause

Regards

EDIT: I found the issue, somehow my scene was corrupted, I’ve remade the map and saved under a different name, this time the terrain got displayed, thanks for your help, Regards

1 Like