In-game terrain editor mode

Status
Not open for further replies.

only_a_ptr

Infamous Developer
Administrator
Developer
Joined
Jan 31, 2018
Messages
167
Location
Prague, CZ
Hello new forum!

I'd like to write down my thoughts and ideas about the 'terrain editor mode' RoR currently has. The reason to do it now is a slight disagreement between me and @AnotherFoxGuy & @Michael10055: Added console command spawnobject

This is what we have:
  • During gameplay, you press a key and go into 'terrain editor mode'. You press it again and modified .terrn2 is saved for you.
  • You can select/modify terrain objects via keyboard. Status is displayed in the notification box.
  • Mouse controls camera as usual. You must use rorbot's 1st-person or 3rd-person camera while working, because free-camera controls interfere with editor-mode controls.
  • See great docs by Michael10055: Adding/moving terrain objects -

We really need a built-in terrain editor. A flexible one which can be extended without messing up the codebase and capable of full-scale terrain authoring, not just doing minor edits. The existing editor-mode is coded by cleverly hijacking rorbot's 3rd-person camera, our terrain manager, the notification box and "/config" folder. This is a development misery waiting to happen - adding any more features to the editor means messing with simulation code, and vice versa. I hated it when Ulteq wrote it, but I accepted it anyway. But it's a dead-end development strategy and I'm not willing to accept any further patches which continue it.

What I want for a terrain-editor:
  • Project folders located in "ror-homedir/projects/terrains". Each folder would contain scripts and resources for the WIP terrain and could be reloaded in-game. This isn't hard to do, we just have to add each project-folder as separate OGRE resource group and when needed, add additional resources or reload existing ones. See also ogre wiki page on resource management.
  • In-game, player could create a new terrain project from scratch or import existing terrain (multiple times if needed). When importing, RoR would ask for a new terrain name and generate new GUID.
  • Editor should allow heightmap modelling. OGRE terrain component (used by terrn2) supports this, OGRE has a sample application for it in it's SampleBrowser. We can also look into sourcecode of StuntRally's terrain editor for reference - it's also built on OGRE and it's terrain component, search for "Stunt Rally Track Editor Tutorial" on youtube.
  • Editor must have it's own dedicated camera mode and free up mouse cursor for terrain manipulation. Heightmap modelling only makes sense with mouse.
  • A GUI is needed to add new objects or select and navigate to existing ones. With DearIMGUI, this is no problem.
  • A visual marker for currently selected object would be good. Mouse-selecting objects from map would also be handy. I already coded both these for RigEditor.

TL;DR: The existing terrain editor is limited and badly coded. I'd prefer not to extend it but instead remake it for quality. But that will take a while. Can you wait until after v0.5, or should I rather accept AFG's patch right now?
 
Last edited:
I've spent numerous hours working on editing terrains. Here was my workflow, before my computer went down and I'm having to start over.

I work live from a folder in ror-home/terrains/

The terrain uses a heightmap for the ground (so I could use the splatted bump mapped ground textures, grass and trees).
It is then imported it in to Blender as a mesh, the 3d components modeled and exported to use on the map.

I like to use 3 tobj files:

One for the environment objects - buildings, rocks, etc
One for the particle objects - smoke, water, etc
One for roads

It just helps me manage them in my head.

Once you get the co-ordinate systems aligned between blender and RoR you can plug the co-ordinates from blender in to the tobj file quite easily, that is great for working from scratch, but if you have an item you want to drop at various points on the map then using the "AFG" editor is far easier.

A live terrain editor in game would be incredible. I use a paid for version of L3DT at the moment. Being able to rough it out in L3DT and refine in game would be invaluable.

I created my workflow based on what RoR has, but starting over would enable a lot of people to create/edit/mod maps without having to learn so much, this could be good for the community, bringing in talented modders from other games.

- - - Updated - - -

Things that would make terrain creation improvements for me, specifically as I have been making big terrains >8km in X and Y:

Multiple page support working, RoR works with huge maps, even 50km x 50km, but you cannot get sufficient details in the height map or landuse map, with one page. Using multiple pages fixes this, and the LODs degrade really well keeping frame rates high. Also allows for non square terrains. Although it works visually there are no physics collisions beyond page_0_0 currently.

User defining co-ordinate system origin of the terrain, currently origin is always 0,0 and the further you get from 0 the worse the physics become. If I have a square map 4096x4096 and center the co-ordinates at 2048, 2048 then the physics should be better over the whole terrain?
 
@rents1977 Thanks for the feedback, it's great to hear comments from someone involved.

The multi-page collisions got broken by an optimization I did with Ulteq probably 2 years ago - Instead of asking OGRE engine about terrain height, we copied the respective code section to RoR. We limited the collision to page 0/0 to simplify the task as we thought multiple pages are almost never used :eek: I'll revisit that.

Are you sure about the physics degradatation when moving away from map origin? I suspected it might be hapenning due to how it's programmed, but so far nobody complained about this out loud. If you can demonstrate this, please go ahead right now and start a GitHub issue ticket or a new Development forum thread because that's really serious, and it should be investigated and fixed at it's root rather than worked around by terrain system tweaks.

I'll start working on the editor just as soon as I'm finished with v0.4.8, I've already already planning it for a while. If you have any more ideas, get in touch!
 
Last edited:
Status
Not open for further replies.
Back
Top