Announcement

Collapse
No announcement yet.

World Machine & UE4 - Massive Tiled Worlds & Landscape Materials

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    World Machine & UE4 - Massive Tiled Worlds & Landscape Materials

    Hey everyone, first post on the forums. Recently with the launch of 4.8, I've decided to attempt a rather ambitious project regarding massive open world terrains. Using World Machine, I've created a 50x50 km landscape. Now originally, I used very few tiles as shown in other tutorials here on the forums (4x4 tiles, so 16 total). However, I found that with this size of a landscape, using so few tiles would cover far too vast of an area of the landscape, and I assumed that this would cause performance issues for the player. In addition, the amount of resources necessary to output tiles that large with the resolution and 1:1 m/p ratio was too much.

    So I've gone to a sort of extreme, and I suppose I'm doing a sanity check. I figured that if I'm creating a 50x50km world, and I want a fairly high resolution terrain, and I want decent performance, then when I needed to do was determine what a "reasonable" chunk of terrain would be for the player to render through level streaming. I estimated that about 500x500 meters was a decent size for a single tile of terrain, and what this results in is 100 x 100 tiles in world machine, so 10,000 total tiles. This is a methodology I found in this post.

    Now I don't know if this is the best way to go about this. I'm not sure how I would go about creating a landscape material for this, as instead of a single splatmap, normal map, or weight map, I'll have one for each tile of terrain (so again, 10,000 of each file). This was intuitive enough to work with when I created other large worlds, but with few tiles (only 16) and low resolution, but I'm questioning its practicality with large worlds such as this.

    Is there a better way to create an open world of this size, with a high resolution, and effectively divide the world into manageable chunks for the player? If this is a valid method, what sort of workflow should I use in order to create a landscape material if I'm using many different image maps, or does it matter?

    tl;dr: How do I make a 50x50 km world in World Machine, divide it into small manageable pieces for performance, and maintain a decent terrain resolution so I don't lose important details (rivers, erosion etc)

    I'd really appreciate some feedback/advice.

    Pic related, early version of the map.
    Attached Files
    Last edited by gwrought; 06-23-2015, 02:11 PM.

    #2
    Still looking for help on this. Does anyone have any advice/experiences on creating similarly sized landscapes?

    Comment


      #3
      Hi!

      You need activate Enable World Composition in World Settings and import your tiled maps from World Machine into World Composition tools. It will create sublevels with streaming mode.

      You can see it in this lesson:

      https://www.youtube.com/watch?v=4aidYFu0GTQ

      This video tutorial in Russian, but I think it does not matter.

      Comment


        #4
        This might be of help:

        https://forums.unrealengine.com/show...ld-Composition

        Comment


          #5
          Thanks! So this will work properly, even with the extreme amount of tiles I'm using? I've gotten world composition working on smaller maps before.

          Comment


            #6
            Well before you jump in to such a huge process I would recommend to make some test, because at the moment I wasn't able to export the WM to look the same in UE4.

            So consider the following math to set up your WM:
            Decide you approximate terrain length in one side, eg ~30km, then go and check UE4 recommended landscape sizes, these are like 505, 1009, 2017, 4033 and 8129.
            No make a quick calculation 30000m / 2017 = 14.87... Once you have this float value, round it up to 15 better 16, then take the recommended UE4 size you used, 2017 x 16 (your rounded value) = 32272 m, this value will be your WM width and height.
            So go to in WM to World Extends and Resolution, set to width 32.272 km, then hit TAB, no in the same window, go to Resolution and type in 2017.
            Next in the Tab of Tile Build Options, set your Tile Resolution to 2017 (from your earlier calculation), and for Tiles Per Side set 16 (earlier calculation), Blending percentage set to 100%.

            Now the fun part comes, the in the next Tab, General setup, set you max elevation baring in mind that you always use a height of 256 multiplier, so eg. 256x8 = 2048 m should be fine for you max elevation. NOW: if you use Base elevation then enter the same value with negative: -2048, in this case when you import your terrain in UE4 always set the Z to the half of your WM Max elevation, in this case 1024. If you use 0 as Base elevation you dived you WM Max Elevation with 4, so 512!

            THE BAD NEWS: after all 5 hours of waiting 3h in WM and 2h in UE to import your terrain, then Load it in, you will never receive the terrain you wanted, since it will be flipped in X and also Y axes.
            Solution... None that I know of...
            To see what is happening, just create a smaller terrain, eg. 4km, so you have your math 4000/505 = 7.92, round it up to 8, then 8x505=4.40km, then import in to UE, you'll see that nothing is matching, it's like mirrored...

            If you find a solution, let me know!
            Last edited by Stephnx; 06-28-2015, 07:18 AM.

            Comment


              #7
              The good news is that I found solutions for two of my major problems.

              The first is how to re-scale the Z from UE, because you don't like the resulted height after you Load your tiles:
              - Select you LandscapeProxies from the World Outliner, all of them! Go to Modes->Landscape. Without doing anything further here, check your Details window, because under Transform all your Settings became available, even though your Landscape Proxies which you selected earlier became deselected. Do not try to select them again, just simply set your Z value to another. It is imperative to have all your Proxies selected first, otherwise you will mess up your Z applying it just to some...

              The second and biggest issue, the fact that your imported landscape is flipped on X.
              - Select again ALL your Landscape Proxies, then right click, select Transform->Mirror X. Depending on the terrain size, you will wait a while, but it will solve your problem

              Hope this helps..
              Last edited by Stephnx; 06-28-2015, 09:32 AM.

              Comment


                #8
                Thanks for the information guys. It looks like I'm just going to experiment a bit with this and see how it performs. Currently I'm having issues importing the tiled landscape. It simply doesn't respond when I select my heightmap tiles. I can easily import only a few of the tiles though. UE4 doesn't lock up, it just acts as if I didn't select anything.

                Edit: Usually for using splatmaps and normal maps, I'd simply use the image as a texture within the material. However when exporting a tiled landscape, instead of one splatmap I have one for each tile. How would I go about using a splatmap to establish a base texturing on a tiled landscape?
                Last edited by gwrought; 06-29-2015, 06:54 PM.

                Comment


                  #9
                  About your import problem, you should check if in the import window detects the tiles resolution, if not this means your WM sizes are not correct, just follow my guide.
                  Also always remove your imported tile levels from the Content Browser before you re-importing the same tiles! Otherwise you'll have a mess.

                  Regarding the tiled flow map I'm afraid I don't know the correct answer. I'm just two steps ahead of you. But this a good one.

                  By the way, if you export your tiles in WM in steps and you want to import it progressively into UE, at the moment I'm havving the issue that the new tiles Z is shifted with almost 2000 cm! This is a mystery!

                  Comment


                    #10
                    In World Machine, making your maximum elevation is a multiple of 512 makes calculating the math of your landscapes z axis much easier.
                    The default maximum elevation of a landscape in UE4 is 512meters, and it is created 100 cm up

                    As for the X and Y. Since you are using 505x505 tiles, that's 505meters x 100 = 50500 or 50.5km.
                    Then on your tiled build options page, select the tile resolution 505 as you said already.
                    50 tiles per side
                    100% blending
                    Share edge vertices should be ticked
                    DON'T FLIP ON THE Y AXIS.

                    Flipping your terrain on the Y axis does literally that and is completely useless. Yes, it will import your landscape in one piece, but it will be flipped. No amount of flipping nodes will correct this. You use flip nodes and flipping on Y axis option and you are back to square one. A landscape imported that doesn't line up.

                    I don't know if you are using the pro version but I assume you are, I also assume you are doing a tiled build :P

                    The problem with importing to unreal is that it reads the file names wrong. In particular the Y coordinates in the file name. So they need to be reversed.
                    Say you have 4 tiles across, you would have.
                    Exterior_x00_y00
                    Exterior_x00_y01
                    Exterior_x00_y02
                    Exterior_x00_y03

                    The Y coords need reversing, like so.
                    Exterior_x00_y00 - Exterior_x00_y03
                    Exterior_x00_y01 - Exterior_x00_y02
                    Exterior_x00_y02 - Exterior_x00_y01
                    Exterior_x00_y03 - Exterior_x00_y00

                    This needs to be done for your height files as well as your texture height/weight maps.



                    Then when importing, you have world composition ON. Then in the levels panel using "Import Tiled Landscape"
                    Like so http://i.imgur.com/mafCvKz.png

                    Then on the "Import Tiled Landscape" Dialogue. http://i.imgur.com/nKQ4rAC.png
                    Set your tile coordinates offset to half of the total cells across in each direction. So in your case it would be minus 50 in both directions. This will shift all the landscape tiles in that direction so your world will be created centred in the world composition tool.

                    Make sure to set your scale and preferably a material instance on your main landscape material here.

                    Comment


                      #11
                      Thorax, thank you for the solution!

                      One question though, why the player stops when reaches the World Bounds (seen as a yellow square in the Tile Browser), if the map is larger then 20km?
                      Based on the docs it should Reshift the Coords, should it? Is there a setting for this or I have to stick with 20 km.

                      Thanks!

                      Comment


                        #12
                        Originally posted by gwrought View Post
                        Thanks for the information guys. It looks like I'm just going to experiment a bit with this and see how it performs. Currently I'm having issues importing the tiled landscape. It simply doesn't respond when I select my heightmap tiles. I can easily import only a few of the tiles though. UE4 doesn't lock up, it just acts as if I didn't select anything.

                        Edit: Usually for using splatmaps and normal maps, I'd simply use the image as a texture within the material. However when exporting a tiled landscape, instead of one splatmap I have one for each tile. How would I go about using a splatmap to establish a base texturing on a tiled landscape?

                        For your question regarding the textures, and flow map, you will get the answer here https://wiki.unrealengine.com/World_...ld_Composition

                        Comment


                          #13
                          Originally posted by Stephnx View Post
                          Thorax, thank you for the solution!

                          One question though, why the player stops when reaches the World Bounds (seen as a yellow square in the Tile Browser), if the map is larger then 20km?
                          Based on the docs it should Reshift the Coords, should it? Is there a setting for this or I have to stick with 20 km.

                          Thanks!
                          World Settings >> World >> Show Advanced >> "Enable World Origin Rebasing"

                          Comment


                            #14
                            Hi,

                            In 4.9 tiled landscape import will have an option (enabled by default) to reverse tile Y coordinate.
                            When exporting from World Machine:
                            Share edge vertices should be ticked
                            DON'T FLIP ON THE Y AXIS.
                            Right now, unfortunately you will need to do it manually as Thorax said.

                            Comment


                              #15
                              Thank you for both!

                              Comment

                              Working...
                              X