Announcement

Collapse
No announcement yet.

Importing an entire scene from 3ds Max ?

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

    Importing an entire scene from 3ds Max ?

    Hi
    This is my first time creating a level in Unreal Engine 3.
    I made a level in 3ds Max.
    I know how to export and import one model or multiple models in one FBX file.

    but the problem is: I have to add every imported mesh from the Content Browser to the level one by one, and i have to position it correctly.
    So the Question is:
    Is it possible to import the entire level from 3ds max to UE3 without the need to position every mesh manually?
    Click image for larger version

Name:	3dsmaxtest.PNG
Views:	2
Size:	281.6 KB
ID:	1522652

    #2
    I think if you export all the meshes togheter, UDK will import them as one mesh. There are a limit of 64000 vertex per mesh, or something similar, don't remember very well.

    Anyway this is not very good in performance terms, a unique big mesh is bad for occlusion, and you can't reuse the houses, the items, etc.

    And a question I'm constantly asked.... why don't use UE4?
    Provisional blog: http://cobaltudk.blogspot.com.es/
    Videos: https://www.youtube.com/user/cobaltudk
    Facebook: https://www.facebook.com/babylonprojectgame/

    Comment


      #3
      What Cobalt said,but looking at your level I see that it is low poly so there shoud not be any problems.In fact, many companies do make their game levels in a 3d app and then import in to the editor, but separated in chunks due to many reason, one being light map quality.I like to do basic optimizations, but for a low poly level like this, you can place a bone inside and import it as a skeletal mesh and make a low poly invisible level on top of it for collision.It will still look good.But if you need to reuse models, than separate and import as static meshes.

      The best way to get the same positions of each mesh is to separate all of the objects in max and center their pivot point to the center of the grid>and export each part like that from max.First in the center of the grid in max,place a poly cube that will serve as a reference point.Export the cube>place it in udk>and than when you import each mesh,make sure the pivot of the mesh is in the center of the cube and all the meshes will align.

      My sharingan eyes tell me that this is the Resident Evil 4 level from the first village

      Comment


        #4
        Hello dude.

        Finally I think I can be helpfull here on these forums. Yeah, I do this, I create all my maps on a 3D app, then export to UDK.

        On my times of game modding, I used 3dsmax for many years, only recently I changed to Blender, because I am creating a comercial game, and at the moment I can't afford a commercial 3dsmax license, even though I am able to do in Blender and phyton almost everything I used to do in 3dsmax using maxscript.

        I developed a workflow that allows me to have a map exported from 3dsmax into UDK, with everything setup, including materials, normal maps, lights, and even collision models! I have created many maxscripts (downloaded from http://www.scriptspot.com and changed them a bit) to automate tasks like creating collision models for all meshes, separating the meshes in groups (level geometry, level props, dynamic objects, 2nd uvw channel for lightmaps, and so on)

        I will share here my workflow (it may seem complicated, however it works flawlessly and you can have some big maps running fine in UDK), so it can be usefull to others aswell, and you use from it what you need.

        1- First of all create an empty scene in 3dsmax that will serve as a template for any map you want to create. Change the units to these (create a custom units setup which I called uus - unreal units)



        2- Import the UT3_Male character to this scene so you can resize the map (model the environment) based on the scale of the UT3_Male Character, so you don't create a map which is bigger or smaller than the character. Save this scene as something like 3dsmax2UDK_map_template.

        3- Considering you are importing a environment model from another game, I assume you have the right tools to get the game map to 3dsmax with textures applied for this to work flawlessly. So first step is to get the map inside 3dsmax with the textures applied.

        4- Now I use this maxscript: http://www.scriptspot.com/3ds-max/sc...versal-renamer to add a sufix (_Mat) for the submaterials in scene, because many imported game materials and assets come as multi-submaterials in 3dsmax.

        5- I also use a very good 3dsmax plugin for creating render maps (normal and specular maps) for textures (it only works for non organic meshes, i.e, hard surfaces): https://www.vizpark.com/shop/automap/

        After you installed this plugin open material editor, select an empty material slot, change from standard to VP Auto Material, click on batch folder, select methog Global Contrast Optimizer, unmark "generate separate diffuse"

        6- Now select all the objects in your scene. If your imported level geometry is made of one entire piece (like many imported game assets), you need to manually detach this objects (like detach each house, tree, terrain). You can use some maxscript that detaches meshes by textures, in example, that can make the process less tedious. After selecting all your objects, run this script (a custom script I made), that will automatically setup the normal map slot, specular to the correct textures names (once you generated them in VP Auto Material). So you don't need to go material by material and manually add the specular slot, normal map, select the file manually. With only one click you get eveything setup!

        This is my script UDKRenderMaps: https://drive.google.com/file/d/1HcC...ew?usp=sharing

        7- Select the level geometry object (I consider level geometry the architecture of the map, like walls, pillars) and run this other script - UDK-LevelGeometrySlicer - to break it into smaller chunks:
        https://drive.google.com/file/d/1Qh6...ew?usp=sharing

        * Manually copy (backup) original level geometry object, because the original model gets the polygons id order changed after sliced
        * Try the best ammount of slices untill find the perfect ammount

        8- Delete the first slice (number 0), select all other slices and run this other script here UDK-LevelGeometryRenamer, to rename the level geometry chunks in sequence (level_geometry_001, level_geometry_002, and so on):
        https://drive.google.com/file/d/1zOM...ew?usp=sharing

        9- Now select all level geometry objects and run this other script UDK-UVWLightmapping to automatically add a secondary uvw channel for lightmap (it's essential for UDK):
        https://drive.google.com/file/d/1i9p...ew?usp=sharing

        10- There are some level geometry slices that don`t need collision at all, so separate them into a selection set level_geometry_nocoll and run this other script here UDK-LevelGeometryNullRenamer :
        https://drive.google.com/file/d/15_O...ew?usp=sharing

        11- Select all level slices and run this another script here to export each chunk as a separate fbx model: http://www.scriptspot.com/3ds-max/sc...h-exportimport
        Save the fbx files to a folder, like "export".

        12- Now comes another bit complicated part, however once you set it up correctly, it works flawlessly. This step will allow you to have all the meshes automatically placed inside UDK in the same position they are inside 3dsmax (no manually positioning):

        http://www.lagspike.com/converting-a...p-file-to-udk/

        Go directly to step 7. You need to download this toolbox: http://www.lagspike.com/downloads/toolbox.zip

        For setting it up you need to install any php server on your pc because this guy created a command prompt script that uses php to automatically generate a code which follows the copy paste text from UDK viewport to create a map.

        13- After setting up the above toolbox, run convert_vmf_brush_to_t3d_FBX.bat (package name.Geometry)

        14- Import your exported FBX meshes (50 files by time) to udk, create a new package (mapname_geometry.upk) and group called Geometry
        * right click on meshes and select static mesh editor to edit multiple meshes (each 50 by time)
        * just uncheck simple collision detection (last 3 items) for each slice, because we are going to use poly collision for level geometry
        * enable collision and shadow casting on all mesh elements

        15- Copy contents from export\t3d_output\t3d_output.txt to UDK viewport:

        by using Notepad++ replace
        LightingChannels=(bInitialized=True,Static=True)
        by
        bOverrideLightMapRes=True\rOverriddenLightMapRes=512\rLightingChannels=(bInitialized=True,Static=True)

        16- for GeometryNull objects:
        replace
        CollisionComponent=StaticMeshComponent'StaticMeshComponent_6'
        by
        CollisionType=COLLIDE_NoCollision\rBlockRigidBody=False\rbCollideActors=False\rCollisionComponent=StaticMeshComponent'StaticMeshComponent_6'

        WOW, now we finished the Level Geometry.

        On the next post I'll go for the level props (like barrel, chairs, Trees, cars, and so on...)
        Last edited by udkultimate; 09-01-2018, 08:50 PM.

        Comment


          #5
          17- For the sake of keeping things organized, you can save a copy of your scene with a sufix like _level_props to work now on the props, that will use collision models. On your map, a prop will be the fences, the wooden car, the stones on the floor, statue, and so on.

          18- For props, I divide them into 3 types using selection sets:
          * propsnull, the props which don't need collision at all like grass, some far away objects
          * propspolycoll, the props which the player will pass through (like an arch), so we need to make them poly collision
          * propsmodcoll, the other props which will have collision models (_UCX)

          19- Select the propsnull objects and run this another script UDK-LevelPropsNullRenamer:
          https://drive.google.com/file/d/1DRe...ew?usp=sharing

          20- Select all propsnull_models and run UDK-UVWLightmapping, then run the Batch Export/Import Script

          21- Copy the exported FBX files to some folder and run convert_vmf_brush_to_t3d_FBX.bat (package name.Props)

          22- Import FBX meshes (100 files) to udk mapname_props01.upk (Props group)
          * let each upk packages size don`t pass 150mb

          23- copy contents from export\t3d_output\t3d_output.txt to UDK viewport
          replace
          LightingChannels=(bInitialized=True,Static=True)
          by
          bOverrideLightMapRes=True\rOverriddenLightMapRes=0\rLightingChannels=(bInitialized=True,Static=True)

          24- replace
          CollisionComponent=StaticMeshComponent'StaticMeshComponent_6'
          by
          CollisionType=COLLIDE_NoCollision\rBlockRigidBody=False\rbCollideActors=False\rCollisionComponent=StaticMeshComponent'StaticMeshComponent_6'

          25-
          Now on the next post let's go for the PropsPolyColl
          Last edited by udkultimate; 09-01-2018, 09:15 PM.

          Comment


            #6
            26- Select the propspolycoll objects and run this another script UDK-LevelPropsPolyColRenamer:
            https://drive.google.com/file/d/18Ql...vloEd3e5o/view

            27- Select all propspolycoll models and run UDK-UVWLightmapping, then run the Batch Export/Import Script

            28- Copy the exported FBX files to some folder and run convert_vmf_brush_to_t3d_FBX.bat (package name.Props)

            29- Import FBX meshes (100 files) to udk mapname_props01.upk (Props group)
            * let each upk packages size don`t pass 150mb

            30- copy contents from export\t3d_output\t3d_output.txt to UDK viewport
            replace
            LightingChannels=(bInitialized=True,Static=True)
            by
            bOverrideLightMapRes=True\rOverriddenLightMapRes=0\rLightingChannels=(bInitialized=True,Static=True)
            Last edited by udkultimate; 09-01-2018, 09:14 PM.

            Comment


              #7
              31- Now last step, let's go for the Props Mod Coll, which are the props we want to create some collision models.

              32- Select the propsmodcoll objects and run this another script UDK-LevelPropsModColRenamer:
              https://drive.google.com/file/d/1qYW...ew?usp=sharing

              33- Select all propsmodcoll models and run UDK-UVWLightmapping,

              34- Now here is another aditional step, we need to run this custom maxscript UDK-UDKCollisionGenerator which will automatically create collision models:
              https://drive.google.com/file/d/1nQ3...s_GWuIPuB/view

              35- However, it will not generate perfect collision models, so because that, you may need to:
              * manually adjust some collision models size and position
              * select both props and collision model and Center Pivot
              * unhide level geometry to see better how collision will occur
              * walk on the scene using FPS Camera to identify possible problematic collision models and fix them
              * delete some unneeded collision models
              * select object, Center Pivot object, select collision model, Center Pivot collision model, align collision to object (alt+A)
              * run Interactive Renamer to remove sufix _001 from collision models (UCX_)

              36- Select all props_mod_col models (mesh and collision models) and run the Batch Export/Import Script

              37- Copy the exported FBX files to some folder and run convert_vmf_brush_to_t3d_FBX.bat (package name.Props)

              38- Import FBX meshes (100 files) to udk mapname_props01.upk (Props group)
              * let each upk packages size don`t pass 150mb

              39- Copy contents from export\t3d_output\t3d_output.txt to UDK viewport
              replace
              LightingChannels=(bInitialized=True,Static=True)
              by
              bOverrideLightMapRes=True\rOverriddenLightMapRes=0\rLightingChannels=(bInitialized=True,Static=True)

              40- Final Step (finally ):

              * fine tune the materials in content browser to create materials effect like reflections, transparency, specular power, plants specular,...
              * add cubemap reflection scenecapture cubemap render to target emissive
              * create reflective glass materials (car windows)
              * adjust specularity on some materials, make metallic, plastic

              Comment


                #8
                I bet someone is going to sleep well tonight

                Comment


                  #9
                  Originally posted by O_and_N View Post
                  I bet someone is going to sleep well tonight
                  Hello dude! I like to contribute with the comunity, however my knowledge in UDK is not that big, so there is not too much thing I can do/teach people here, however, because I have seen that this guy is using 3dsmax for importing a game level and wants to export to UDK, I thought "now is my chance to do something useful for the folks here "

                  By the way, about the lighmap resolution, for the sake of performance, I set an initial value of 512 for all the level geometry objects, however as the slicer script may not slice into chanks of same size, so sometimes you may notice an inconsistence on lightmap resolution across 2 chunks (one may be higher the lightmap res). So because this you need to increase/decrease some lightmap resolutions of some level geometry chunks.

                  As for props, I don't think they need to cast shadows, only if there is an extreme need.

                  Comment


                    #10
                    Originally posted by CobaltUDK View Post
                    ...
                    Hi CobaltUDK,
                    I can't use UE4 because I'm making a custom map for a game made with UE3.
                    As you said, one big mesh will work but it is not a good adea for the reasons you mentioned.

                    Originally posted by O_and_N View Post
                    ...
                    Hi O_and_N,
                    Thank you very much. I will try this method.
                    Yes you are right, This is a Resident Evil 4 map

                    Originally posted by udkultimate View Post
                    ...
                    udkultimate,
                    WOW this is amazing!
                    Thank you for your time, I really appreciate it.
                    I don't usually see people write such a detailed answer. can't thank you enough.
                    I will begin to read each step slowly with a cup of coffe.
                    Thank u again

                    Thanks everybody <3

                    Comment

                    Working...
                    X