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:
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:
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?
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: