Announcement

Collapse
No announcement yet.

Big World: Best practices? [info here]

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

    Big World: Best practices? [info here]

    This thread is now (becoming) a somewhat structured place to find information about the basics of creating big and somewhat seamless worlds in UDK. Anyone is free to reply to add opinions, modify information or fill missing points with any information that can be provided.


    1. World Size

    As of the July 2010 UDK Beta, if you're using the default scale (1 Unreal Unit = 2 cm) you can create a map as big as 524,288 x 524,288 Unreal Units (10,485.76 x 10,485.76 meters ~= 10 x 10 km).


    2. Single Terrain vs. Multiple Terrain Chunks

    To decide if you'll want to use a single terrain for the whole world, or use different terrain chunks, consider the following:

    2.1. Seams
    2.1.1. Do two aligned terrain chunks produce a visual seam?
    There's a *very* slight edge, but once/if UDK runs with Anti-alias it should disappear for good.
    However if you use LOD on your terrain the seam becomes quite visible at LOD changes (very frequent if you use heavy terrain LOD).
    2.1.2. If I use the terrain rise/smooth/etc tool near a seam, will it modify both terrain chunks?
    Yes! It's slightly tricky to work around boundaries but it's quite easy if you experiment a little with it.
    2.1.3. Will textures tile correctly along terrain chunks?
    In theory yes because in theory a texture's tile should end+start at the boundaries. It all depends on the texture tiling you use, a round number of tile repetitions should work fine.
    Be aware that if you use 1:1 textures you'd need to either use some special UVWMapping, or divide and apply your 1:1 texture to every chunk accordingly.
    2.1.4. What about vegetation/etc painting/placement along the seams?
    [unconfirmed]

    2.2. Texturing
    2.2.1. Is there a limit in the number of textures I can apply to a terrain?
    Yes, up to 12 per material layer.
    You can use some techniques to be able to actually have your terrain use more though:
    - Divide a texture to pack multiple textures into one to create a tileset - [more info]
    - Use grayscale textures packed into the R/G/B/A channels of your texture, then color them by tinting the material or using a 1:1 (non-tiling) diffuse texture map.
    Thanks to login for the info
    Be aware though, that these solutions do not work with terrain painting at all. And since vertex painting doesn't seem to work on terrains, to be able to paint/apply textures using a single material layer you must use a splat texture which you must create outside UDK. If you *really* need to paint your terrain textures inside UDK you'll be forced to use multiple material layers, but they're said to be resource-hungry.
    2.2.2. Is there a limit in the number of material layers I can apply to a terrain?
    yes, it depends on the hardware. I haven't found a number yet.

    A trick for texturing: if you're using a different terrain layer because of MinHeight or MaxHeight, know that if you play around enough with WorldPosition (masking the B channel = height output, multiply by 0.01 or something to get a smoother edge, add some number based on the height you want, then constant clamp [0,1] it all) you can get the same result, of course using only a single terrain layer!

    3. Streaming

    3.1. Is streaming needed for a big world?
    If you want an open world, yes.

    3.2. How should I lay out the outdoor world for streaming?
    If you're making a mostly seamless and open world, divide it by an arbitrary number of sectors (I'll make sectors of 400 x 400 meters. Still need to see if it works), and set them up using distance-based streaming.
    Thanks to Denny for the info
    For simplicity and performance, it's recommended to split the world into different smaller levels instead and do load transitions between them though; or at least create natural barriers and set streaming zones with them (WoW style)

    3.3. What about indoors?
    For performance reasons it's recommended to save indoors separately and either stream them using a streaming volume at the doors (WoW style), or do outdoor-indoor loading transitions (Oblivion style).

    3.4. In which of the maps are my changes saved?
    You can define which level you're working on by double clicking on it in the level browser. ie, if you're working on a specific sector double click the corresponding level in the browser to ensure any objects you place don't get saved in the master world file.
    Thanks to Denny for the info

    3.5. Can stream volumes be altered at run-time?
    Probably not. [unconfirmed]
    Better make proper use of distance-based streaming and volume-based streaming where applicable.


    4. Level Geometry

    4.1. Can level stuff be made in a modelling package or do they need to be BSP brushes?
    You shouldn't use BSP much at all these days. Static Meshes are faster and more optimized to use, so yes you make them in a modelling package.
    Thanks to Denny for the info

    4.2. What about LOD for more performance?
    You can use MLOD (Massive LOD) to have low detailed versions of a forest, city and similar at a distance. When streaming in a level and getting close to the area it will swap the MLOD to the detailed objects. Look for more information on UDN.
    You can also set a fog volume to mask objects disappearing in the distance. This way you can limit viewing distances and achieve more performance.
    Thanks to Denny and iniside for the info

    #2
    anyone? I'm merely asking for advice on such a touchy matter

    oh and I forgot:
    2d. If in the editor I open a Master level LvlA that streams LvlB, if I add new objects inside the LvlB streaming volume, will they be saved in the LvlB level file? or in LvlA since it's what I've opened in the editor?

    Comment


      #3
      1. The grid is the physical area you can actually move in and it's not recommended to add things outside it unless it is a set piece / backdrop like the skydome.
      2. You can use MLOD (Massive LOD) to have low detailed versions of a forest, city and similar at a distance. When streaming in a level and getting close to the area it will swap the MLOD to the detailed objects. Look for more information on UDN.
      2a. x
      2b. As far as I know, by default, all levels are directly under the Persistent Level (Master). It's a structure nightmare but you can stream an indoor area separately from the surroundings without problems as it's just a separate streaming volume.
      2c. Don't think so, maybe it's possible. You might want to look into using distance based streaming instead.
      2d. You define which level you're working on by double clicking on it in the level browser. You save levels individually there as well.
      3. You shouldn't use BSP much at all these days. Static Meshes are faster and more optimized to use, so yes you make them in a modelling package.
      4. I take it you're talking about dynamic lights/shadows. Shadow resolution is not dependent on the distance to the light source but rather the shadow map settings, if the character has a physical asset and other things. You can attach things to the player but it's best to do that through code as Kismet and attachments can be a bit buggy.

      ---------------------------

      I get the impression that you want to make an RPG considering the whole open world business. May I suggest you look at a great game like The Witcher and see that having separate loading areas isn't as bad as it seems. You can pump out a lot higher quality if you skip using an open world system. The Legend of Zelda games uses different areas as well and it works perfectly.

      Good luck.

      Comment


        #4
        I get the impression that you want to make an RPG considering the whole open world business. May I suggest you look at a great game like The Witcher and see that having separate loading areas isn't as bad as it seems. You can pump out a lot higher quality if you skip using an open world system. The Legend of Zelda games uses different areas as well and it works perfectly.
        From good sources I know they did what the did in first part, because they lacked of knowledge, experience, time and technology. Witcher suppose to be more open world (as it will be in The Witcher 2).

        Anyway my favorite example of semi-sandbox like map is NWN2: Storm Of Zehir. It's very cool idea, to make smaller detailed zone maps, and big map from which your character can transit to zones.

        I must ask what do you mean by grid ? the in 3d viewport, grid in 2d viewport or the entire box thing. Everybody speaking of grid there, but noone explained what they really mean ;p.

        Comment


          #5
          Do what Mass Effect does... cheat the loading/streaming in elevators.

          Just avoid long dreary delays like Mass Effect (boring) and keep the elevators to a minimum.

          Comment


            #6
            Originally posted by iniside View Post
            From good sources I know they did what the did in first part, because they lacked of knowledge, experience, time and technology. Witcher suppose to be more open world (as it will be in The Witcher 2).

            The only thing they lacked was the proper tech. CDProjekt has ported different PC RPGs for AAA developers before, that's why they picked Aurora cause of familiarity.


            Also, Witcher functions like NWN, different maps you load up or "transit" to. It's a great method if you don't want to deal with whole streaming thing.

            To be honest, loading different huge worlds is better, less headache. Borderlands did it, worked fine except for the fact that the game had huge lost of areas pop-up to teleport to, which was annoying (thanks to crappy console fonts and GUI).

            So if you put up a teleport list, at least make it readable by an average human (read = PC gamer).


            EDIT: I am also one of those who enjoyed Mass Effect elevator rides. They were a great way to give the gamer a breather while filling in with news bits more realistically than the stupid holographic loudspeakers in ME2.

            Comment


              #7
              thanks for the replies guys, now with your replies and any info I find/investigate myself, I'll be turning this thread into a more structured place to see this kind of info for anyone aiming for a similar world scheme (quite some as I've seen). I'll be placing all of the info in the main post.

              I'm indeed trying to make an RPG (Elium from my sig, turned into UDK). In my old engine we had an "always visible" sector (which loaded the sky/clouds, the full terrain, the sea, rivers and some general vegetation). Aside from that the world was divided into sectors (400x400 meters each) which were loaded and unloaded based on player distance.
              Having my whole terrain already modelled (turned into a heightmap) I'd prefer to aim for an open-world first if it's possible, instead of having to change my already-existing world so it's more segmented to allow loading times, etc. This also kinda rules out the cheating options like elevators, zones divided by mountains and connected by an underground tunnel, etc. Though if an open world doesn't work well I can always add extra mountain ranges with underground cave connections to divide the world.

              inside: by grid I mean the one visible in the top view in the editor, whose size is 524288x524288 units, which according to UDN is the maximum supported size for a map in UDK.

              4. I take it you're talking about dynamic lights/shadows. Shadow resolution is not dependent on the distance to the light source but rather the shadow map settings, if the character has a physical asset and other things.
              well it'd be a waste to have shadows from the sun for objects that are very far away. is there a way to limit the shadowmap area to avoid this?

              Comment


                #8
                If you're going to make an open world please don't model your terrain so you can see from one edge of the world to the other. Try to have mountains, forests, craters, groves and all such things to cover unnecessary view distances. This will allow you to have good performance by hiding areas that the player can't see, you can stream new areas a lot more efficient so you don't have to bother about popping when it finish streaming. Modelling your terrain in a smart way will allow you to have transfer/streaming zones which makes life easier for you. I know a lot of people want to have epic view distances to impress but unless they are experienced with what they do, and understand the engine down to the fundamental core, they shouldn't bother with it unless they want to shoot themselves in the foot.

                Just look at Oblivion, most of the time you had hills, trees and similar covering your view distance. I think the most open areas were lakes and rivers?

                Originally posted by Chosker View Post
                well it'd be a waste to have shadows from the sun for objects that are very far away. is there a way to limit the shadowmap area to avoid this?
                You can tell the mesh LODs not to cast shadows for example.

                Comment


                  #9
                  Originally posted by Chosker View Post
                  2.2. Texturing
                  2.2.1. Is there a limit in the number of textures I can apply to a terrain?
                  Yes, up to 16. [unconfirmed]
                  SM3 limit the number of texture samples down to 16. However the terrain needs at least 4 textures for Directional Light Mapping and for blending between every 4 layers.
                  That allow you to use a maximum of 12 distinct textures.
                  But you can clever pack the textures to have more.

                  For instance in my grass layer I just use 1 texture that have 4 Grayscale textures inside, 1 for each channel RGBA.
                  And then in the material I tint the grayscale into the right color. That allows me to use more textures than just the 12 allowed.

                  There are many ways to pack textures either to have more available options or to hide the tiling, some of them are explaining in the Advance Terrain Texturing topic on the UDN.

                  So, by just packing 4 grayscale textures into 1 sample, you can have access to around 40 textures depending on how many layers you setup.

                  Comment


                    #10
                    Simplest thing to do, to hide objects is using HeightFog with LOD volume.
                    Most MMO games use fog to mask out fading objects. Might look obsolete, but works well .

                    Another thing that comes on my mind, is you shouldn't use to much small models, lwhich means you shouldn't use to much part modeling, like it is Unreal Maps. Small parts add more Drawcalls, which can become problem much sooner that to much triangles drawn at once. You also should prepare textures that can be shared among as many as possible meshes. At this case it's better to use 4 4096x4096 textures than 64 1024x1024 textures. It's better to have only 4 materials per scene than 64.

                    Comment


                      #11
                      If you're going to make an open world please don't model your terrain so you can see from one edge of the world to the other. Try to have mountains, forests, craters, groves and all such things to cover unnecessary view distances.
                      My terrain is already doing this. Overall it's a mountain range in line that runs parallel to the coast, which forms some kind of descendent valley. there's plenty of mountains and valleys coming out of the main mountain range, and independent ones as well. it's an open world but it's clear it's kinda segmented. On top of that I'll have forests and other stuff blocking the view as well.

                      You can tell the mesh LODs not to cast shadows for example.
                      good but, will removing all far-away objects from the shadow's area of range give me more shadowmap resolution for the close-up stuff (meaning the light's view for the shadowmap is viewing a smaller area, therefore each square meter gets more shadowmap pixels), or will that just increase performance (not having to shadow all the far stuff, which is a good thing itself).
                      perhaps some other trick could be done: make the sun's directional light to light everything but disable shadows, then put a much closer light to cast shadows. Oblivion does something like this.


                      login: wouldn't that make your textures look a little bland? you're pretty much losing all color information and then tinting with a solid color - you get a single-color "black to color"-scale texture. or can you tint using more than a single color? perhaps a 1:1 color texture would get the job done.

                      Simplest thing to do, to hide objects is using HeightFog with LOD volume.
                      To me that's common sense in my previous engine we already did this, and I plan to do it in UDK as well.

                      Another thing that comes on my mind, is you shouldn't use to much small models, lwhich means you shouldn't use to much part modeling
                      perhaps this could work with static objects, but interactable or phys-enabled should still be unique objects, though it's probably good practice to have multiple objects share a texture (if you can ensure they'll often be found together, else for example instead of looking at 64 objects that share a single 4096x4096 texture, you could end up looking at 64 objects that use a 4096x4096 texture each, when you could be looking at 64 objects that use a 1024x1024 each.)

                      again thanks for the info guys

                      Comment


                        #12
                        You can still pack unique textures to single 4096 file. And all objects still will share single material.

                        Comment


                          #13
                          Originally posted by iniside View Post
                          You can still pack unique textures to single 4096 file. And all objects still will share single material.
                          Indeed, it's generally referred to as a Texture Atlas. Common to do if you have a texture atlas for kitchen items, another for market items, another for foliage etc.

                          Comment


                            #14
                            Originally posted by Denny View Post
                            Indeed, it's generally referred to as a Texture Atlas. Common to do if you have a texture atlas for kitchen items, another for market items, another for foliage etc.
                            yes, but what if you move a kitchen fork and a market basket into outdoors with the foliage? you end up with 3x 4096^2 textures for only 3 items :/
                            this is why I say such technique would be good with static objects only

                            Comment


                              #15
                              Use BSP brushes to make a layout for your map, where your buildings should be. When you finished, replace the BSP brushes with your staticMeshes. Use the Cube brush and don't forget to replace every brush, or delete btw...

                              Comment

                              Working...
                              X