Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Open world map: creating, chunking, streaming workflow

Discussion in 'General Graphics' started by Azeew, Jul 20, 2021.

  1. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    Hey! I'm struggling a lot to figure out what to do, I simply can't find any guides on the matter. It seems like everyone just uses Sectr/World Streamer for this kind of stuff, but I don't have the money for that.

    I'm trying to build an open world game. Don't worry, it's a 2.5D top-down low poly game, I'm not trying to recreate GTA. I want it to be open world simply to connect the areas more interestingly. But I have no idea where to start!
    1. How to create the terrain? I tried using Unity's terrain system, but I had a significantly better experience in Blender, having the flexibility of playing around with vertices. What do I do then? Create multiple small planes in Blender to form a big map, sculpt the terrain there, and then write a script to export it as a heightmap so that I can paint it as a Terrain in Unity? That sounds super convoluted... any other recommendations?
    2. How to chunk/stream the Terrain? It's pretty easy to just write naïve code that will enable/disable the terrain chunks that Unity's terrain system separates, based on the distance to the player. But what's correct way to do this? I also need to take into account all the other meshes that I'll import, NPCs and such. There seems to be a nice way to handle this via sub-scenes, but I really don't wanna mess with ECS. Any ideas?
    Also worth noting that I need extra control over the vertices (I think?) in order to create slopes and such, like in the example below. I absolutely cannot replicate this in Unity's terrain system. Also worth pointing out that since the game is top-down, I 100% don't care about LOD.



    Sorry for asking so much and being so clueless... I can always just google my way through this kind of thing, but in this case, I can't find anything regarding a free workflow for creating, chunking and streaming terrain for an open world game in Unity. Any help would be highly appreciated. Thanks in advance!

    EDIT: Sorry for the repost. I posted this in the world building subforum a while ago, but since I got no replies I was gonna post it here and delete that previous one. But now I just realized you can't delete threads. Now there's not much I can do hahaha, sorry if this is against the rules.
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,704
    There's also a free example project:
    https://assetstore.unity.com/packages/tools/utilities/scene-streamer-38168

    Mostly good for the source code. It basically demonstrates the simplest way to do what you're trying to do.

    Do you actually need Unity terrains? It would be much simpler just to import the Blender meshes as meshes. I don't bother with Unity terrains myself.

    Edit: I should mention, though, that my current project has more of an urban setting.
     
    Last edited: Jul 20, 2021
  3. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    Thanks a lot!! I completely overlooked that tool, it will help a lot :)

    About using Unity terrains, I was a bit drawn to it cause it chunks the terrain on it's own, and allows you to paint them all at the same time. In Blender I have to create a bunch of small chunks manually, and that way I can't just texture them all in one go, and I thought that would lead to a weird workflow and might create texture seams? Maybe I'm missing something though, I'm new to Blender.
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,704
    Instead of using the terrain painting tool, you might try and see if you can paint your meshes with polybrush. It's a free Unity package. It looks like you might be able to do the same thing for meshes as you can with terrains, but I've never used it before so I can't say for sure. Might be worth checking out since it's free.
    https://unity.com/features/polybrush

    You mean that you can separate the terrain into smaller terrains? This must be a newer feature because when I last tried, it couldn't be done all in Unity. You would've had to import the heightmap into a paint app and break it up there, then manually create a terrain from each section.

    So I guess the other possibility you're considering is to model the terrain in Blender but then want to convert the sections to a terrain so you can paint them using Unity's terrain tools? There's no built-in way to create a heightmap from a mesh in Blender (which seems silly to me because rendering normal maps and ambient occlusion from mesh are already built-in, so why not height maps too?). There are a few ways to do this, though. You can find instructions on google, but someone describes a simple method on this thread: https://blender.stackexchange.com/q...ght-map-and-then-use-the-height-map-to-create

    If you can separate a terrain in Unity, then I guess it might be easiest to create your entire map in one mesh/heightmap and then bring it into Unity and break it up there, On the other hand, before you do a lot of work, you may want to make sure that it's actually necessary to break-up the terrain at all (especially on desktop). This will depend on how big the terrain is and what sort hardware you're targeting, but remember that you can still page-in-page-out all of the smaller objects if you need to,
     
  5. AndersModen

    AndersModen

    Joined:
    Nov 19, 2019
    Posts:
    51
     
    Last edited: Mar 7, 2023