Jump to content

This is why our physics engine is named HAVOK


ChinRey
 Share

You are about to reply to a thread that has been inactive for 2188 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I know they say it's named after the company that created it but that's what they want us to believe. It's the other way round, it has to be the other way round: The company was named after the phsyics engine they made. :P

Seriously, Here is my latest build, a set of easy-to-assemble landscape-with-pathway modules:

1550597843_OPQDirtPath01A_003700.png.0a9c85364e9547a7c9914388a7441aad.png

 

They are not quite as simple as they seem. These modules have to fit seamlessly together - it must even be possible to overlap them with no texture flicker and they also need to be able to fit seamlessly with a flat ground surface. There are no level surfaces anywhere, everything is sloped in various ways. That means some rather complex physics.

Yes, I could have used a simple analyzed physics model but  have my reputation to take care of: people and vehicles are supposed to touch the ground I make, not hover slightly above it.

So, unanalyzed physics it is, for a low profile mesh - exactly what HAVOK hates. And I have to keep the physics weight down. Download weight is less than 1.5 for each module, so physics weight equals land impact.

One of the obvious features is a heavily sloping "skirt" around the edges. Here is how one of them looks on the high LoD model when triangulated (brown is path, green is grass):

184271214_Skjermbilde(1511).thumb.png.375bac548e6584932be8aec628992d1e.png

Eight triangles. The two at the ends are because the corner at the bottom are slightly bevelled. Not even I am obsessed enough with perfect physics to keep such a minor detail - you can't get that kind of precision for a surface as heavily sloped as that anyway. So let's get rid of them:

2144071335_Skjermbilde(1512).thumb.png.88d9389d0648a97c1298c5f4264cd761.png

That brings us down to six triangles. But we don't need different faces for the physics model of course, let get rid of that too:

2124336404_Skjermbilde(1513).thumb.png.4419e2b4b8e03b88deaced677ee08eec.png

We get four triangles. But those triangles are very logn and narrow and HAVOK (or at least the physics wieght calculation formula) doesn't like that. We may end up loosing more than we gain this way.

The two vertices along the top are there because the skrit is attached to the sloped top surface. We can remove those:

386880648_Skjermbilde(1514).thumb.png.3117e3cf266a1b0d0ad84f7de7c30aee.png

That gives us a nice two triangle physics for that skirt. But it also produces a slight gap along the top and HAVOK (or the phsyics weight formula) doesn't like that either...

So, which of these four options gave the lowest physics weight? You're not gonna believe this. The answer is...

No wait, let's see if anybody can guess!

Edited by ChinRey
Typos
  • Like 2
Link to comment
Share on other sites

7 minutes ago, Luna Bliss said:

I have no idea.

I just know you are an optimizing genius, ChinRey :)

/me blushes.

I think I better give the right answer and save everybody from suggesting the other three wrong ones.

Each module was different. Love wasn't completely wrong actually, one of the module preferred option 1 but most worked best with one of the others. Which one varied though, I think I ended up with two of each.

The differences weren't exactly subtle either, one of the modules had its LI skyrocketting from 1 to 4 when I tried option 4, another one dropped from 6 to 2 LI.

  • Like 1
  • Haha 1
Link to comment
Share on other sites

2 minutes ago, ChinRey said:

/me blushes.

I think I better give the right answer and save everybody from suggesting the other three wrong ones.

Each module was different. Love wasn't completely wrong actually, one of the module preferred option 1 but most worked best with one of the others. Which one varied though, I think I ended up with two of each.

The differences weren't exactly subtle either, one of the modules had its LI skyrocketting from 1 to 4 when I tried option 4, another one dropped from 6 to 2 LI.

I knew it was a trick question!

Link to comment
Share on other sites

1 minute ago, Love Zhaoying said:

I knew it was a trick question!

Awww, how could you tell? :P

Maybe I should mention there were subtle differences depending on whether I kept the smooth normals from the cisual models or flattened them too. And even how they were triangulated - before export, at export or at import - made a difference too. Those differences were very minor though but still with no noticeable pattern

  • Like 1
Link to comment
Share on other sites

Just now, Love Zhaoying said:

So, what’s the total LI of each piece?

I couldn't get the crossroads and T-Junction modules down lower than 2. The others are 1 each.

The unpredictability of triangle physics weight is rather frustrating though, especially since the only way to check is to upload and see. This wasn't nearly as bad as another modular road system I once made though. I once had to try more than 30 different physics shapes before I found one that worked.

  • Thanks 2
Link to comment
Share on other sites

6 minutes ago, Love Zhaoying said:

So pathfinding works on it?

I haven't tested that but I can't see why it shouldn't. It's just a walkable mesh after all. You'll probably need to do some fancy scripting if you want a pathfinder to stay on the path and not step on the grass though.

Edited by ChinRey
Link to comment
Share on other sites

5 minutes ago, Love Zhaoying said:

Darn! I thought that was the point

Hmmmm, now you got me interested. I'm working on another road system too, one without the surround ground. I'm not sure if it's possible at all to define a pathfinding character to always stay on top of a specific set of objects but if it is, that one will do.

But of course, you can always define a list of patrol points that'll keep it on track.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 9/28/2018 at 3:30 PM, ChinRey said:

I couldn't get the crossroads and T-Junction modules down lower than 2. The others are 1 each.

The unpredictability of triangle physics weight is rather frustrating though, especially since the only way to check is to upload and see. This wasn't nearly as bad as another modular road system I once made though. I once had to try more than 30 different physics shapes before I found one that worked.

I'm working on fixing this, honest!!

You will "soon" be able to see the 3 different physics costs in the uploader.

BTW the reason the logical argument of "fewer is better" fail is that of the "long thin" adjustment factor. when you merged the 8 to the 6, for example, the result was that two of the triangles became longer along one axis, this affects the multiplier used to penalise them. Naturally, this will vary slightly with each of the meshes. 

I'm pretty sure the phase of the moon and the colour of your underwear have an effect too but I've not yet proven it.

Edited by Beq Janus
  • Like 5
  • Thanks 1
Link to comment
Share on other sites

On 10/2/2018 at 9:56 PM, Beq Janus said:

I'm working on fixing this, honest!!

You will "soon" be able to see the 3 different physics costs in the uploader.

A step closer. Please note, this is me playing with information. The numbers you see are real, but as I say at the end how I end up showing them depends on a number of discussions. 

That said, please read and comment, here or on the blog, or both. 

http://beqsother.blogspot.com/2018/10/shedding-light-on-mesh-uploading.html

  • Like 2
Link to comment
Share on other sites

There's a critical angle at which objects will not smoothly transition from sliding on one surface to sliding on another. If you have a convex break angle of more than 18 degrees between two plane sections, vehicles will "catch" rather than slide. Known bug; Rachel Stardust and I spent some time testing this. (Can't find the JIRA reference right now, but it's in there.) A bridge in south Heterocera, and two hills on Linden Roads in southwest Heterocera, have 20 degree break angles and must be driven over very slowly.

Not a problem for avatars, because they don't roll or pitch. If a vehicle can roll over those path sections, stay below 18 degrees of convex break angle.

  • Thanks 1
Link to comment
Share on other sites

Wow this was a great post, I too have been working on a similar modular mesh concept for my sim, I had been planning on doing much of it with zero physics and using the ground below for that, and allow a slight offset to be nice in that it seems the persons feet are sinking into the grass, perhaps also putting in physics on the path in those, and also a copy version which actually has a physics shape to use in other areas ground isnt actually there.  Im definitely going modular with a lot of things, good stuff on many accounts. 

Though I WISH we had mesh instancing (or is there?)  The blender export even has the little checkbox you can tic for .dae, but I read SL just walks right past that mo ? I would think sharing object data among many copies of a mesh would increase performance no?  Is there some sort of proprietary similar thing already happening in sl?

Whens the last time the havok stuff had an enema? ?

 

Link to comment
Share on other sites

10 hours ago, Whirly Fizzle said:

Yes, although I think there's another related one.  Once you have enough physics weight to get past that problem, you get different behavior. It makes sense, though. If you hit a vertical wall, you'd bounce back or go sideways. If you hit an almost vertical wall, the same thing would happen. At some angle, you go from bouncing or going sideways to moving smoothly upward. That angle is lower than you might expect in SL, about 18 degrees. So if you build a ramp steeper than that, make it in two segments of increasing slope. But now, of course, it's concave, so a convex hull of it might smooth out the transition section, which you don't want.

By the way, Beq Janus is working on making the mesh upload preview window in Firestorm both more accurate and bigger, so you can see stuff like this.

Edited by animats
  • Thanks 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2188 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...