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.30 Bug Reporting thread
    Solutions and more information may already be available.

Textures not loading from saved maps

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by theonciest, May 8, 2016.

  1. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Man I'm sorry but this isn't very helpful. You haven't even responded to my other post about the map not even loading. Also, if it had loaded, I can't even select any tree at all. Also the file is missing, like you guys should keep your program organized. If it's a developer tool, give us access to all the assets. If it isn't, then remove full access from the code so we don't run into bugs, as I have here.

    Also, like I said, it won't let me click anywhere, with any tree or bush, it simply doesn't do anything. That's if my map could load. I seriously did nothing to screw with it, I simply got blind-sided by your update when restarting the game for textures (yo, everytime I go to apply a texture, it still doesn't save fully, so I have to restart MULTIPLE TIMES to see if my changes stick. It's by pure fluke if it stays.) You guys really need a better system, it's so convoluted and heavy full of stuff that isn't even streamlined. Would be nice to have more control over your textures, and completely eliminate the need to code lots of stuff to import a texture.
    --- Post updated ---
    I would record my screen to show you the problem with the trees, but like I said, beamng doesn't want to load my map anymore because of the update.
     
  2. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Take your time, I've found a workaround.
     
  3. LJFHutch

    LJFHutch
    Expand Collapse
    Environment Artist
    BeamNG Team

    Joined:
    Aug 4, 2012
    Messages:
    667
    About map loading, check the console with "`" to see if it gives any errors, that could help isolate the problem. If that doesn't work you could try making a new simple map and putting elements from the old one back in bit by bit until you find the problem (so start with a blank map with nothing, if that works, add the meshes and textures, then add the terrain without textures, then add the terrain textures and materials etc).

    When you say it won't let you click anywhere do you have multiple heightmaps? Are you within the heightmap (the editor will not let you use the vegetation tool unless you're "within" the heightmap dimensions).

    Are you trying to make a new material with the material editor? You need to find where the game is storing the material and confirm that that is the right one (you might have duplicates).

    If it's textures that aren't updating remember that Gimp exports will not directly show up ingame until a restart. If you want them to show up then export to the folder above and then in windows explorer manually drop the file in and replace. It should show up immediately unless it's a terrain texture in which case you must also go into the terrain layers menu and click apply.

    Hope this helps.
     
  4. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Thank you so much man. This is what I see when I go into the console. http://i.imgur.com/uBZtNCq.png

    As for the trees, if you see in the video it started working because I opened the map within the editor itself. If I had launched it normally I would still have that issue. Besides, there's only one bush in there, where before there was a whole bunch of them I can choose from.

    Also I only have one heightmap. And for textures, I don't use GIMP. As for materials, I am pretty sure we fixed it, I am just missing a few steps and keep getting confused because of all the coding I am unfamiliar with. I really wish I was good at that sort of stuff. :( So very much...

    NDX, the only reason I made another thread was because it was a separate issue than the textures. The sense of urgency and irrelevance to textures, I figured it would have been acceptable. My apologies.
     
  5. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    This problem is not finished guys, can you please stay on top of it and not leave me waiting for weeks on end? Like you complain and wonder about me bumping/contacting you guys outside of this thread? This matter isn't over, some of us less inclined with your system need your assistance. I've posted my console information, config files, and you guys haven't even looked at it. At least reply to me about what is causing the issue...

    Still trying to add in textures and this one in particular isn't saving. I just absolutely do not get it. I have copied the same text and added the file in by itself


    singleton Material(curbrocks1)
    {
    mapTo = "unmapped_mat";
    diffuseMap[0] = "curbrocks1.png";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "curbrocks1_NRM.png";
    specularPower[0] = "1";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "1";
    translucentZWrite = "1";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    };

    What is wrong with this?

    From what I understand "Unmapped_mat" stores files in this section in the Material selector -

    http://i.imgur.com/EsJLuUi.png?2

    Why is it not there? Nothing shows up. As for singleton material (curbrocks1) that's what I name the new material file?
     
  6. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Guys seriously, I'm going to start using your contact us method...
     
  7. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,681
    Hey, we haven't forgot you.
    Your thread gets buried by others quickly.
    Also, we are working/helping other people aswell, so sorry us if you think we are deliberately 'forgetting' about you, but we aren't.

    I have no idea what's not working out, the is syntax correct.
    I just copy pasted that code into a 'materials.cs' file in ECA folder and it was showing fine for me (minus the actual texture)


    Did you the name the actual file 'singleton material (curbrocks1)' ?
    All files containing materials must be named 'materials.cs'. No other names.

    Also, constantly check the game console, it will show any error if something is not working correctly!



    Note that we are helping you with a 'mod'.
    This is not part of the duty of most companies.
    We are helping you because we want, but please try to not treat us like that.
    I've did everything I could to help you, even an 'almost' 1 hour Teamviewer session showing how things were working.
    What other company would have done the same? Most of them would just let users figure thing themselves
    Even @DoullPepper , a very talented map-maker is helping you via Skype.




    Your textures are looking very nice, so you indeed have talent, but..

    ..as I/we told you, you have waaay too many materials/textures around your level.
    Things looks very messy, and that's what is probably giving you a headache.

    Start with something simplier, or you will not understand how the basics work.
    You can't run without knowing how to walk (or something, I'm not good with those)

    The game comes with a 'Template Map' now. Use it for your experiments, mess with it, break it and whatever.
    Do your experiments there, and only after you master the materials system, think about doing a proper mod.
     
    #48 Nadeox1, Jun 25, 2016
    Last edited: Jun 25, 2016
    • Like Like x 1
  8. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Well when you put it that way about companies helping out with mods, you are ABSOLUTELY right. A lot of companies don't do that, and if they do it's the same situation as you, people who just want to help build the modding community. You are so right, so I guess I am just starting to see it as an engine rather than a game, cause i see so much potential!

    And yes, I am naming it the exact same as the file. Question: do you need to restart Beamng in order for it to show up in the browser?

    Also I know I have a ton of textures, but I was working all in one session with those, like I would work and put one texture in, update the code, then move onto the next. I thought it was working, so obviously now I have to start completely over and add those again one at a time. Can I just wipe the materials.cs backup the folder, then re-add them one at a time? Would you suggest that? But I mean... I want to find the direct issue so I can fix it if it happens again. Because now I am curious, if the code is correct for you, why is not working for me?
     
  9. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,681
    As I said before, files that contains materials must be named ONLY 'materials.cs'. No other name will work.
    If you named the file containing the lines of the material another way, it will not get loaded!

    Yes, if you add a new material, the game will not hotload it unless you restart the game (sometimes reloading the map will suffice)

    Yes, but if you still end up with tons of textures files, make sure you don't get confused by them.
    I'd say that having the bare minimum in there, would help you dealing with that stuff, until you are more used to it.
     
    • Like Like x 1
  10. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    I am not confused by them. They are literally organized by date modified. If I need it it will be there because it is the last one I worked on. I don't move on until it works. If I did I know the section where that file is because I spent so much time going back to it. I am only confused by the script. Why don't you guys make like a texture import tool? This is way too complicated for me I can't get it :/
     
  11. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,681
    You can import textures from the material editor, but it's not properly working at the moment.
    In the way that it will not manage to make correct paths to get to the textures, that's why making them manually is much more safe.

    Not sure why you are not getting it, other people sure had some initial difficulties, but managed to understand how the thing work eventually.


    Make sure to check the console, it will always tell why a texture/material/whatever isn't doing the right thing.
     
    • Like Like x 1
  12. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89


    Warning: I get upset and curse a few times in my videos I apologize to those that are uncomfortable hearing that sort of thing, I say some pretty bad things towards the editor, I definitely mean it towards the editor itself, it's a straight up monster that haunts me and my dreams. Definitely not meaning it as any criticism towards the coders who worked on it.

    So it works on other maps, then why is it not working on mine? :/
    --- Post updated ---
    Okay I recompiled the textures into a new materials.cs, load them in one by one, the map decided only to take a few of those, I fixed that however the problem was those few had changed the back slashes to forward slashes, or what ever so I went and replaced them all to the one that was working "/" and it fixed the files. Had a few that were misspelled "road1SHORTCcleanLEFTCAP" Notice the extra C, I made the mistake of naming it "road1SHORTcleanLEFTCAP" Corrected that. But dude, those errors were errors I could fix. This one I SIMPLY CANNOT EXPLAIN. The fact I have to completely start over is unacceptable. Because I am not even completely confident it won't happen again. I simply DO NOT trust this program. I can upload the video so you guys can watch my process of fixing eveyrthing I was happy and giddy and you can notice my frustration building by the end of the video. I COMPLETELY FIXED EVERYTHING. Even tried a few experiments. I was SO stoked when I found shit, but so completely disappointed they had no relation to my issue. I simply cannot understand what I need to do to correctly get textures in. Like I try the exact same fixes I discovered to get the last one fixed, but every time I add a new one it's like a whole different issue. When I add a material, the program likes to add "_mat" everytime I restart it. I think that may be the thing breaking it. You'll see in the videos I am about to add.

    Can you please point out what I am doing wrong?



    --- Post updated ---


    Here is a video (uploading, will be up in a minute) of me successfully getting the texture to work, but I cannot for the life of me figure out what I did right for this one.

    --- Post updated ---


    This is the video that shows you all the errors I described earlier, which I went through and recompiled a new Materials.cs, also very quite lengthy I apologize.
    --- Post updated ---
    Also having ussues with normal and specular lighting being imported correctly...

     
    #53 theonciest, Jun 28, 2016
    Last edited: Jun 28, 2016
  13. Ouerbacker

    Ouerbacker
    Expand Collapse

    Joined:
    Aug 2, 2013
    Messages:
    463
    Before writing this post, I only quickly glanced through this thread, so I might have missed something...

    It looks like you have figured out how to map materials, so, theoretically, there shouldn't be any problems. One thing that I've noticed is that you're building everything out of the Steam directory. This really isn't a problems. However, the game might be generating material.cs files in Documents/beamng/levels/yourlevelname/and_so_on that go against the material.cs files that are located in your steam directory. This would makes sense with your problem as your first material seems to go in without a hitch, but the rest are kind of like Russian roulette.

    Could you see if the game has generated material.cs in your documents directory that go against the matching material.cs in your steam directory?
     
    • Like Like x 1
  14. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    Hey man! Yes, Beamng has generated a materials file inside documents. I see there are different parameters on a few textures. Such as

    Documents version -

    singleton Material(roadtrailCAPSTART2)
    {
    mapTo = "unmapped_mat";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2_NRM.png";
    specularPower[0] = "41";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "0";
    translucentZWrite = "1";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    colorMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2.png";
    specularStrength0 = "0.294118";
    specularMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2_SPEC.png";
    alphaTest = "1";
    alphaRef = "107";
    translucentBlendOp = "AddAlpha";
    };


    Steam Version -

    singleton Material(roadtrailCAPSTART2)
    {
    mapTo = "unmapped_mat";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2_NRM.png";
    specularPower[0] = "41";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "0";
    translucentZWrite = "0";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    colorMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2.png";
    specularStrength0 = "0.294118";
    specularMap[0] = "content/levels/Shibukawa/art/road/roadtrailCAPSTART2_SPEC.png";
    alphaTest = "1";
    alphaRef = "140";
    };



    Now, it isn't that way for all of them, but you can see "
    alphaTest = "1";
    alphaRef = "107";
    translucentBlendOp = "AddAlpha";


    Are completely different. So maybe it is that way for when I save maps? Is there any way I can stop BeamNG from making these conflictions? I cannot save my map in Documents because then textures wouldn't work for me at all. I had to move them into the content folder in order to fix my issue from a year ago. :/
     
  15. Ouerbacker

    Ouerbacker
    Expand Collapse

    Joined:
    Aug 2, 2013
    Messages:
    463
    The game updates a material.cs file whenever the save button in the material editor is used.

    Unfortunately not... At some point, the devs will probably get the game to properly generate material locations from the documents directory.

    There is the initial problem of saving textures from the documents locations, but, aside from this initial hiccup, the process is very simple.

    For the time being, I think that it would be best for you to move move your map to the documents/BeamNG.drive/levels directory. Many people would probably recommend building your map out of the documents/BeamNG.drive//mods directory, but I believe that having all of your files in one place is more manageable for you. If a player builds their map from the aforementioned "mods" directory, all adjusted files will be place in the "levels" directory. Many choose this method because it leaves their initial files untouched. We don't really care about this for now; we just want functioning material.cs files. Also, if you happen to hit the clear cache button on startup, your files will be placed in documents/BeamNG.drive/backups. At some point, you will probably accidentally hit this button.

    I suspect that you know how to create a level, so I'm just going to skip to the material.cs files.

    Your current method of setting up material.cs involves assigning the textures in-game. I highly recommend not using this method. Using the in-game material editor is good for getting the right alpha or animation but, it is terribly clunky when it comes to assigning textures.

    -Since you have been mostly working with road textures, I'm going to run through the process of creating material.cs entries for road textures.

    -Create a material.cs in the file that your textures are in. Ideally, just grab a material.cs from another map and stick the material.cs in the file with your road textures.

    -Open the grabbed material.cs and erase its contents - You might want to keep some of the the existing material.cs entries for reference

    - Create a material.cs entry. I'm using the entry mentioned in your post for this example.

    Code:
    singleton Material(roadtrailCAPSTART2)
    {
    mapTo = "roadtrailCAPSTART2";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "levels/Shibukawa/art/road/roadtrailCAPSTART2_NRM";
    specularPower[0] = "41";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "0";
    translucentZWrite = "0";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    colorMap[0] = "levels/Shibukawa/art/road/roadtrailCAPSTART2";
    specularStrength0 = "0.294118";
    specularMap[0] = "levels/Shibukawa/art/road/roadtrailCAPSTART2_SPEC";
    alphaTest = "1";
    alphaRef = "140";
    };
    I have made a few changes from your initial entry. Your original entry included a "content/" in front of the material entries. This will lead to a loading error.

    -Secondly, your original entry had mapTo = "unmapped_mat"; For simplicity, change the unmapped_mat part to whatever the texture's name is. In this case, I changed it to roadtrailCAPSTART2. Sometimes, in the case of objects, beamng will not register a perfectly good texture and generate and umapped_mat texture in its place. If this happens, try restarting the game.

    -Lastly, your entries included a .png at the end of texture name. It is okay for this to remain, but it is unnecessary. At some point, I'd recommend switching over to dds,

    Theoretically, whenever an additional texture is needed, copy the initial entry, paste this copy below the initial entry, and adjust the file paths to fit this new entry. If this method is used, the material.cs entries that follow your initial entry will look something like the ones below this text.

    Code:
    singleton Material(roadtrail_mudpath_1)
    {
    mapTo = "roadtrail_mudpath_1";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_1_NRM";
    specularPower[0] = "41";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "0";
    translucentZWrite = "0";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    colorMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_1";
    specularStrength0 = "0.294118";
    specularMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_1_SPEC";
    alphaTest = "1";
    alphaRef = "140";
    };
    Code:
    singleton Material(roadtrail_mudpath_2)
    {
    mapTo = "roadtrail_mudpath_2";
    materialTag0 = "RoadAndPath";
    materialTag1 = "beamng";
    normalMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_2_NRM";
    specularPower[0] = "41";
    pixelSpecular[0] = "0";
    useAnisotropic[0] = "1";
    translucent = "0";
    translucentZWrite = "0";
    specular[0] = "0.00392157 0.00392157 0.00392157 1";
    scrollSpeed[0] = "4.118";
    diffuseColor[0] = "0.992157 0.992157 0.992157 0.719";
    specularStrength[0] = "0.294118";
    colorMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_2";
    specularStrength0 = "0.294118";
    specularMap[0] = "levels/Shibukawa/art/road/roadtrail_mudpath_2_SPEC";
    alphaTest = "1";
    alphaRef = "140";
    };
    -After the file locations are in place, the alpha of the textures can easily be adjusted in-game.

    -When a texture has been adjusted and saved in-game, the material.cs will need to be reopened by your text editor because the changes saved in Beamng will probably not be registered by your text editor until the material.cs is reopened.

    -Lastly, the game will not register any outside changes made by a text editor until the level is reloaded. Sometimes the game will have to be restarted.
    _______________________________________________________________________
    -I suspect that I have probably skipped over a thing or two in passing. If or when you experience a problem in the above mentioned process, I will try to provide resolution to your issue.
     
    #56 Ouerbacker, Jun 30, 2016
    Last edited: Jun 30, 2016
  16. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89
    I replied to this yesterday but apparently the button didn't press send correctly. But yeah, this helps make a lot of my issues easier man, thank you so much for your help! So but working entirely in the .cs file all I need to do is assign the name of the texture to the road when I apply the road right? And adjust texture stuff in material editor? :D This is great!
     
  17. Ouerbacker

    Ouerbacker
    Expand Collapse

    Joined:
    Aug 2, 2013
    Messages:
    463
    yeah
     
  18. theonciest

    theonciest
    Expand Collapse

    Joined:
    Jun 12, 2015
    Messages:
    89


    My progress so far :D :D
     
  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