How to make a good! n/b structure

Discussion in 'Programming' started by VertexStyle, Dec 11, 2016.

  1. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    At the moment Im modeling the body of a 1963 VW Beetle,
    Unbenannt5.png
    however I've tried to make a suitable n/b structure for this car.. - it's completely messed up :D
    Which steps are important for a good complex structure? Is modeling it in blender the best way?
    Thanks
     
    #1 VertexStyle, Dec 11, 2016
    Last edited: Dec 11, 2016
  2. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Well, I usually use Blender to hash out the most complicated part of the JBeam, then I use notepad to do the rest. Everyone uses a different flow, but I can tell you how I do mine.

    I always start with the most underlying structure of the chassis, on most cars that's the unibody or the frame... in your case, that would be the pan (I think that's what they call it? Cause the bug doesn't really have a "frame" so to speak). I build it until it is structurally sound. You can kinda cheat this in blender by just creating a SUPER low res model in the basic shape of the part you are building. Then you can highlight all of the faces of that model you just created and delete them... all of them... they are useless in a JBeam. Then just select the points that are left and start interconnecting them... I even think there might be a modifier in blender to help you do this.

    Once interconnected, you can export the nodes and beams and drop them into a JBeam file. It should now show up in game.

    Once I finish the frame, I move onto the suspension, then the basic body, then the interior, and finally the bumpers and fenders. This way, one piece at a time, I can keep everything organized and not mess it all up.

    Now nothing is interconnected at the moment, so I just have a bunch of parts and part files... now I go though and start connecting everything.

    I load up Beam, and then fire up Notepad... load my mod, freeze physics, show the physics structure and the node names, and just start figuring out what needs connected where to get the most realistic and stable connection, all the while reloading the vehicle whenever necessary.. This takes a while, but doing it this way it's much more likely that I will get it correct the first time.

    Everything I learned about the file structure I got from here.
    http://wiki.beamng.com/Introduction_to_Vehicle_Creation

    If this isn't what you are talking about and you would like to know the physical patterns to lay the beams out in, I can help with that too.
     
  3. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    Thanks a lot. This will help me :)
    I used this example too and these were some of my problems:
    -the body is wobbling
    -steering is terrible, accelerating is extremely bumpy
    -textures are not loading correctly: I have to add the mesh of the car via scene-editor into the scene and afterwards the textures are loading correctly...
    So tips are welcome xD
     
    #3 VertexStyle, Dec 11, 2016
    Last edited: Dec 11, 2016
  4. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Alright, I will see what I can help with here.

    Wobbles
    Depending on where the wobbles are at, this usually means that you need some more bracing beams. As an example, I recommend you download and take a look at this example car.

    http://wiki.beamng.com/Example_Projects

    Also, somewhere on these forums I seem to remember Neodox writing a fairly good explanation about bracing structure, but of course now that I need it I can't seem to find it.

    http://wiki.beamng.com/Construction_Guide

    This is also a construction guide that gives a bit of an explanation as well. May prove to be helpful.

    And finally, I will try to explain it here as well.

    The structures that we create out of nodes and beams have some interesting properties. The connection between the beams (at the nodes) is 100% frictionless in all rotational directions. Because of this, making ropes or chains is rather trivial seeing as you just have to string some nodes together with some beams and... well... you're done.

    A rope would be considered a 1D construction as there is no depth or height, just length.

    Now this will do nothing but flop all over the place. What if we wanted to make a curtain?

    To make a believable curtain, you need a latticework of nodes and beams. Usually the easiest way is to set them up in squares... you know... looking like a chain link fence. where the wires are straight is where the beams would be, and where the wires cross at is where the nodes would be at. This would get you a 2D structure, but it is very floppy... very floppy.

    Let's turn that blanket into a garage door. That will require a little more structure. What you should have now is a latticework of nodes and beams laid out in a square pattern. Now, on each square, interconnect the nodes from top left to bottom right and from top right to bottom left. Now you should have a square with an x through it.

    Basically all we are doing is limiting degrees of freedom of each node.

    Now that each square has its own cross bracing, It acts like a big cardboard box. The squares hold their shape really nicely, but you can still freely fold it along the vertical or horizontal beams... like a box... kinda... Lets add one more dimension.

    Now... take that structure and basically extrude it vertically (envisioning it laying on the ground). Now we have two planes of interconnected nodes parallel to one another (hope you like geometry). Now as we did before, we need to connect each node with another with a beam (3 at the very least, but I will get there). Start by interconnecting the nodes that are directly across from each other in the parallel planes. This will make the planes be connected, but it has now support. It will just flop over.

    Now, envision in your mind each one of the cubes you just made. Every cube will need to be cross connected to take forces in every direction (starting to see why there are so many beams per vehicle). Once you are done, you should have a structure very similar to the example car I linked earlier. Basically a deformable brick (oh boy!). However, this brick will not flop around as every nodes 3 degrees of freedom and every beams 3 degrees of rotation (relative to each other for both nodes and beams) have all been canceled out.

    For curved sections of body, things will get a little more complicated, but if you apply the basic rule of 3 beams per node (to limit its 3 degrees of translation) at minimum, you can usually get a halfway decent structure. Just make sure that the 3 (or more) beams are all in 3 different directions. I usually average about 7 beams per node however (depending on what I am using it for).

    But as a rule of thumb, just try and kill degrees of translation.

    Steering
    Now, as far as steering goes, to keep your tires tracking correctly, you are going to want to employ an ackerman angle. Don't like math? Don't worry, you don't need any for this. In an ackerman angle, basically you want to take both steering knuckles and line them up with the center point between the rear wheels... its really that easy.

    https://en.wikipedia.org/wiki/Ackermann_steering_geometry

    Also, remember to make the tie rods the same length as the A arms... otherwise when you hit a bump it will cause the steering geometry to change with the travel of the tires... not good in terms of handling.

    Acceleration
    I am not entirely sure what you mean by it is bumpy, I am going to need more details on this one. However, it sounds as if your wheels might be too light for the physics engine causing them to spaz out a bit.

    Textures
    Now this I have dealt with before. In my case it was because my blender file had different names for the materials and textures then the texture I was using on my model. This meant that my material was called something like Fender.jpg, but in the blender file it was called LeftFender for some reason and it was totally cool with that... Beam was not.

    So to fix my error, I just had to make sure everything was named correctly.

    Hope I helped a little bit. If you want me to add some pictures to better explain it I can do that as well. Also if this post has some odd wording in it, it is because I somehow have overtype stuck on and that means if I want to reword something that I have to delete everything after it and retype it all... and I am far to lazy for that.
     
    • Like Like x 1
  5. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    Wow, thanks for the help!! Cant wait to improve it...
    This video kind of summarizes everything:
     

    Attached Files:

  6. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Hey! That's actually pretty good! I see what you mean about bounciness though. What is happening there is it looks like your suspension is far to stiff. My guess is the beams that you set up to use as the shocks are just at the same spring rate and damping as the rest of the bug. That would cause your odd behaviours... it would also partly help in why your steering feels the way it does.

    What I would do is find the 4 beams that you will be using as all 4 of your shocks. Then I would change their parameters to something more like this... (if your bug is down to weight, if not, tell me what your current weight is for testing and I can give you some new numbers)

    As a guess from my calculator over here, I would guess...
    Front springs
    Stiffness = 960 N/m
    Damping = 1050 Ns/m
    PreLoad = 1.170 (super guess here... not sure)

    Rear springs
    Stiffness = 3120 N/m
    Damping = 3280 Ns/m
    PreLoad = 1.180 (again, super guess... both could be 0 for all I know)

    This is for a Bug with a weight of 820kg, 10kg tires, a wheelbase of 2.4m, and a guessed weight distribution of 1.8m from the front of the car to the center of gravity.

    Also, I just found this that goes with my earlier post much better.
    http://wiki.beamng.com/JBeam_Introduction#Beams
     
    • Like Like x 1
  7. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    Hey, I'm now trying to make everything more accurate, so I've decided to start afresh.
    The chassis worked pretty fine,
    Chassis.png
    but when i did the same with the body (which has now a separate Jbeam-file), it showed up in the middle of nowhere.
    Body.png
    Maybe its important to mention that the Jbeam-nodes of the body are not showing up in debug mode.
    Anything in that body.jbeam (attachment)is messed up and i cant find anything :(
    Is there any method to make troubleshooting easier?
    thanks!!
     

    Attached Files:

    #7 VertexStyle, Dec 14, 2016
    Last edited: Dec 14, 2016
  8. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    As for why the vehicle spawned way off on no man's land I am not totally sure at this moment, but...

    Sir... I admire your attention to detail... but you need to calm down a little :rolleyes:

    Your body is made with expert precision, but you have over 630 nodes in the body alone. For anyone just meeting the minimum system requirements, they are going to have one hell of a time trying to run this car in game... although... I admittedly kinda want to see you go through with this because the deformation must be magnificent. :D

    Anyways, to get a fairly accurate node/beam structure, and still have most computers be able to run it, there are a lot of "tricks" that we use to still achieve realistic results.

    Capture1.png

    For instance, your node structure has wall thickness everywhere like the roof and where the trunk would be and pretty much everywhere else. This is overkill. What we usually do instead is just make the outermost layer (I will use the roof as an example) and then use "cheater beams" to simulate the structure of having a true thickness wall. what this ends up doing is cutting down on our node and beam usage massively.

    The more I look at this thing the more I love your attention to detail, it is seriously impressive.

    Next we can cut down on details that we don't really need to simulate all that accurately.

    Capture.png

    for instance, this area has even the notches for the exhaust simulated... while awsome, don't bother going quite that ham on this. Once you get down to the really small scale anyways, usually the beam engine starts to have some trouble holding together anyways. instead, just take the beams and run them right down to the bottom nodes, skipping and deleting the middle nodes.

    Areas that will not get a lot of attention can be cut down as well, for instance, the front of the car...

    Capture2.png

    This whole area will be covered by the hood and fenders. That means that unless they are ripped off (this is beam, I understand, it will happen, but still) that this area will not even be seen, much less affected. So we can skimp on details here as well.

    Structurally, while it looks accurate, you may have difficulty getting the structure to hold itself up, so we need more cheater beams in places like these.

    Capture3.png Capture4.png Capture5.png

    What is usually done is beams are stretched across the gaps to simulate there being structure, and then weakening those beams so that the structure still deforms realistically. So what you end up with is something a little more like this...

    Capture6.png

    It looks dumb, but it works wonders.

    Lastly, keep your structural areas that you plan to hook it onto your frame, but take out a good portion of the nodes around that area, like here...

    Capture7.png

    You have your notch cut out for connecting to the chassis, which is all fine and good, but honestly, not necessary. To interconnect the parts together, we are going to be using beams anyways, so you can literally get away with a flat bottom here. Just a couple nodes around the bottom and that's it.

    So what do I mean by all this? Well, in the node beam system, you basically use it as an outline. You take your 3D model, and outline it in nodes, not a lot has to be done for internal structure with nodes as the beams being connected across open space can take care of that. Also, fine details can be spared for computational speed as the flexbodies will take most of the visual force of a deformation anyways making even the most basic node/beam structures deform fairly nicely.

    When I get home, if you want me to (as I am at work right now just being bored) I can whip together a demonstration body for your VW, or send you one of mine so that you can see a lot of the cheats you can get away with and better understand how to continue. Also, these tips can be applied to the entire vehicle.

    For instance, your frame. While magnificent, again, is way overkill. While keeping your basic structure, make your squares much bigger. For instance, looking at your frame... I would say you could probably get away with 20 to 30 nodes while still keeping it realistic and still deforming properly (perhaps 40 even). Your body, I think you could get away with about 70 to 80 nodes while, again, keeping it realistic. Focus detail and node density into areas where the body will make contact with something (ie., the roof, sides, and engine bay at the back) and skimp everywhere else just barely nailing the basic outline shape. Same with your frame. Don't even worry about modeling on the suspension components yet either, just go for the basic frame itself and then we will get to the suspension later.

    Edit: Also, as a good tip. Strip down some of the in game vehicles and check out their structures in the debug mode. Gabester is fantastic at cutting down on unnecessary nodes. Take a look as to how he builds his structures and use them as inspiration.
     
    #8 atv_123, Dec 14, 2016
    Last edited: Dec 14, 2016
  9. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    :'D Thank you so much for your tireless efforts!!
    One day all this will work together...
    You can find the body part for blender in the zip file - so if you want, you can create an example jbeam for me :)
    Ill try a new one too.
    greetings
     

    Attached Files:

    • Like Like x 1
  10. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Haha ;) don't worry. With how much attention to detail you are giving this thing, this will probably end up being one of the best mods in the game by the time you're done with it.

    When I get home tonight, I will throw one together so you can see what I am on about :)
     
    • Like Like x 1
  11. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    I am back! I have gone and made a lightweight bug body... even got your mesh on it :D

    I also, for shear curiosity, went and got your creating stable. Apparently the issue was that there was to much spring for the amount of weight for each node. This naturally caused some issues, but I did get it in game!

    Capture.png

    It actually surprised me and was quite a bit more stable then I would have thought it would be... so if your entire vehicle was built like this, it would actually work in game without the extra beams... thats pretty cool I think.

    Anyways, for the lighter weight version, this is what I did to get there... I really didn't do much.

    First I just make a super rough outline.
    Capture2.png

    Then I interwove the entire mesh with more faces... just to cheat with the triangulation modifier later.
    Capture3.png

    After triangulation... I just deleated all the faces.
    Capture4.png

    What it looks like in the mesh.
    Capture5.png

    Then I got it in game and this is what it looked like.
    Capture6.png Capture7.png Capture8.png

    Not too bad, but will save a tone on CPU computational time.

    Also, I included the zip file I used if you would like a look.
     

    Attached Files:

  12. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    Really cool! Ill try it out once I get home :)
    I tried one too - and it was stable - but it started to vibrate when it got deformed (think its also caused by the spring amount)...
    thanks
     
  13. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    you are doing a great job, and @atv_123 your tips are really useful for me too :)
    I'm really looking forward to the results.
     
    • Like Like x 2
    • Agree Agree x 1
  14. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Glad to hear it! If you have any questions that I can try to answer as well, go ahead and ask because you won't be the only one wondering, and if I don't know, then I will learn something too while finding the answer!

    Yea, tuning is a difficult animal all together. It requires a lot of "change the spring, reset, change the damping, reset, adjust the weight, reset, ect, ect..." Right now, the one that I made up there is very stable because I didn't do any tuning on it at all. I basically just made the nodes weigh about 10kg's each and then lowered the spring and damping some... it's a quick and dirty way to get your build in game, but it isn't very realistic. In actuality, this body of the bug probably weighs all of 150kg's where as mine is probably closer to 800kg's... that's practically the entire weight of the car just in the body alone so some extra tuning will need to be done.
     
  15. VertexStyle

    VertexStyle
    Expand Collapse

    Joined:
    Dec 11, 2016
    Messages:
    180
    hey!
    To keep you up to date -> video
    Did you noticed the spike on the roof after the crash? How is this caused? (the nodes don't deform that much...)
    Another problem is, that the axles break (wheels cave in) when drifting - how should i proceed?
    PS:Fenders, doors and bonnet haven't got a separate jbeam File at the moment.
    thx :)
     

    Attached Files:

    #15 VertexStyle, Dec 17, 2016
    Last edited: Dec 17, 2016
  16. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Hmm... I would probably have to take a look at the JBeam to either confirm or deny any of my suspicions.

    By what I can see on the roof, it almost looks like the nodes are getting folded in on themselves... however, you just said that this was not the case.

    http://www.beamng.com/threads/does-more-vertices-mean-better-deformation.16314/

    In reading this old thread, it suggests that the perfect ratio to have with a mesh to JBeam is a 3 to 1 ratio of pollys to nodes... So perhaps the JBeam does need to be bumped up in complexity a bit which, thankfully, is pretty easy to do. Of course the other option is to reduce the pollys of your model, but I wouldn't want to do that.

    As far as the wheels are concerned, by bumping up the spring rate and damping on the A-arms of your suspension (or whatever setup is under there) should (in theory) solve your folding problem. You also may need to reduce the friction of the nodes of the tires a little bit as well... more for realism reasons... because we are talking about 1960s tires here. I might have to look into the Burnside Special to see what Gabester did... if he didn't do it, then I wouldn't either.
     
  17. coolness708

    coolness708
    Expand Collapse

    Joined:
    Dec 28, 2016
    Messages:
    5
    hey don't name it 1963 bug it will get removed make it called the wv or wolfvargin cub and how do you make j beam I want to mod but have mo clue
     
  18. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    About 7 posts up is a loose tutorial.
     
  19. Rainvest

    Rainvest
    Expand Collapse

    Joined:
    Dec 26, 2014
    Messages:
    1,902
    He can post it on the forums without it being removed. Anything posted on the forums with a copyrighted name is fine.
     
    • Agree Agree 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