Search Unity

[Released] Runtime Terrain Editor

Discussion in 'Assets and Asset Store' started by cemugurk, May 30, 2022.

  1. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33


    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.
     
    Last edited: Jul 27, 2022
    trombonaut and larry2013z like this.
  2. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    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.
     
    larry2013z likes this.
  3. FlightFight

    FlightFight

    Joined:
    May 29, 2017
    Posts:
    27
    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?
     
  4. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    Hi,
    Asset made by using default pipeline and materials pretty simple. So auto upgrade should work but I haven't test for myself.
     
    FlightFight likes this.
  5. Ben1970

    Ben1970

    Joined:
    Feb 23, 2023
    Posts:
    3
    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?
     
  6. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    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.

    https://discord.gg/4xKSwBgQGG
     
  7. Ben1970

    Ben1970

    Joined:
    Feb 23, 2023
    Posts:
    3
    I've got the demo scene running. I'll look into how it works. Thanks.
     
  8. Ben1970

    Ben1970

    Joined:
    Feb 23, 2023
    Posts:
    3
    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.
     
  9. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    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
    1.png

    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.
     
  10. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    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
     
  11. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    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..
     
  12. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    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 :)
     
    Last edited: Apr 5, 2023
  13. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    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.
    Screenshot 2023-04-05 at 20.51.06.png
     
  14. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    Multiple Terrains update is live, V2 released!

     
  15. Altman

    Altman

    Joined:
    Jul 5, 2023
    Posts:
    2
    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?
     
  16. cemugurk

    cemugurk

    Joined:
    Nov 27, 2014
    Posts:
    33
    Hi, you can use any prefab. In demo project only 3 prefab used. Just assign your prefabs to Settings scriptable object in your project.
    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.
    Screenshot 2023-07-05 at 15.32.52.png

    Let me know if you stuck somewhere, I'm here to help :)
     
  17. Altman

    Altman

    Joined:
    Jul 5, 2023
    Posts:
    2
    It seems easy to use. I'll try it. Thanks.
     
    cemugurk likes this.