Chaos Physics framedrops every 5 seconds or so

Hi,

I’m using Chaos GCs that get disabled with a killing field, but even when all GC objects are killed there’s still processing going on. It seems that the Chaos Engine End Frame cycle keeps building up after more destruction without scaling down after a while of inactivity.

This causes severe framedrops that seem to “pulsate”, in the sense that it drops pretty much half of the fps every 5 seconds before returning to normal. Anyone else experiencing this?

everyone.
Chaos as a whole is still 50 to 70% worse than PhysX.

Fine tune your sleep values to make things somewhat better, still 50 to 70% worse off than UE4.

Totally experiencing this myself.

Does anyone know if Epic has said anything about future improvements or mention work on chaos destruction to be a priority at all?

My game definitely needs destruction to fulfil its potential, but ever since I switch it over from UE4 to 5, I haven’t been able to keep that feature… which is super frustrating (I shouldn’t have been so eager to move to UE5).

Make your own destruction system and do a custom build with PhysX.

The chaos “downgrade” is going to be permanent, and they aren’t really interested in addressing it (like 90% of engine bugs?) since “it works for fortnite”.

You can cut up a mesh procedurally at runtime. I suggest using that method to generate chunks on the fly.

But also, you should create your own geometry collection system to swap out meshes into collections of bits which you author in a DCC.

With physX sleep values on chunks do take effect, without robbing you of FPS.

The reason the FPS pulsate seems to be the fact that the objects pulsate with chaos.
Instead of reaching a position and turning physics off, the physics are always calculating while objects keep dipping into the floor over time until they are pushed back out.
This causes an endless loop, since the system appears to be unable to disable physics when the object reaches the supposedly final position.
Tuning up the sleep values helps somewaht, but the core of the problem is Chaos and objects which keep on drifting - this is probably due to bad math, or bad variables with low point precision (using floats instead of double maybe).

Yeah, that’s what I’ve resorted to; been testing out different ways of doing it. Appreciate the response; that is some helpful feedback and that makes sense.

It is definitely an unfortunate reality (The chaos “downgrade” is going to be permanent, and they aren’t really interested in addressing it (like 90% of engine bugs?) since “it works for fortnite”.) that I feel like I already had to deal with when implementing vehicle AI. Had to do that one from scratch, because of the same reason.

Nonetheless, I’m glad Epic open the engine up to everyone and that it isn’t Unity right now :slight_smile: . Thanks again!

Dont worry, the backlash unity will get is going to set them straight.
And possibly also set straight other game engines by example…

So I totally realized :man_facepalming: the source of the FPS drop, at least for my project was the navmesh. After removing it, the performance issue went away. I didn’t realize that GeometryCollections have the “Can Ever Affect Navigation” flag, so the drop in FPS is the navmesh recalculating as the pieces land on the navmesh.

Unchecking that setting took that pulsating away and now there is “reasonable” performance for the amount of pieces that I was working with.

I’d guess this is the same case for the OP…

My tests don’t include a nav mesh so thats not it.

Howerver I’m curious as to numbers you are working with/engine version etc.

I simply stopped using chaos alltogether after they said “this is final” and the unit testing showed a cost incease of over 70%.
At that point I just pulled source and built a custom .27 with an updated physx.

I’m currently in 5.1 and was playing with a very simple low poly mesh (670 poly) that only had 34 fractures (only two levels; 0 and 1). My testing was two or three of them falling on top of each other to break apart. Here’s an image:

The performance side definitely isn’t my only issue with Chaos; with walls or buildings I can’t seem to get the geometries to break apart in a “piece by piece” fashion, rather than them all tumbling down at the same time (think shooting a dirt wall - would take lots of hits to crumble it down, rather than it all breaking apart with a single impact).

Perhaps I’m missing something but no matter how I change the settings using internal strain, clustering, damage propagation, etc. - I can’t get it to function the way I need it to. In UE4, it was very easy to make it work the way I needed. I can sort of fake the result by using anchor fields in the frame of the structure or setting specific pieces to be anchored, but the performance does seem to be too good this way (I’m sure in this instance, the pieces have broken and are being held together through physics collisions with the anchored pieces).

I definitely wish I had your skillset to customize the engine because that method makes the most sense to me in this circumstance, but I wouldn’t know where to even begin.

I work on the assumption that if I can do it, then anyone else can.

I suggest you figure out how to pull the source and build from it since that’s the hardest hurdle.

Re the rest, well, its definitely easier having 20+ years of experience with coding tons of different languages and knowing OOP.

Unreal does things wierd (probably because its too many cooks within a single kitchen), so 90% of the time you end up wondering wtf you are reading and having to look it up anyway…

So yea, I know what to look for, but also… yea, I end up having to look most of it up anyway;
I don’t really think you’d have too much difficulty considering just that.
Look ut up, and figure it out just like I would.

Obviously if you have 0 idea of what OOP code, classes with inheritances, function signiatures etc are supposed to look like, well, thats a bit of a hurdle I suppose.
However as I said, unreal function signiatures are almost unique, so it probably doesn’t change too, too much… (just for the love of everything don’t go assuming all coding is that bad/complex? Its really not, its unreal wanting to be different).

Regarding the rest and particularly destruction, I don’t really know.

I avoid engine specific stuff (like destruction) as the plague it is, since it compromises or locks down a project into a specific engine.

Its much better to build up your own custom classes with your own custom geometry collections to be able to migrate to whatever else with some minimal re-coding.
So, in short, I use my own destruction system and meshes that work however I interface them to work.

With some time, patience, practice and knowledge you could probably extend and modify the engine’s destruction classes to do similar things without having to do it from scratch like I did in the past.
Easier said than done, definitely. But generally if there is a will there is a way…

Alternatively I would try and bug the creators of the destruction system for more info and tutorials on how they intended it to work… i dont thibk what you are asking for is anything out of this world to be honest.

1 Like

Btw, that’s how geometry collections work. You hit it, it splinters up and releases parts.

If you want it to work on a piece by piece basis youd likely have to code something up specific for it, instead of applying damage to it…

You could for instance get the trace to return the index of the part it hit, and remove the part from the geometry collection, moving it to its own mesh with simulate physics turned on.

If at any point you apply damage though, the collection will toggle and release its components.

So maybe you are looking for something other than the geometry collection you are currently using. That part I wouldnt know (since I dont really use engine stuff).

1 Like

That makes sense and I figured that’s what it would require. I’ll definitely attempt that method and hopefully can get it working.

I greatly appreciate all the advice! This is definitely my first released game and it has been the catalyst for me learning C++, so I’m not totally in the dark conceptually, but obviously translating concepts into code is a different story.

Nonetheless, I definitely need destruction so I have to figure it out. Thanks again!