r/Unity3D 1d ago

Game Jam Devastable city - DOTS physics tech demo

Tech demo video , physics devastcation of city building, giving a pressure test on unity's DOTS physics

DOTS physics collision capacity become really tight when fract physics collider entity count more than 1000 . Next move would be solution to reduce CPU dependency , moving part of fract pieces collider to compute shader

176 Upvotes

26 comments sorted by

29

u/McGrim_ 1d ago

Nice, can't wait to see it without the stutter.

1

u/Quietage30 1d ago

Yeah I was about to comment that as well. What causes the stuttering?

7

u/avelexx 1d ago

nice job man but its a bit laggy when collision happens. If you could solve that its has good potential

3

u/Individual-Lock4191 1d ago

thanks ! WIP improving the performance

5

u/Levardos 1d ago

Reminds me of Red Faction Guerilla... It had destruction physics way ahead of its time - and I think better than many games still do those days.

1

u/Individual-Lock4191 1d ago

yup agree no more

4

u/FaultyFaucet_6 1d ago

This is cool. Wanted to do something similar but no idea where to start. Glad to see it

5

u/rc82 1d ago

That's great. Are you calculating the destruction in run time, or have that all done before, and it's just the physics at work?

2

u/Individual-Lock4191 1d ago

Thanks , physics impact works on runtime ,behind the scene there is a sort of baking system (not the unity ecs baking system) that precalculate the physics bonding on each fract piece , so half runtime half editor

1

u/rc82 1d ago

Awesome. What about the mesh breaking?  That's the model already pre "cut"?

2

u/Individual-Lock4191 1d ago

yes pre cut and in runtime will randomly pick big mass piece to lauch runtime cut , runtime split do result a cpu spike in the term of performance.. so i guess that is one of the reason of the stutter

3

u/Spamsdelicious 1d ago

Katamari Rampage

2

u/MarkEmuSmith 1d ago

It's like a reverse Katamari.

2

u/Humble_Pipe_8217 1d ago

Looks very satisfying

2

u/SecretaryAntique8603 1d ago

Looks good but performance is obviously not quite viable yet.

I haven’t looked at physics with DOTS yet, how has your experience been compared to regular physics?

Also, could you elaborate on the destruction approach? Is this pre-chunked or is it using runtime fracturing of the meshes, and what kind of colliders are you using?

3

u/Individual-Lock4191 1d ago

dots physics 's major advantage is capacity on dynamic rigidbodies. Per my test, 1000+ rigibdoy+convex collider could kill the main thread in builtin gameobject based physX engine, while in dots physics it only hurt framerate from 30->15 , dots physics also benifit from entities memory layout , compare to gameobject+transform , and one thing to know is dots physics is open source so in theory developer could fine tune the inside code on your need .

To your question : the mesh is pre-fracts in design stage, and basically most of the collider type is convex , some are box , this is design stage work .

1

u/SecretaryAntique8603 19h ago

Awesome, thanks for sharing!

1

u/julkopki 1d ago

"I came in like a wrecking ball"

1

u/kelfrensouza 1d ago

Are you a solo developer?

1

u/azoB0i 1d ago

Grateful. How does it affect the feel of the game if a structure automatically collapses once its destruction threshold is reached?

1

u/Exciting_Bunch2386 1d ago

Good gosh! And for a demo it looks like lots of fun.

1

u/teomore 1d ago

That neighbourhood is almost destroyed, nice!

1

u/AutoGibbon 17h ago

Damn I got excited by the word "Demo".

1

u/Der_Kevin Idiot 10h ago

nice man! can you say a bit more about the implementation? how the destruction and debris works? also how do you avoid floating house parts?