[Released] Runtime Terrain Editor

Available on Asset Store

Unity Terrain is a great tool but in runtime we don’t have a built-in solution to modify the terrain.

This package is a simple terrain editor works in runtime(play mode), built with unity ui components and Terrain API.

Demo on Itch.io
Discord

Features

  • Save and Load your terrain at runtime. Small file size with gzip compression.
  • RTS camera movement
  • Raise, lower, flatten, smooth, paint, object placement modes
  • Undo/Redo
  • Map size options
  • Example brush, paint and objects provided
  • Easy to use/modify, Scriptable Object based settings file

Limitations

  • This is not a complete solution for a level editor. It aims to demostrate runtime capabilities of terrain with simple controls.
  • Works for only a single terrain. Multiple terrains are not supported.
  • Serialization works by saving terrain size, heights, splats map(texture informantion) and tree instances information(not actual mesh model).
  • To load properly, the terrain must need same set of textures, trees, etc. in same order.
2 Likes

1.2 Released
New

  • New save and load panel
  • Serialization
    Bug Fixes
  • Fixed terrain position issues when placing or removing trees. Now it works for any position.
1 Like

Hello, this asset looks interesting.
Does it completely break when using HDRP, or is it a simple matter of letting Unity automatically upgrade the materials?

Hi,
Asset made by using default pipeline and materials pretty simple. So auto upgrade should work but I haven’t test for myself.

1 Like

Hello, I just bought the package but I don’t understand how to use it. I can’t find anything in the documentation on how to use the package. I have added a Canvas and added the LoadItem and SelectionItem but there’s nothing happening when I click on the Load button and there’s nothing showing in the SelectionItem panel. Is there a tutorial somewhere?

Hi, thanks for checking in.
Have you checked the demo scene? I built the demo scene as an implementation example for the whole editor idea, involving Terrain, Input handling(Command pattern - undo redo), Serialization and UI components. This is why the documentation only goes over the scene hierarchy and components.

You should follow along the entry point script ApplicationStart.cs and get a pretty fair idea of how the system works, almost a like a summary. It’ll initilialize the controllers and view components.
I know that some programming knowledge required to walkthrough the concept but I tried my best to keep the project as simple and minimal.

I can’t guide you without looking your code but maybe you can share your progress on discord.

Well, apparently my discord link on the asset store page was broken, I submitted the new link to the page, so it’ll be updated in a couple of day. Here is the new link.

I’ve got the demo scene running. I’ll look into how it works. Thanks.

I’ve got the demo scene working. Is it possible to use an already existing terrain instead of starting from an empty one? I have a terrain with heights, textures, details and trees and would like to use your tools to modify it but the modifications I’ve made to your scripts have not made it possible. I tried using the ‘OnSave’ routine from viewController in the ApplicationStart script but it only gave me errors. I made the ‘OnSave’ routine public and added this line after ‘Application.targetFrameRate = 60;’ in ApplicationStart:
viewController.OnSave();

It works but then I get errors and can’t do anything in Play mode.

It’s not designed to use an existing terrain, it’s possible but requires modifications and manual work.

Here is the Start method in ApplicationStart

Here you see, you are trying to call that method before any initialization. If you must use it here in Start method, you should do any modification after line 26.

Hi… I am also trying to continue on an existing terrain, I got that to work …but when it save and loads it resizes the terrain to 1024x1024m not the original size

I would love an example on how to implement in an existing scene, with a terrain that already exists there… I actually need to load the terrain at runtime from a Dem file (I use another tool for that), but would like to be able to edit in runtime… And it is not the mousepointer that does the edit, but a gameobject for instance a sphere…

Sorry for misunderstanding but like I mentioned above, there is no plug and play solution for existing terrains. It’s possible but you might need to modify the code for your needs.

Edit: I will clearly mention on store page about this issue. I might add this as a feature in future but before that I need to try and figure out a way. So please don’t expect a update soon :slight_smile:

Also there is a big update coming, most asked and requested feature, multiple terrain support is completed! I’ve been testing and refactoring the modify code for couple of months and I feel like it’s ready.

I need to make a new trailer video to showcase new features and I need a new documentation before release.

Here is a little teaser: 5x5 terrain patches, each size 128 and modified in runtime.

Multiple Terrains update is live, V2 released!

Hello, I think this asset is exactly what I want.
I wonder is it possible to replace the tree with my own prefabs and is there a way to add new objects like stone to this tool?

Hi, you can use any prefab. In demo project only 3 prefab used. Just assign your prefabs to Settings scriptable object in your project.
9126103--1266577--Screenshot 2023-07-05 at 15.33.26.png

Note that just make sure that it has a LOD Group component like below. Otherwise unity terrain won’t display it.
9126103--1266574--Screenshot 2023-07-05 at 15.32.52.png

Let me know if you stuck somewhere, I’m here to help :slight_smile:

It seems easy to use. I’ll try it. Thanks.

1 Like