(Solved) Making a level is now confusing me.

Discussion in 'Content Creation' started by HighDef, May 12, 2018.

  1. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    686
    I used to be able to happily make a level from 'scratch' based off of the GridMap assets. I am trying to do the same today using the Map making tutorial that Nadeox1 has linked in the useful links. I wouldn't recommend that video too much as he skips over stuff.

    The method is definitely a bit different now.

    1. So I get unpack gridmap from the game dir into a 'levels' folder in the docs dir

    2. Delete all the scenarios, bus and quickrace routes

    3. Rename all the files and folder.

    4. Use Notepad++ to search in all files in that folder to change GridMap to the folder name

    5. Load the level and remove all the static objects, terrain and other fx and stuff, leaving the 'sky', 'playerdrop points' folders/groups

    6. Create new terrain

    7. Spawned a container to make sure of textures (probably unnecessary)

    8. Save and then exit to find that the terrain was saved like this:



    Code:
    {
      "binaryFormat" : "version(char), size(unsigned int), heightMap(heightMapSize * heightMapItemSize), layerMap (layerMapSize * layerMapItemSize), materialNames",
      "datafile" : "levels/terrain.ter",
      "heightMapItemSize" : 2,
      "heightMapSize" : 262144,
      "heightmapImage" : "levels/terrain.terrainheightmap.png",
      "layerMapItemSize" : 1,
      "layerMapSize" : 262144,
      "materials" : [ "Grass" ],
      "size" : 512
    }
    I did not call the terrain 'terrain' I called it 'floor'
    It points it at the levels folder not my level folder.

    How do I package this to add it to a mod? Do I just point it at the folder, rename it and move it? (Nope just tried that)

    Thanks for reading.
    --- Post updated ---
    When I load the game with the previously made terrain files from saving removed, the level loads with no terrain and then even though I don't save the game, when I exit, the game makes another terrain save in that same place, a terrain with no data.
     
    #1 HighDef, May 12, 2018
    Last edited: May 12, 2018
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,697
    Manually fix the path so it points to your level folder (you more likely have to move the .ter file also inside your folder, as it usually gets created a level up)
     
  3. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    686
    When I load the game with the previously made terrain files from saving removed. The level loads with no terrain and then even though I don't save it.
    I renamed to 'floor.ter' and 'floor.terrain.json'
    Moved them into the 'hill' folder and changed
    Code:
      "datafile" : "levels/terrain.ter",
    to
    Code:
     "datafile" : "levels/hill/floor.ter",
    This did not work.
    --- Post updated ---
    The only way that it will load with my terrain there is just outside the levels folder.
    --- Post updated ---
    If I keep them just outside my level folder and rename them then it doesn't load the terrain and just generates new files that contain nothing it seems.
     
  4. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,697
    Did you change the correct file?
    Ie. If you have files in Documents/BeamNG.drive/levels/hills, the game will load them first.
    So you'd need to modify them to see any change.
     
  5. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    686
    Ok I have got it now. I went into the 'main' folder and then 'missiongroup' and opened the level.json and pointed the terrain at the level folder and renamed it.

    I am planning on a fresh level creation tutorial so I am trying to get a clear idea of the process now so that I can make it as simple as possible.

    Thanks for your insight.
     
  6. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,421
    Going to just mass-dump a whole lot of info on level making and some things that help.

    Yes all that is needed when you make a terrain up, is to exit beamng,
    browse to the 'levels' folder, move your terrain.ter file (or whatever .ter it's called), and it's matching JSON file into your map dir.
    Edit that terrain json file to have the correct path (it's a plain text file)
    Edit the main\missiongroup\level JSON file and find your .ter entry (search or look at the bottom for it) to show the correct path just like you edited the terrain's JSON file after moving it.

    Map should start correctly now, with a terrain.

    Do not forget to make sure all the folders that have materials.cs in them are showing the correct paths to textures, if they have paths at all (if your materials.cs and the textures are in the same directory, it only needs to be the file itself - directories are not required unless the files are in other folders than the materials.cs file, I am not 100% sure the .dds extension is even required to be typed in regardless). Directory names are being phased out from the game pack-in levels where they're not needed (as just explained), from what I've been seeing over the last 2 years (likely to make modding easier).

    Quick troubleshooting you can add:
    Black terrain (but it's there) and "no_texture" everywhere: Did not update materials.cs to correct directories (if it has folder paths in it) or missing texture files themselves! Don't forget to check inside the terrain or terrains folder, too - errors here cause black terrain.
    Missing terrain: You moved it like above, but the map can't find it (or it's saved to 'levels'). Can also happen from zipped up maps shared in the forums, when they forget to include the terrain saved by default in 'levels' DIR. I've seen a lot of this.
    Infinite loading: Old unsupported map, or buggered up items levels JSON file with improper syntax (possible errant keystroke). Good luck finding that - did you make backups?
    Map does not show up in level select screen: It is not packed correctly or missing the main mission file(s).
    Also, you can't use spaces - like anywhere - NO SPACES, I MEAN IT, OR IT WON'T WORK. SPACES=BAD!
    Not in texture names, not in the level name, not in the folder, not in the materials.cs. A space is the next value, not another part of the name, know how script treats things and the editor will be good to you. Or not.

    Textures work but not when you reload the map or share it: DO NOT use the texture tool inside the editor, make the textures inside materials.cs files by doing it manually in a text editor. Copy & Paste a known-good entry and change as needed. Don't forget to change the MAPTO field also so it does not conflict or override things.


    Quick tips about textures and MATERIALS.CS files (they're overly simplified!) :
    Singleton Material (Concrete)
    Mapto= the name your DAE models will call to the game engine to find this. This must match what is in the DAE.
    diffuse= this is the picture of a simple 2d texture
    normal= this is bump-mapping height field data to make bricks or whatever look 3d
    specular= this is reflectivity, white for OOH SHINY and black for dull and boring, greys for fairly shiny
    specularpower = the intensity of the specular map's reflection
    translucent= 1 for decal road textures, 0 for meshes, this will control how shadows are drawn.
    translucentZwrite= 1 for translucent textures (decal roads or glass/chain link even on meshes etc), 0 for solid mesh textures like sidewalks or buildings.
    Materialtag= these are what you can group textures by like 'roadandpath' or 'collada_is_torture' in-editor texture browser for ease of using the map editor inside BeamNG. You want that to be easy, right.
    Useanisotropic= 1 will allow your texture to be filtered so it doesn't look blocky, but if you had super fine text or were making a DOOM (for MS-DOS) level, you might not want this; otherwise, always have this on by setting it to '1'. Please don't make a Doom level for BeamNG, just don't. It's very hard to drive out of a slime pit.
    Alternatively, using the diffuse texture can be outmoded by colormap & detailmaps, you'll need to reference game files for this in detail.
    colormap= simple color-only texture (doesn't have to be large), to give color to the lines, grass, pavement, etc.
    detailmap= tiled repeatedly to give color map texture like the stones in pavement or the grain in wood, this only shows when you're super close up.

    Now that's not everything, here's some basics:
    The game uses .dds textures, and as of a few versions ago (0.9~0.10) it no longer supports non-dds textures for most common things. DDS is 'direct draw surface' and you can download PAINT.NET for free from Microsoft's website for all recent Windows versions, to work with it. GIMP can also work with it, with a plugin.
    Textures need to be in power of 2, and close-ratio for height and width, like 1:1, 1:2, and possibly 1:4 but DO NOT quote me on 1:4 (I see some evidence of this in West Coast, but I need confirmation on that 1:4 dimension). You'll see the next two options when saving a DDS file in Paint.net (and other programs).
    DDS DXT1 format is okay for opaque (non-translucent) textures, but if they have transparency, they will get black outlines at the edges like Sonic The Hedgehog, and this looks bad in Beamng!
    DDS DXT5 format supports variable translucency and will allow your decal road edges to blend nicely, and Window Glass textures to look like real Windows.

    You don't need NORMAL and SPECULAR maps, but your map will look best when you add them. Try to get these done before you upload your map to the repository. Without these your map will be flat and boring looking. If you don't have them, either leave the texture entry for them blank (leave space between quotes empty), or omit that whole line and add it back later. You can also use a dummy or null file for the time being.

    The best program for editing materials.cs files is Notepad++. You can open lots of stuff and have a source file in 'move to other view' mode for comparison to your editing file. It's like having a book open and seeing both pages, it's a wonderful thing when you're blunder-prone like me.

    Please keep an eye on FPS folks, don't be like The BOB (me), who's maps make an i9 CPU and a 1080Ti GPU cry mercy.

    CTRL+Z is the undo shortcut. You will use this. A LOT. For times when you can't undo, make sure you've made frequent backups, and use these. You *DO* have a back up, DON'T YOU?! So always back up, daily, every few days, at-least once a week. Hard drives crash, and so do human brains. Make sure you can get your files if your drive dies! I have used my backups no less than 1 dozen times & glad I have them.

    My computer could explode or otherwise burn-down, Tennessee could get nuked, and I could pass away; but my projects will live on, because of backups.

    Please put this in your level making blog!
    --The Bob.
     
    • Informative Informative x 3
    • Like Like x 1
  7. HighDef

    HighDef
    Expand Collapse
    Game Design, QA and burnouts.
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    686
    Fantastic tips there Bob. I will be sure to refer to them as I learn about implementing textures. Something that I have been wanting to get fluent at for a while now. Cheers
     
  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