Welcome, Guest

Author Topic: How will SPH work with collisions.  (Read 3457 times)

tepidbread

  • ***
  • Posts: 22
How will SPH work with collisions.
« on: September 09, 2015, 02:59:19 PM »
This question is mainly targeted towards Greenleaf, but feel free to answer if you know anything.

For example... If a pluto sized object (of simmilar mass) were to hit Earth at 40km/sec would the Earth get momentarily bent out of shape then collapse onto itself. Surely a force of that magnitude would tear the Earth asunder based on the math I did.

Or would Pluto simply break apart before hitting the earth. And the Earth would remain as a perfect sphere as it absorbed the high velocity particles from Pluto?

Or would It be a combination of the two. Would both Earth and Pluto break apart (or warp) before the impact. Then merge together quite violently.

Would anything like this actually be modeled in the end game?

Retsof

  • ****
  • Posts: 38
Re: How will SPH work with collisions.
« Reply #1 on: September 09, 2015, 04:47:40 PM »
It'd probably look something like this.
https://www.youtube.com/watch?v=9w1din9uV68

tepidbread

  • ***
  • Posts: 22
Re: How will SPH work with collisions.
« Reply #2 on: September 09, 2015, 08:54:19 PM »
It'd probably look something like this.
https://www.youtube.com/watch?v=9w1din9uV68
It seems like it would be... However, that is a lot of particles to simulate. For the actual finished game it may not be as realistic as that. The performance hit would be massive. I expect the devs to have to compromise realism for performance...

Retsof

  • ****
  • Posts: 38
Re: How will SPH work with collisions.
« Reply #3 on: September 09, 2015, 09:37:53 PM »
If I remember correctly from some other times it has been discussed, the plan is to keep SPH as something you can toggle, and bodies will stay a single object until SPH is necessary.

Greenleaf

  • Thomas Grønneløv
  • Development Team
  • *****
  • Posts: 211
Re: How will SPH work with collisions.
« Reply #4 on: September 10, 2015, 02:16:04 AM »

Quickly answering your actual question.
Yes, you would see Pluto bore into Earth leaving an indentation which then collapses in on itself and probably forms an ejection jet forming a drop flying away. Like a drop of milk into your coffee.
I have made simulations like that often enough, but apparently I never placed a video online, so I can't give a link here and now.

A thousand planets are currently modeled as a thousand point masses. They carry position, velocity and mass, and even that can be heavy to calculate at times. With sph, we cannot model every planet as a large collection of particles, since it would be too much. The plan is therefore to let planets be point masses, as now, until the point where they are either colliding with something else or when they are experiencing a very strong gravity gradient (Roche limit, black hole etc).


At that time, they would transform from one point mass, rendered as one sphere, into a large collection of particles, looking mostly like the previous rendered sphere. After an "event", when things settle down again, they would then transform back to one point mass and one rendered sphere.


This transition from one representation to another is the major challenge in this.
This is an early attempt of making a low resolution collection of particles which look rather like the sphere representation.
https://www.youtube.com/watch?v=dajIf1BHq48


The particles get a color based on whether they are surface or not, and based on longitude and latitude. The change back from this... that is going to be rather more involved, though.


Another challenge is that not all objects are of comparable size. That means that if Pluto is 100 particles, earth needs 46.000 particles. That is quite a lot for interactive rates on an average pc. If you alternatively want to model the collapse of a cloud into a solar system and you want earth to in the end be one single particle, you would need about 250 thousand particles all in all, and anything small than one earth would not even be represented. I have tried looking into adaptive particle sizes for this, but that is another hard problem.










Retsof

  • ****
  • Posts: 38
Re: How will SPH work with collisions.
« Reply #5 on: September 10, 2015, 05:31:17 PM »
The particles get a color based on whether they are surface or not, and based on longitude and latitude. The change back from this... that is going to be rather more involved, though.
I wouldn't think the change back would need to be too complicated, since any collision big enough to require the larger body to SPH would liquefy it anyway.  Just change it back with the lava texture that is in use now.
EDIT:  Or do you mean that the calculating of the new body's properties/composition will be complicated.  ... I don't have a cheeky answer for that one.
EDIT2:  Ooor for non-planet-melting collisions, what if you keep a dummy of the planet with the current decal system, and switch back to that when appropriate?
« Last Edit: September 10, 2015, 06:01:52 PM by Retsof »