[Tutorial] Creating LOD and COLLISION meshes

Discussion in 'Content Creation' started by MysteryManGER, Aug 30, 2016.

  1. MysteryManGER

    MysteryManGER
    Expand Collapse

    Joined:
    May 25, 2016
    Messages:
    647
    Creating LOD and collision meshes with SketchUp

    1) You have to create a mesh for each LOD level. Usually I use 3 LOD models and a collision mesh. You can call them for example:

    - house.dae (highres mesh)
    - house_low.dae (lowres mesh)
    - house_ulow.dae (ultra lowres mesh)
    - house_colmesh.dae (collision mesh)


    Put all files into your map folder (usually MAPNAME/ART/SHAPES)

    2) Now open the ingame map-editor, and import the highres-mesh into you map. Place it whereever you want. When everything looks fine...select the model and open the ingame shape-editor.



    On the right side, you'll see a window called "Properties". Select "Detail" and click "detail2". Below you can change the value from "2" to "1000".



    3) Now change the "current detail"-button below to "new detail". Then go to "Import Shape info...", navigate to your Map folder, and open the LOWres model. (Maybe you have to change the filetype to COLLADA)





    After your lowres-model is imported, you'll have a new detail. Select it, and change the value to 200.

    4) Import your ultra lowres-mesh the same way. And change the value to 10.

    The values behind the detail are used to define the distance the LOD will show up. Maybe you'll have to play around with them.

    COLLISION-MESH

    1) New detail -> Import Shape info... -> select your collision-mesh.

    2) Now change the name from "detail2" to "collision" and set the value to -1. (Don't forget the minus!)

    3) Then select every entry within the "collision-1" and change the names to "Colmesh-1", "Colmesh-2" ...so that it is looking like that:



    If you have more entrys, call them "Colmesh-3", "Colmesh-4" and so on...

    When everything works fine, the collision meshes will show up here:



    Now save the mesh and test it!

    HAVE FUN!
     

    Attached Files:

    • 01.jpg
    • 02.jpg
    • 03.jpg
    • 04.jpg
    • 05.jpg
    • 06.jpg
    • Like Like x 4
  2. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    Thanks for taking the time to write this tutorial, even if I'm not going to use sketchup for LODS and Colmeshs ( Blender is better at exporting objects in .dae and it's possible to setup the LODs and Colmesh in it without the game crashing on me ( for some reason if i go into the shape editor with the shape where i setup the LODs selected the game crashes now )).
    Also for some reason importing a shape in a new detail doesn't work if my level is in the folder "Documents\BeamNG.drive\levels", I had to move the level to "SteamApps\common\BeamNG.drive\content\levels" in order to get it working.

    While messing around with the values, I finally learned what the values behind the detail really means : it's the size in pixels of the shape on the screen. For example, if you write detail-1000 this means the shape will be loaded when it represents 1000 pixels and more on the screen. Else, the shape loaded will be the one with a smaller pixel count written ( ex : detail-200 ), or the imposter/nothing if there's no smaller detail level
     
  3. MysteryManGER

    MysteryManGER
    Expand Collapse

    Joined:
    May 25, 2016
    Messages:
    647
    @tdev @Nadeox1: Since the new update (version 0.7.0.2) I am not able to insert a new detail. Everytime I try it, the game will crash. Collision-meshes (without textures and exported with Blender) sometimes work...but textured meshes always crashes (doesn't matter if they are exported via SketchUp or Blender). Could you please have a look at it?
     
    #3 MysteryManGER, Oct 9, 2016
    Last edited: Oct 9, 2016
  4. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Does this still crash out on you?
     
  5. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    BOOOOOOOM DESKTOP! Doesn't work anymore, as stated above.
    Crashes to desktop.
    55.33842|D|TS|inspecting: 2985
    55.38199|D|TS|inspecting: 2985
    57.78651|W|CodeBlock::exec|tools/shapeEditor/scripts/shapeEditor.ed.cs (298): Unable to find object: 'ShapeEdColWindow' attempting to call function 'update_onShapeSelectionChanged'

    114.03625|W|CodeBlock::exec|tools/shapeEditor/scripts/shapeEditor.ed.cs (2524): Unable to find object: '0' attempting to call function 'findText'
     
  6. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Looks like I am pretty stuck on this. Will have to shelve my city map until this bug is fixed, blender is just proving to be just too much for my brain. It's a shame I can't get auto-collision on these in the forest brush, otherwise i'd be fine, but visible collision meshes don't even work AT ALL in the game, what-so-ever.
    I have issues learning things, and I have this sneaking suspicion that blender is just not something I can easily do, plus, when I started picking up things in it, the tutorials on it ended at a paywall. I was like, so pay for something I am doing for free mod when I am on a fixed income, yeah, OK. Never-mind that then.
     
  7. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    I wonder if this has something to do with the modifications the devs have done to the Torque3D engine. Have you tried
    doing this process with the vanilla T3D engine? A shot in the dark anyway. I ran into the same LOD/collision mesh crashing
    as well. I'm going to learn Blender one way or another and start with super simple, super basic shapes. Massive tiny little baby
    steps because I too have my issues picking up all the Blender radio fuzz.
     
  8. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    583
    Seemed like I got somewhere could change detail distance, cant add detail cause it uses full directory annoying known issue that should be fixed, anyways that's not important it seems trying to load billboard crashes the game.
     
  9. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    Possible.
    The method describe in the OP is not used by us, so therefore is not under our attention if it breaks or something ( If a feature you don't use breaks, you don't notice ).
    I guess we need to give it a look when have some spare time from the higher priority stuff.
     
  10. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Appreciate the response, thanks. It's fairly obvious the Sketchup process isn't really favored by you guys (or a lot of others), for
    various technical reasons. Trying to put efforts into getting this particular scheme to work at this stage of development does seem
    frivolous. Would be nice if the Sketchup people could look into an exporting process similar to what Blender does.
     
  11. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Thanks, appreciate that. There's also the issue of the program calling the wrong root directory when adding resources inside the editor (aside of initial browsing for meshes inside F1 editor, that DOES work, confirmed). It ends up really getting a messed up directory on these so even adding meshes itself does work, the directory call could be crashing it.
    Obviously it's not a serious priority, but don't forget about us modders. Me using Blender 3d is not looking good here with much hope, I am disabled (mostly due to my back, migraines, and PTSD), I have issues learning, though I can do what I already know better than most people, when my body/brain cooperates. Some things I can pick up and master with little to no thought or effort, I am fine with, other things, like Blender, give me a massive migraine as my brain tries to use parts that are damaged by blunt force trauma (from when I was a child), and fails miserably (and it makes me considerably angry/frustrated, which is not helping me). That being said, and personal drama aside, enabling some type of ability to use native collision with sketchup models (like a DUPE LOD 1 FOR COLLISION feature) would really open up a lot of things for many of the folks who can't afford or don't know how to use commercial modeling software (or Blender).

    They had tutorials for Blender, I started getting it, but then I was stopped by a paywall. I haven't made a red cent on my mods, and am not looking for donations (I wouldn't really mind them but honestly I am not doing it for money), so I can't afford to spend a big chunk of change being on a fixed income. Not broke, but I need to save my money away in savings and stock, not spend it on software I might not be able to use anyways.

    However, someone who knows how to code, COULD write something that would give us collision meshes, by just:
    inputting a model,
    duplicating it & then stripping it of texture entries
    putting duplicated piece under COLMESH or COLMESH1 or whatever it is
    saving a new model.

    If I could get automatic collisions (even using a VISIBLE collision on things, this doesn't work either), I would be able to do it, but I can't get a single thing to collide and I've done my groupings correctly etc. At-least I finally got models in that function without crashing the application in the f1 object editor. This program just DOESN'T like sketchup models, and they're so readily available in huge numbers, things like bridges, roads, raised highways, city blocks, homes and commercial high-rises galore, almost absolutely ready to be used. There was no issues with collision prior to say 0.8 or 0.9, something changed recently and I don't know why. I tried different texture format but it just doesn't want to collide properly at any setting.

    Basically, what I am saying @Nadeox1, isn't to do this for ME, do it for YOU, YOU are part of a group, that has software for sale, and it's not done yet (so I understand it is NOT perfect, but it's still GREAT). YOU (or whoever codes) makes these changes, to make THIS method work described in the opening post, people can make more maps, and make BETTER MAPS, the mapper will want his friends to play, or his friends see him play at home or on youtube, they will buy the game and play it. It means more sales in the end, but I understand there is only so much time.

    @Nadeox1 Thank-you for responding, Danke! (Thanks!)
    --Best Regards, the blundering Blunderton
    --- Post updated ---
    I have vanilla T3D installed but have not done anything with it yet. I will give it a shot, as I was thinking the same things, if it DOES work (no reason why it should not), then it will let me work around this bug, with not so much down-time where I am unable to map.
     
  12. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    583
    so im sure you know that you have to have a chain of empty's to make the model work if you do not know how to do it first shift+a in object mode then find empty and just choose plain axis rename it to base00 then make another empty plain axis and call it start01 now make start 01 a child of base00 then put your model as a child of start01, duplicate your model, to duplicate it make sure your in object mode, select it and do shift+D then right click so the cordianates are the same as the original, rename the duplicated to Colmesh-1.
    Now I think you need to center it so go into object mode then shift+S choose cursor to center then select everything and do shift+s choose geometry to cursor now you should be able to export it as dae and have working collision.
     
  13. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    MY THATS COMPLICATED. HOLY MOLY.
    Do you have a picture of what the finished thing 'looks like' with all those hierarchies? I do appreciate the help. If you can't, please oh please, when writing directions, try to break them up in a few sentences. Please. I have issues (I am soooo not being an EXPLETIVE DELETED I am being serious)... HELP
    My truck ignores my models currently BUT they're 'exploded' and then grouped, so that the curves/smoothed surfaces aren't subgroups.
    Only other issue I have is setting my origin on the piece, it's a good several blocks away (ARGH!), even though I exported it from right near the center of all my axis'es. I am sure I can find an article on that last bit. Thanks for the skinny on this though.

    I am trying this... never heard of shift+D... you lost me in the object part at 'goto shift D' or something... I got this far, haven't checked collision yet, i named it colmesh-1 though under 'base00' and child 'start01' so it goes base00>start01>colmesh1
    WHY IS THIS SO NON-INTUITIVE AND OTHERWISE @#$%ING DIFFICULT


    *starts singing Cheryl Crow song whatever the heck it is where it goes "no one said this would be easy.... no one ever said it'd be this hard" ugh*

    And why the heck does it give me an arrow to move it IF I CAN'T MOVE THAT PART ANYWHERE, it's teasing me, my model is WAAAAAAAY a mile away. Even though all coordinates are the same.

    100% see why several of the decent mappers left, what the sam hell is wrong with this hierarchy display. No, I mean, it's a mess. Whatever. I am about done fighting this thing, period. This editor is an absolute unmitigated disaster.
     
    #13 bob.blunderton, Jul 5, 2017
    Last edited: Jul 5, 2017
  14. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,152
    Here's my export file:
    Ex1.jpg
    All it contains are two empties, as you can see in the scene outliner (the window in the upper-right corner). The first in the hierarchy is 'base00,' which defines the object altogether, and the other is 'start01,' which is parented to base00 and is purely for visual meshes.

    I keep this file empty so no models or materials linger from one object export to another. To bring objects in to the export file, I go to file>append, find the file I'm wanting to export from, and get the object(s) I'm exporting.
    Ex2.jpg
    The visual mesh(es) are parented to start01, usually with an LOD number associated with them (the 'a' right before the LOD number is because Torque tends to read underscores as negatives, making the LOD negative; invisible, in other words)(also, the LOD is demonstrative, this would result in an object with only one LOD). The collision mesh is parented to base00.

    This still requires a little extra work in editor, though. Once imported into Torque as a TSStatic object (NOT a forest item), one selects the object, goes to the object editor, selects the collision mesh under the details panel, and renames it 'colmesh.' From that point on, collision will work, as a static mesh OR a forest item.

    Edit

    Oh, and the 'exploded' effect you may be suffering from might be that your objects do not all have a common center. To fix this, get the objects you want to export, and hit CTRL+A. A small pop-up menu will show, asking which transformation you'd like to eradicate. You'll probably want both location AND rotation & scale, so you'll want to hit that shortcut twice.
     
    #14 Occam's Razer, Jul 5, 2017
    Last edited: Jul 5, 2017
  15. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Yeah, this is getting real complicated... and my brain has blunt force trauma (issues from what happened when I was little and nailed a plaster wall corner at full run, folded my head good, but was young, so brain mostly worked around it, mostly...) and PTSD... not a good combo. In other words, I learn great hands-on, but I now have a migraine, massively, and my back is screaming bloody murder as I sit here. It's not good. I will try with your advice RRF... thank-you is the least I can say, I have the jpeg from 'exporting a static mesh' tutorial, but everything is so complicated...
    Am I hitting CTRL+A in sketchup, in blender, in Beamng.drive in the editor?

    EDIT: I am done for the night, my head is pounding, what was a light headache is a full on migraine here now. this should NOT be this difficult, the hierarchy thing is completely broken now in Beamng.drive. I am throwing in the towel on this for the night, going to try tomorrow before cutting my losses where it's at. I can't figure out blender either, sure I can move around in it, but that program is just too technical for me. I mean, if it works, great, if not, I'll just have to go on hiatus until this application is easier to use and understand, and compatible with the tools that are available and less niche/less complicated.
    It would have been helpful if Blender's tutorials, which I was somewhat understanding didn't stop behind a paywall before even being able to figure out how to even START TO MAKE something, idiots they are... Their loss not mine!
     
    #15 bob.blunderton, Jul 5, 2017
    Last edited: Jul 5, 2017
  16. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,152
    Sorry, that'd be Blender. Also, I kinda walked in in the middle of this debacle, so I might not have the greatest grasp of what you're having trouble with. Sorry if that makes part of my post sound like mindless rabble.

    Anywho, if you're importing from another program entirely, then you can forgo 'append' and just use 'import.' Append is only if you want to draw from another Blender file.
     
  17. Average Person

    Average Person
    Expand Collapse

    Joined:
    Jul 8, 2015
    Messages:
    583
    Hey thanks for making that little guide was about to go ahead and make that until I realized it was already done.
     
  18. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    Yeah this is just a lot of knowledge that I don't have (about blender). I can only use sketchup, my brain has thus-far been unable to learn Blender and I am highly doubtful I would ever be able to learn it at this rate. I can make a properly made model with sketchup, with the normal correct, not so much overlap, etc, no hard edges, you get the point. I can ungroup all the subgroups like curves and such, and then group that all in one, and export it properly. I can get it in the game, but it has no collision. Not even any collision if i put the model at "base00>start01>colmesh-1". I don't know how to duplicate or whatever it is inside the beamng.drive editor shape editor, i got lost @ that point on what @Minecrafterman64 said.
    What's happening is my brain is 'blanking' as if someone's pushing the reset button like a kid who just has grown tall enough to reach it, while I am trying to read those directions and follow them. I think my disability or whatever is wrong, has finally caught up with me.
    Maybe I should just stick to building 'yet another, bigger, better brick box' in Fallout or something... dunno. I will try again tomorrow, or just throw in my hat until this program is more accessible in the future.

    I mean it should have been a hint to me that there's like 3~6 different authors out there right now with original custom models in their maps out of the entire community! Out of thousands of people, THOUSANDS, if not TENS OF THOUSANDS who bought this game... well 3~6 people picked it up. I guess though if I knew how to model stuff that well in a pro modeler (such as Blender) I'd be MAKING MY OWN GAME to make money from it, though, not giving it away free.
    Sad part is, the fact that the game doesn't use collada from sketchup, and can't get any collision from it, without some complicated thing (nevermind the hierarchy in Beamng.drive completely broke now), is not holding up my city map, it's also holding up another author, who did the Tunnel Race map. He's made a bunch of pretty cool stuff, and it's just so bloody difficult to get anything into this. I have spoken with many authors in fact, especially around the times since 0.7 alpha and later versions have landed, that had half-finished projects that just basically disappeared into thin air because they used a program to make the models more people understand (hint: not blender), and could no longer interact/collide with anything.

    Will post a status update tomorrow.
     
  19. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,289
    ACK! Don't ask! (collision is visible here in pink)
     
  20. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Man I'm glad I found this thread after starting to work with Blender...seriously. I have been spending a lot of time trying to get statics
    with collision to work but am having a hard time understanding how to set up the outliner to export collision meshes reliably.

    I'll spare everyone the insanity and start with two questions:

    1: What are and why are "empties" needed and how do I go about creating them?
    2: Is parenting a requirement for collision meshes to work properly and does the alphabetical outliner listing affect parenting?

    This is enlightening for sure but confusing to me.

    EDIT: I figured out how to get the empties set in the outliner:p. Maybe this will answer the parenting question.

    Screenshot72.png

    Visible mesh not showing with this. More work to do.

     
    #20 Aboroath, Aug 17, 2017
    Last edited: Aug 17, 2017
  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