1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.32 Bug Reporting thread
    Solutions and more information may already be available.

Sharing my [No Material] Solution.

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by TarTi, Mar 2, 2019.

  1. TarTi

    TarTi
    Expand Collapse

    Joined:
    Feb 27, 2019
    Messages:
    122
    Hello modders friends,

    I allow myself to create this topic in an attempt to solve the problem I have been dragging for a long time in the BeamNG engine before I can solve it, and I have come across many people to encounter the same problem without ever finding a real solution. The problem came back again and again, and I wasnt the only one so close to definitively give up ; but I had a last idea that solved all my worries about "no material" textures, so I'd like to share that with those who have the same problem.

    Sorry for my english and sorry if there is the good tip is already pinned somewhere, I never found it, like many others apparently ^w^'

    Also, sorry if the tone sounds childish, I just want everyone to understand, including those like me who do not speak English fluently or some people just wanting to have fun editing some maps without having to learn everything about Materials and Normal maps in game dev asssets ; Have a good reading :3

    My example will be based on my map/level "bzh_archipel", built from "template" with the whole Art folder of "Italy". This will be easier to add images and bits of real code without getting lost. Just replace ''bzh_archipel'' by 'your map name'' and ''From_Italy'' by ''The name of the map where you will pick your content''

    To begin, you can leave -at least- your map in BeamNG (ideally, close the game). Any changes made to the Materials and saved in-game will make changes to your Material.cs files -where you will spend a long time- and could completely distort your repair attempts.

    The path of my map folder is: levels / bzh_archipel /
    The path of textures that all come from "Italy": levels / bzh_archipel / art / From_Italy /
    Follow the different folders where the different categories of assets (the objects), and the one that interests us the most, even if we will check everything (yes, there is a bit of work) is the folder "Buildings" (levels / bzh_archipel / art / From_Italy / shapes / buildings /).

    In all the map creation videos I've watched, in all the topics I've read about this issue of ''No Material'' that came up all the time, I was told to change the path of ALL the assets pointing to the original map in all material.cs files in the Art folder.

    But it is actually extremely easy to miss out on many of them because they have no path specified in the Material.cs code! So I do not know if it is a bug when copying files (the original map works very well) or an update occurred after all the tutorials that I saw, anyway, here the piece of code that can be seen on a texture (a material, actually) that will not work:

    singleton Material(italy_concrete_sidewalk_decalroad)
    {
    mapTo = "italy_concrete_sidewalk_decalroad";
    diffuseColor[0] = "1 1 0.987999976 1";

    colorMap[0] = "levels/bzh_archipel/art/From_Italy/shapes/buildings/italy_concrete_sidewalk_d.dds";
    normalMap[0] = "levels/bzh_archipel/art/From_Italy/shapes/buildings/italy_concrete_sidewalk_n.dds";
    specularMap[0] = "levels/bzh_archipel/art/From_Italy/shapes/buildings/italy_concrete_sidewalk_s.dds";

    specular[0] = "0.545098007 0.545098007 0.545098007 1";
    specular[1] = "0.521569014 0.521569014 0.521569014 0.00800000038";
    useAnisotropic[0] = "1";
    useAnisotropic[1] = "1";
    translucent = "0";
    translucentBlendOp = "None";
    translucentZWrite = "1";
    materialTag1 = "beamng";
    materialTag0 = "RoadAndPath";
    };

    singleton Material(italy_concrete_sidewalk)
    {
    mapTo = "italy_concrete_sidewalk";
    colorMap[0] = "italy_concrete_sidewalk_d.dds";

    normalMap[0] = "italy_concrete_sidewalk_n.dds";
    detailScale[0] = "6 6";
    specularMap[0] = "italy_concrete_sidewalk_s.dds";
    useAnisotropic[0] = "1";
    translucentBlendOp = "None";
    materialTag4 = "RoadAndPath";
    materialTag1 = "italy";
    materialTag3 = "Industrial";
    annotation = "BUILDINGS";
    materialTag2 = "east_coast_usa";
    specularStrength0 = "0.490196";
    materialTag0 = "beamng";
    materialTag5 = "building";
    specularColor0 = "0.1 0.1 0.1 0.1";
    };


    While the first Material (sidewalk_decalroad, in green) will have no problem, we can see that it misses the complete path to the textures of the second Material (sidewalk, in red), and that the game will display "No Material", having not been able to create it correctly.

    This problem is almost invisible, since it concerns only a handful of Materials lost in thousands of lines of code, and the Notepad option [replace "Italy / art /" by "bzh_archipel / art / From_Italy /] concern only Materials already having a way! (besides the level Italy also contains files from a hidden level "Italy_old" or something like that ...)

    This problem seems to occur mainly in the buildings folder, but there are plenty of other assets that display very well without having this specific path, and others that are supposed to point to a .dds file located in a another folder of the parent Art folder, or even who will draw their Material from another level.
    In the case of another targeted level, since these are the official levels that nobody removes (don't do that x3), I do not touch anything.

    If it's another folder, I'm careful that my path matches.

    We do not want to end up with a "levels / bzh_archipel / art / From_Italy / shapes / buildings" path if the target file is in the Terrain folder. This problem is not supposed to happen, but if like me you have changed many (too) lines in your frustration, you will have to check from the missing textures of the editor (F1 to select the object, F4 to access its materials, the missing texture should be displayed when you have selected the Material of your object you want to see in detail. If they all look correct, you can display the object in the Shapes editor to find the Material "Unmapped" in the "Mat" list of the object).

    ANYWAY you will check to see if a building does not draw its "concrete" texture from a folder other than "buildings", and give it the right path.

    Once you have checked all this and you have all the Material.cs open in Notepad ++, you can launch a large research for "Unmapped".

    Apparently, the roads do not have to be 'mapped'. But there was in my Buildings folder a bunch of errors, like a lot of Materials with no targets (but good textures)
    Here is an example :

    singleton Material(tro_tree_1_trunk)
    {
    mapTo = "unmapped";
    diffuseColor[0] = "0.949020028 0.87450999 0.788235009 1";
    colorMap[0] = "levels/bzh_archipel/art/shapes/trees/trees_tropical_1/trunk_d.dds";

    detailMap[0] = "levels/bzh_archipel/art/shapes/trees/trees_tropical_1/trunk_variation_1.dds";
    detailScale[0] = "0.100000001 0.100000001";
    specularPower[0] = "1";
    materialTag1 = "vegetation";
    materialTag0 = "beamng";
    specularStrength0 = "0.392157";
    materialTag2 = "Natural";
    };


    We see here that the Material has its textures and good paths to them (in green), but no target (''unmapped'', in red). So we will change 'unmapped' by the name of the material given just above (in blue), which corresponds to the part of the object that will use it, which facilitates the search between BeamNG and Notepad or your files.

    Here, 'unmapped' will become 'tro-tree_1_trunk'.

    If you have not already done so, you must leave your editor, and WITHOUT SAVING if you touched the Materials in-game (so sorry if you've done some work since but I had warned). Leave the level, ideally the game, save all changes made via Notepad ++ and restart your level.

    Some materials (maybe all) are still not displayed, that's normal.

    Then you have to select in-game the 'No Material' displaying object you want to fix and find the wrong going Material via the selection panel of Materials (when you get there you normally start to well know the names of all the missing materials in the game, but you can help yourself by writing them somewhere if you have trouble finding your way there!).

    You can then easily replace the missing Material with its equivalent, since the part of the object using the Material also has its name (like the Material (tro_tree_trunk) mapTo = '' tro_tree_trunk '') (often, the editor will have made a ''clone'' bearing the name of the Material with (0), (1), (2) behind, number minus one of your previous attempts to repair the Material (I am proud of you <3).

    Attention, there are some exceptions! As a first step, try to respect all the Materials requested by the object. Repair (normally one last time) all the missing textures by their 'good version' (exact same name than the object part so), then save (in-game so this time) and leave your level. Ideally, leave the entire game as many times as possible.

    Return to Notepad ++ and click on 'Yes' if you are asked to make changes since you were in the editor.
    Check the pages that have been modified, the changes will be at the bottom of the page. You are looking for incomplete paths and mapTo = ''unmapped'' lines. You know what to do with them.

    Bonus tip just in case, and just to eat eat another 5 minutes of your precious time:

    Check if you have duplicates. It happened to me to see twice exactly the same lines for the same Material. Make sure that this is the same Material (Concrete_1 or concrete_01, for example, are two different Materials ans don't have to be fixed) and if so, delete one of the two paragraphs.

    You may eventually have to rewrite all or part of a paragraph about a Material. Do not panic, just copy and paste from other materials and the name of their .dds files (be careful to respect the Normal, Specular and Diffuse Maps indicated respectively by '_n', '_s' or '_d' at the end of the file name, just before the .dds extension) and you'll already have a Material that you can adjust in-game and finally place on the remaining missing texture.

    Save everywhere, save again, accept the modifications, re-save on Notepad, quit your map, quit Notepad, quit BeamNG, restart even your PC if your heart tells you so, make yourself a coffee, sit down, cross your fingers and return to your map. Normally we are good.

    I think I have covered all the concerns of the way-too-famous-No-Materials-Issue that I have met, I hope I could help anyone, I hope that those for who all of this don't or won't work will find their solution, and obviously do not hesitate to share your tips or your issues so we will solve them together.

    I leave you with two / three screens and montages that I made to perhaps better visualize the schmilblick:

    Have fun in BeamNG and in your life, love, TarTi.

    BeamIssue01.png BeamIssue02.png
    BeamIssue1.png
    BeamIssue11.png
     
    #1 TarTi, Mar 2, 2019
    Last edited: Mar 2, 2019
  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