Level help with 3dsmax

Discussion in 'Content Creation' started by Ewanc, Oct 25, 2015.

  1. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    Hi all, this is my first post! So, how do you get materials to load correctly, and get the collision to work, straight from 3ds max, to the editor?

    I'm a veteran at building race tracks in 3Ds Max, but most of my game making experience is for rFactor, so this game engine is proving to be a challenge. Ive seen the Sardian Heights and Bathurst level that someone converted from rFactor, which could have only been imported from Max, so i know its not impossible. They have issues though, like Bathurst is pavement only; the sand and grass doesn't react like soft terrain.

    So far I have a level (race track) 90% ready in 3ds max; a scratch built version of Trial Mountain from Gran Turismo to be exact.
    I have taken a section of the track and given it a single material (for quick testing purposes), exported it to DAE with the collada plugin.
    I then put the DAE and DDS Texture in Documents\BeamNG.drive\mods\levels folder and imported this into a new freestanding version of GridMap for testing.

    It shows up in the right scale and everything, but the texture isnt applied and the car drives right through the mesh, even if I tag it collidable and the textures are named asphalt.

    There's plenty more race track goodness on the way if I can get these teething problems sorted out.

    Thanks In advanced!
     
    #1 Ewanc, Oct 25, 2015
    Last edited: Oct 31, 2015
  2. LJFHutch

    LJFHutch
    Expand Collapse
    Environment Artist
    BeamNG Team

    Joined:
    Aug 4, 2012
    Messages:
    667
    Hi,

    * To work correctly meshes need a specific setup structure, see here http://wiki.beamng.com/Exporting_static_objects (this covers how to get collision working)
    * Currently meshes can't have multiple ground types, they are only able to use asphalt. If you want grass to behave like grass you'll need to use a heightmap.
    * I would recommend using the method described here http://www.beamng.com/threads/tutorial-adding-heightmap-roads-using-blender.16356/#post-263517 to render out a terrain heightmap for the areas you want to be grass or dirt you can offset the asphalt areas by a few meters so the mesh is the part you drive on or just convert the whole thing to a heightmap using that method.
    * For materials and textures your best bet is probably to make them by hand with a text editor (or copy the mats from other levels).

    I hope this helps, let me know if you have trouble :)
     
  3. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    Thanks for shedding some light on these problems.

    I'm working with 100s of materials and objects, so redundant tasks like manual material and hierarchy setup could kill this project. Hopefully by release time, this will all be sorted out. Id like to keep it mesh based, and not go all Torque engine, since all race sims are mesh based and id like to stay cross-compatible.

    I have generated a heightmap and used the mesh road tool to pave a smooth road where track is, but the precision isn't there, and the scaling isn't straight forward. Again, I ended up with a weird surface, which I couldn't drive on.

    Edit: I haven't given up, but think i need to dig deeper into how other 100% mesh levels are composed, and figure out how they solved it.
     
    #3 Ewanc, Oct 27, 2015
    Last edited: Oct 27, 2015
  4. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    I made a little progress on getting the visual mesh in game last night. The materials weren't as hard as I thought they'd be. I just had to load the track's material set in the material editor and save it, then open it in note pad and quick replace the texture paths to where I had them installed. Then I copied the new material.cs to the mesh's folder. I'm still working out some crashing problems in Max, where certain materials and hierarchy cause the program to crash when I export to Dae. I'm also not having luck with collision objects, my first try they worked but the collision mesh was visible, and now it won't line up with the visible mesh, after moving everything up, so I could drive on the areas below 0 height, where the grid map it.
     
  5. CoffeeCrazy

    CoffeeCrazy
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    75
    I ran into this issue when converting objects as well (the collision mesh not being the same as the visual mesh). I also use 3ds max. The axis of the objects must be at 0, 0, 0. I've also found that sometimes after editing the object in 3ds max, even if the axis still remains at 0, 0, 0 when exported it doesn't match up again. To correct this I'll push it out of alignment and align it again.

    I may be wrong, but if you have two meshes, collision and visual, try grouping them together. Put the axis where you want, then center that axis to 0, 0, 0. Then un-group the objects, and the axis should remain in the same spot for both of the objects at the same time. This way they will be perfectly aligned for export.
     
  6. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    Thanks for the tip, it was driving me mad. I'm working with 6 large track pieces with separate collision meshes, so it was... Fun. I also had a problem after getting the alighted mesh groups loaded in the editor. They were off center in there too and had to be moved back to 0 0 0 using the type in box.

    OK, so I finally got it drivable, and looking half decent, so screen shots should be coming soon. Just need to put in a few hundred more laps, it's too fun with the beamng cars.
     
  7. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    Here's a look at the main straight so far, I got some TSOs loaded - the last turn can get a little hairy, hehe. Its easy to clear the foot bridge if you dont brake early enough.
    TMT-last-turn.jpg
    I'm still having one big problem; can edit the road material. Its not saved in the materia.cs, and wont save from the material editor. Id like to do some multi-texturing for that at least. I tried adding it manually, but its not recognizing it.

    My next task after tha material cleanup, and why i migrated to Beamng; adding forests and other cool scenery.
    tmtnsx.jpg

    Haven't figured out how to do shadows yet, it should look better then.
     
  8. WacKEDmaN

    WacKEDmaN
    Expand Collapse

    Joined:
    Aug 15, 2013
    Messages:
    58
    I too ran into all them problems with 3dsmax..its quite a pain to use for me (I'm no modeller but ive been fiddling with 3dsmax for years and cant use blender!)
    i couldn't get the collision working correctly even after setting up the hierarchy to what beamng wants..i tried both the inbuilt DAE export and the Collada exporter with no luck.and i eventually gave up..

    to get my converted tracks working.. i just used 3DSimED, loaded in the track in whatever the games format is eg rF SCN track file(editied into sections,and removing xfiles), then converted various sections as Collada ,next id manually edit beamngs materials.cs and load into beamng, setting only drivable/hit-able parts to "Visible Mesh" in beamng.. (you can actually just dump it as one huge DAE but then you don't have the choice of visible collision mesh on various parts..
    this method doesn't allow me to use any of the forest tools or surface type settings..
    i could never get proper collision mesh working :(

    i eventually gave up converting tracks because it really needs the terrain to be a heightmap so the surface type system can work....which is a PITA to make then scale right in beamng and may need some editing ingame..

    it sounds like you have gone correct route, creating the heightmap .. which is a PITA to make then scale right in beamng (i could use some 3dsmax tips on height map generation and scaling in beamng!)
    To get your road, export the track surface from max as a DAE and overlay it on the terrain in beamng and set it to visible mesh (don't use beamngs roads, and it will show up any scaling problems) ..do the same with walls and TSOs etc..use beamng's skybox, and ocean if needed,forests will work too..visible mesh seems to work ok for road surface and non moving walls as its "asphalt" surface anyways..you just need that terrain to use grass, dirt, mud etc

    it would be nice to be able to control the surface type on the mesh objects some more..
    just needs something texture name based..eg gra?? for grass. dir?? for dirt, mud??. ice??..etc etc.. all with editiable parameters for bounce, stiffness, density etc but i guess that's then getting into the other beamng systems so i can see why it hasn't been done..
     
  9. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    I haven't tried using a height map since my initial attempt. It was just not lining up with my meshes. I figured out the hierarchy thing, you need to have the Base and Detail dummy objects linked above the Start and then link the Visual mesh and colmesh-# below.
    hierarchy.jpg
    I got the material problems solved finally; some material.cs files were floating around in a backup sub directory in my mesh folder. They weren't named right so the game would load them, but couldn't edit or save my fixes. I was able to get normal and specular maps working by copying the settings from other road materials.
     
    #9 Ewanc, Nov 2, 2015
    Last edited: Nov 3, 2015
  10. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    I dove into shadow and material development today. It turns out that I didn't have shadows turned up high enough in graphics settings to see them. I'm making some low poly back sides for the mountains to help framer rates, since there are going to be a lot of long shadows.

    On the material side, I got the road mats looking sweet by taking the default race track material and replacing the textures, keeping most of the settings. Had to unchecked translucency, it was making everything black .

    I'm using a bump and spec map on seperate mapping channels, to use a different tiling pattern, so how do I assign different channels or add material tiling, per texture?
     
    #10 Ewanc, Nov 5, 2015
    Last edited: Nov 5, 2015
  11. CoffeeCrazy

    CoffeeCrazy
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    75
    Woah, I have been trying to get multi-materials to work for a while now. Can you go into more detail? Sorry I don't mean to derail this, but the material issues are the only thing keeping me from making maps. I just want a multi-material from 3ds max to work in BeamNG. I want to have multiple textures attached to a single object, including a spec/bump for each. So far it's either multiple diffuse textures only, or glitches any other way. Absolutely frustrating.
     
  12. Ewanc

    Ewanc
    Expand Collapse

    Joined:
    Oct 25, 2015
    Messages:
    254
    I haven't experienced any problems getting multi-materials to work together, although initially half of them were scrambled: like my guardrail material name was set to the road material, and vise versa, etc. Exporting the the mesh to 3ds format and re-importing to max, and them exporting to DAE seemed to fix any material scrambling and crashing during export due to material problems.

    Here's a look at my road materials if it helps. These are slightly modified materials from Hirochi Raceway. I removed a few unused flags and tweaked Layer 2's spec power and strength, so the road surface was the right shininess. I think "diffuseMap[1]" is supposed to be a detail map, or somthing.

    Code:
    singleton Material(DefaultMaterial7)
    {
       mapTo = "roada";
       diffuseMap[0] = "levels/TrialMountain01/dds/roada.dds";
       diffuseMap[1] = "levels/TrialMountain01/dds/roada.dds";
       normalMap[0] = "levels/TrialMountain01/dds/AsphaltRoad_track_n.dds";
       specularPower[0] = "10";
       specularPower[1] = "10";
       specularStrength[0] = "0.5";
       specularMap[0] = "levels/TrialMountain01/dds/AsphaltRoad_track_s.dds";
       specularMap[1] = "levels/TrialMountain01/dds/AsphaltRoad_track_s.dds";
       useAnisotropic[0] = "1";
       useAnisotropic[1] = "1";
       castShadows = "0";
       cubemap = "cubemap_road_sky_reflection";
       materialTag0 = "Trial_Mountain";
       materialTag1 = "Ewanc";
       specularStrength[0] = "0.5";
       specularStrength[1] = "0.5";
       pixelSpecular[0] = "0";
       pixelSpecular[1] = "0";
    };
    Now, to add multi-texturing to the grass and curbs, and fix the stubborn mapping (tiling/rotating) on the fencing.
     

    Attached Files:

    • TMT shinyroad.jpg
    #12 Ewanc, Nov 5, 2015
    Last edited: Nov 5, 2015
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice