Jump to content

Enable Collision on Terrain Scatter


Recommended Posts

4 hours ago, r4pt0r said:

snip

Well, as I understand it the physics system and rendering system are completely different things. Often, games will have collision mashes that only match the general shape of the rendered mesh to simplify the physics calculations (I know that a few parts in KSP are like this). So, if you were to use their physical model as their collision mesh, you have to have the physics determine if any part on your vessel is colliding with any part of the terrain scatter. It's usually much cheaper just to put a simple bounding box around them. Of course, the KSC seems to have a pretty elaborate collision mesh and I've never noticed any lag around it, so this may not actually be too much of an issue.

EDIT:

35 minutes ago, Waxing_Kibbous said:

Just a guess, but an instancing + LOD type system could do this pretty cheaply- question is does Unity support such things? I would assume so, it's relatively old tech.

Yeah, I'd imagine that you could simply disable collision calculation on terrain scatters that are X distance away.

Edited by Vaporo
Link to comment
Share on other sites

13 hours ago, Vaporo said:

Yeah, I'd imagine that you could simply disable collision calculation on terrain scatters that are X distance away.

The problem I see with this is...

However big the distance there is a chance that a ship will explode or break up and parts get scattered in all directions to quite large distances in some cases. 

If one of those parts hits a 'solid' piece of scatter then it bounces off or gets destroyed, no problem.

If it lands inside a 'non-solid' piece of scatter it will sit there, as it does now, with no problem until that part, or another that is close enough, is switched to and that piece of scatter becomes 'solid'.  Then you have a problem, there is a part (potentiality a crewed part) trapped inside a solid collision mesh that can't be moved out and that may,  because of clipping issues, cause the game to glitch out.

I'm no programmer, but these are the kind of 'hidden issues' that if missed or,not addressed can be anything from an annoying/amusing bug to a real game breaking crash monster.  And I guess from a programmers perspective can be difficult to resolve, especially if system resources are an issue.

A pity, as I would love to see persistent collidable scatter, but it may not be as simple to implement as it may seem.

Link to comment
Share on other sites

There's these cool things called "Quad-Trees". Essentially, it would only check where the parts are and only check for collisions inside the same grid space they are. This means that collisions would probably happen very fast, with little to no chance of lag (if it's implemented properly)

Link to comment
Share on other sites

For those wondering, the WIP was taken off the feature because the Devs decided they didn't want to go back over it, and that it was alright where it stood. AFAIK there are no plans for them to go back over them, but who knows, maybe with enough support we can convince them. :) 

Link to comment
Share on other sites

Terrain scatter is procedurally generated but you could easily just make the seed a hardcoded value for each planet.

Also, I don't want my 600 part plane to break up and explode gloriously at 100 m/s just because there was a little tiny cactus in the way of my landing.

Link to comment
Share on other sites

2 hours ago, Vaporo said:

Well, you could just enable terrain scatter collisions if debris gets close as well. Just calculate for each vessel (including debris) which terrain scatters to enable collision for.

Yes you probably could, but it would still mean checking which objects are in range for each piece of debris.

I'm not trying to be negative, so I'm sorry if it comes across that way.  I just think it's important not to get hopes and expectations up too far.  Even apparently simple solutions may not be that easy to implement in practice, and can have a knock on effect, in terms of performance and bugs etc, if not done carefully.

Link to comment
Share on other sites

  • 1 month later...
On 12/6/2015 at 0:47 PM, longbyte1 said:

Terrain scatter is procedurally generated but you could easily just make the seed a hardcoded value for each planet.

Also, I don't want my 600 part plane to break up and explode gloriously at 100 m/s just because there was a little tiny cactus in the way of my landing.

There was a thread somewhere that had this very argument in it. it all depends on how fast the vessel is moving. there is a sweet spot where the cactus would be destroyed and the plane would be damaged, but the solution is to have the scatter removed, and remove it from the persistant.sfs file.

Link to comment
Share on other sites

Many simulator creates trees, rocks and other obstacles procedurally. And, yes, these obstacles have collision mess too. And it would make the landing, taking off and rover driving more challenging - and I play for challenges. So, I support the idea, although, I won't give not high priority for implementation - there are many more annoying thing in this game.

Link to comment
Share on other sites

10 hours ago, AbacusWizard said:

You know what would be the best part about persistent, tangible terrain scatter?

 

Even better than acting as obstacles for landers and rovers?

 

We could build on them! I want to build a base on Pol using the huge spiky rocks as pillars!

Woah. The possibilities... (MIND BLOWN :0.0:)

Link to comment
Share on other sites

More potential awesomeness:

• striking a heroic pose and planting a flag at the top of a Pol-spike

• using boulders as pylons to build an elevated track

• cactus slalom-racing in a desert rocket-car

• treehouses

Edited by AbacusWizard
Link to comment
Share on other sites

6 hours ago, Thomas P. said:

*cracks knuckles*

Let me clarify some things: Terrain Scatters in KSP are procedural, not random. That means that the positions are not hardcoded, but the same in every savegame you start, unless you edit the PQS Tree of the respective Body. Collisions on Terrain Scatters are really easy to make, and they are far from laggy (Kerbin's surface uses Millions of Colliders, some Terrain Scatters are cake), and I already implemented the collisions, together with Science experiments when a Kerbal is within the range of a Scatter object, in Kopernicus. So it's just the devs, who have to decide to implement that particular feature - I would happily donate my code :D

  Hide contents

fitL0nL.png

Ej8YZm3.png

Xyut2Xs.png

 

 

You, sir, deserve a medal.

Link to comment
Share on other sites

@Thomas P.  That would be a total game changer.  Properly impressive.  Only problem now is that terrible feeling you get when you can't get something, not because it's impossible, but just because it hasn't been done yet!  I was happier before, when I just thought it was "really difficult"! :(

Edited by XrayLima
Speeling....
Link to comment
Share on other sites

I think i would personally prefer clouds or other visual enhancements that do not affect gameplay, but having to *SCREEEEEEEE* *DODGE* when you encounter terrain scatter in your rover sounds like an extremely entertaining addition to gameplay.

Link to comment
Share on other sites

@SQUAD Could we have terrain scatter collision detection pretty please? This was already long overdue when this thread was created 1.5 years ago, so if you could put it on the list for 1.1.1 or 1.1.2 it'd be much appreciated! (if you're short on hands/time, get @Thomas P. to work his magic ;))

Edited by Yakuzi
links are the bane to my existence
Link to comment
Share on other sites

8 hours ago, Thomas P. said:

*cracks knuckles*

Let me clarify some things: Terrain Scatters in KSP are procedural, not random. That means that the positions are not hardcoded, but the same in every savegame you start, unless you edit the PQS Tree of the respective Body. Collisions on Terrain Scatters are really easy to make, and they are far from laggy (Kerbin's surface uses Millions of Colliders, some Terrain Scatters are cake), and I already implemented the collisions, together with Science experiments when a Kerbal is within the range of a Scatter object, in Kopernicus. So it's just the devs, who have to decide to implement that particular feature - I would happily donate my code :D

Is this just on your build, because I am running a Kopernicus mod right now, and haven't noticed interaction, does it need to be added world by world in their cfgs?

Link to comment
Share on other sites

20 hours ago, Thomas P. said:

You have to make a custom config, Kopernicus doesn't change anything on it's own.

I checked out he examples on github, and there was not one for adding this functionality. Would it be systemic, or does it need to apply to specific scatters by world?

Link to comment
Share on other sites

22 hours ago, Thomas P. said:

You have to make a custom config, Kopernicus doesn't change anything on it's own.

Currently working on my big 2.0 update for OPM and this is going to be a(n optional) feature for the OPM planets and moons. So you better look out when driving/landing on Slate, Hale, Plock, etc.

Edited by CaptRobau
Link to comment
Share on other sites

5 minutes ago, CaptRobau said:

Currently working on my big 2.0 update for OPM and this is going to be a(n optional) feature for the OPM planets and moons. So you better look out when driving/landing on Slate, Hale, Plock, etc.

Awesome. Love the mod, BTW.

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...