Collision "Normals Groups" Suggestion

Discussion in 'Ideas and Suggestions' started by Dummiesman, Jul 14, 2019.

  1. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,683
    Hello. Since I've picked up work on the IndyCar mod again, I'm yet again having a lot of trouble getting aerodynamics to work. Due to the way collision normals work I'm finding myself choosing between two thnigs.

    - Bad aerodynamics
    - Bad collision (removing many tris to get proper normals :/)

    I thought of this as a possible way to keep the whole concept of node normals, and allow some flexibility in the way they work at the same time

    My idea is, have {"group":"whatever"} in a triangles/quads section make "smoothing groups" for the triangles/quads. So the game would then go over each group and simulate it individually

    An example of this would be having a "group" for each face of a cube. That way the cube wouldnt have 45 degree normals.

    Another example would be for the IndyCar. The wing had side triangles, but these had to be removed as they were interfering with the main wing part. The group could help out here by having 1 group for the sides, and 1 group for the top. Therefore giving the top and sides their own normal groups.
    upload_2019-7-14_16-25-36.png upload_2019-7-14_16-27-37.png
     
    #1 Dummiesman, Jul 14, 2019
    Last edited: Jul 14, 2019
    • Like Like x 1
    • Agree Agree x 1
  2. estama

    estama
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 7, 2012
    Messages:
    267
    If i understand correctly then the possible solutions are:

    - Set dragCoef of the tris that you don't want to affect the normal to 0 (so set side triangles dragCoef to 0).

    - If you want both of them to apply, you could design the jbeam in such a way so that they don't share a common node in the middle. So the side triangles will have their nodes above and below the horizontal wing and won't connect to horizontal wing's nodes.
     
  3. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,683
    This isn't possible in many cases where this is an issue. E.g. with the current mod I'm working on we can't even add 5 more nodes for mirrors as that would make it overweight.

    EDIT: Also wouldn't adding another node in there require 0 length beams, which are also considered bad? ¯\_(ツ)_/¯
     
  4. DevinXXL

    DevinXXL
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    35
    Basically this. To compare, jbeaming is quite similar to 3D modeling where you have vertices and triangles that are made up of them. In 3D modeling, there are two solutions to this problem:
    1) Duplicate vertices (affects performance, is a dirty hack in that sense)
    2) Smooth groups

    Since duplicate "vertices", or in this case nodes, are absolutely to avoid here for two reasons (0-length beams and weight), that only leaves the option of smoothing groups in that sense. Either that, or the ability to "flat-shade" triangles/quads, applying forces per triangle normal rather than vertex/node normal. In graphics it may only affect performance and file size. In physics (for collision for example) it breaks a whole lot of other things, especially once friction gets added into the mix. An example being a flat road with walls having a whole lot less friction than if it wasn't interpolated on the vertices, since the movement vector isn't perpendicular to the interpolated normal when you consider only gravity acting on the vehicle.

    Ontop of that, BeamNG uses these normals for aero calculation too, which makes building a reasonably workable aero that makes sense very close to impossible in some cases.
    So yeah, smoothing groups, or the ability to have flat shading or per-triangle calculations without any interpolation would be fantastic, if not absolutely crucial to some types of vehicles.

    We already wrote custom code for the diffuser, I'd preferrably not write custom aero code for more bodywork for several reasons (complexity, no point having two aero systems for everything, time, performance, etc) so I'd really appreciate this feature
     
  5. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,683
    The biggest issues that arises out of this is
    -On lower density jbeam you're forced to choose between bad collision or bad aero
    -On lower density jbeam, any, and I mean any changes to aero can result in erratic or unexpected behavior, that requires you to retweak several parts of aero just to correct this. Repeat the process for every aero change.
    upload_2019-7-16_10-36-16.png
    upload_2019-7-16_10-50-39.png

    Right now we're on our second day of "try and figure out what exact part of the aero to tweak to work around this", and it's preventing us from making much progress anywhere else
    --- Post updated ---
    So I'm convinced either the debug, or aero itself is broken. We have engine set to 10 drag, 0 lift, yet one single node on the engine is creating massive amounts of drag
    upload_2019-7-16_12-18-39.png
    upload_2019-7-16_12-18-54.png

    The engine is its own block, with no other connected triangles :/
    Beyond frustrating

    EDIT: Just going to write custom physics code at this point, no use keeping up this 2 year fight with the aero system.
     
    #5 Dummiesman, Jul 16, 2019
    Last edited: Jul 16, 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