Jump to content

How will collisions in planet rings work?


Vortygont

Recommended Posts

Because for today in Dres ring are no collisions, I thought, how will they work in the future. There are so many oblects which must be uploaded while you fly in rings, and I think that uploading many data, like updating space rocks which is in craft's phys range right now, can cause perfomance decrease. Especially if in KSP2 will be gygantic protoplanet disks (I'm sure they will).  I believe that rocks, which is not predicted to crash in your craft, won't be complete game objects with collision mesh in some kind
I'm not unity game programer and my ideas can be wrong. I tried to visualise the concept of collision system for rings and how I understand this:
Collisionconceptphot.png

In VAB you had craft parameters like lenght, width, height, I made a box with them around my craft. I have attached to craft normal vector, which sets orientation of this box. I add vector of craft relative speed, which is relative to speed of ring in its part, where is craft now. Using this vector I create collision space by creating a section of the box perpendicular to the vector of relative velocity, and lengthening it backwards so that the craft is in collision space space, and forwards by the length optimal for the calculation at a given relative speed. Forward lenght can be formula from relative speed or lenght can be equal to  phys radius range. If rock enters collision space (like some of its mesh node enters this space or another method) you can make it an complete game object with collision mesh and physics and calculate interations with it
I tried to solve problem to get rid from data of objects, which won't obviously collide with craft, like objects backwards and on left and right of craft. If you have suggestions or experience in some tech stuff, you can point out my mistakes and/or make a suggestion how to improve collisions in planet rings

Link to comment
Share on other sites

14 hours ago, Strawberry said:

I assume that if youre going at a relative speed to where it cant calculate itll just use rock density to calculate the chance of you "colliding", and use that chance to dictate if your ship explodes or not

I see that is similar to my example, but it is not so exactly. There must be honest interactions with object, like if you see a rock and you dodge it, you won't crash in it, you can avoid rocks if you will maneuver correctly in the ring. And if you set a course to collide with certain rock, you will collide with it. If I understand right, problem with chance method is that you need spawn a rock properly to crash in ship, they mustn't appear from nowhere and you must see how rock fly and crash ship
I think that it will be good to set in rings relative small special "rock" phys radius around a ship, only in which rock physics will be enabled, rocks outside this space will be just textures with disabled physics. I tried to draft optimal geometry of this space, but maybe it will be easy to make just smaller sphere
 

14 hours ago, The Aziz said:

Deep dive into collisions, there's something that might interest you.

Thank you for sharing, but there are cases with part-surface and part-part cases. I think that rock collision system will be similar with part-part, but problem that in rings is huge amount of objects and game must do very many calculations in this case. So you can't store all ring rocks as separate game orbital objects

 

Edited by Vortygont
Edited answers
Link to comment
Share on other sites

we use a continuous collision detection algorithm. Instead of advancing the object forward in time and checking if its mesh intersects a collision mesh, we use the object’s current motion to predict if and when it will collide.

So check for objects on predicted path, if there's one, apply collision box.

Plus there's the whole physics LOD thing. No point in applying physics for a piece of rock that's 500 meters away if it's not going to be affected.

In short they're physicsless until something comes close enough.

Link to comment
Share on other sites

I think the simplest way to do this would be to simply check whether or not the vessel/probe/Kerbal/whatever is within the space that the entire ring occupies.  If so, collision.  If not, no collision.  Checking this way would eliminate the need to check for individual objects, which would really complicate the performance issues that we are seeing right now.  Make the ring one long, continuous object that you simply cannot pass through.

Link to comment
Share on other sites

1 hour ago, The Aziz said:

Meh, if a space between particles is big enough for a ship to squeeze through.

I don't disagree.  I'm just saying that at this point, with the performance issues, having the game calculate and track all those objects would be an FPS nightmare.  Easier for the time being to just treat the entire ring as 1 object and check for collision with it.

Link to comment
Share on other sites

What all objects? They can track only those that are on the path of the ship. And by the time the ring collision is a thing, the performance should be much better - in fact I bet it isn't there yet because of that. Same reason why trees and rocks on the surfaces have no collision yet.

Also, the scale is unknown here but... That doesn't look like a particularly difficult task to simulate with this level of density

C3ArYwk.png

If that stays of course, this is very old footage.

Edited by The Aziz
Link to comment
Share on other sites

If I where to guess, they will do no actual collision calculation with the rings, instead I think they will do some sort of a heat mechanic: if the ship is inside the ring it will heat and explode the ship based on the difference in speed and direction of the ship and the ring.

I think that this approach will better simulate reality because the ship is also interacting with the ring dust, not just the bigger rocks.

Link to comment
Share on other sites

1 hour ago, sumeee said:

I think that this approach will better simulate reality because the ship is also interacting with the ring dust, not just the bigger rocks.

I would like to add some interaction with ring dust too, because I like feeling and sound of pounding crumbs against your ship, like in this cinematic moment

https://youtu.be/STTTp9nDFOE?t=84

But instead heat, which can be reduced, damage from dust is not reversible, and it will be serious and game change mechanic, and new part characteristics would need to be added. But I like punding, there should be this sound

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...