Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Artaani · May 20, 2017 at 02:45 PM · physicscolliderconstructorsandboxcombined mesh

How to implement mesh collider decomposition for sandbox constructor like in Empyrion, Space Engineers, StarMade (detailed clarification inside)

Hello. Here is a complex question about algorithm. I do not ask for code solution. Only for some information about theory and a link where solution is described.

I will try to explain the question as better as possible.

First of all, check these games:

  • Empyrion - Galactic Survival

  • Space Engineers

  • StarMade

  • Interstellar Rift

  • Planet Nomads

  • Corneroids

  • Scrap mechanics

All of these games have shared feature: You can build a big, even huge moving vehicles using a blocks (like in Minecraft).

I am working on the same feature. I am already aware about "Combine Mesh" technique and know how to use it. However, I am not sure what to do with colliders for huge moving spaceships.

Many of us know "how to create Minecraft in Unity". This theme was very popular some time ago and we can found a lot of tutorials, even on YouTube about develop a Minecraft.

But Minecraft is simple, because its world is static, so you can use non-convex mesh collider to define collider of the terrain.

But if we are going to create a spaceship, situation is much harder, because ship is rigidbody, and as we know, non-convex mesh colliders is not allowed to use on non-kinematic rigidbody,

Therefore, spaceship should consists from many convex colliders which should be parented into the main object.

But look at the ships which built in the Space Engineers or Star Made, they are huge. It may consist up to millions blocks. Obviously, we can't just parent million of box colliders to rigidbody. it will drop FPS to 0.1 as soon as this space ship will begin to move.

It means that many blocks should be combined in the single mesh collider, but algorithm should combine only those block, which will result convex mesh collider.

So this is a main question. How to do this? I am tried to invent my own algorithm, and I designed several variants, however, I feels like I am tried to reinvent a wheel or bicycle.

alt text Example of different results. So which algorithm is the most reliable and always will result 100% optimized result?

Because algorithm should be very very optimized, and as I listed above, there is already exist at least 7 other games which already have this feature. It means what all of those games most likely found a solution somewhere and just implemented it by instruction.

So this is my question. Maybe someone know about this solution and where I can find it?

I am tried to search for it, it was not too successful, however seems like it called "mesh decomposition". I found a few documents about it, but it is not related to Unity and very hard to understand, besides that, this algorithm more designed to work on any mesh, so it is not very fast. There is some solution in the Asset Store, for example this one, and I am already tested it for "block based" mesh, and it turned out too slow and result is incorrect. So approach should be different.

Also I had a thought - maybe those games somehow optimized own engine specially for this task? But fortunately, Empyrion is made on Unity, so it should be possible on Unity. Just look at those ships, they are huge. And this is made on Unity.

alt text

However, if we will look at StarMade, ships size will be even bigger. For example look at this. Imagine amount of box colliders for such construction. How this even possible?

895867157-preview-20170403093818-1.jpg (438.0 kB)
2017-05-20-17-42-15.png (185.7 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

111 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Tree Colliders Not Working With Physics.CheckSphere / Capsule 4 Answers

How do I find whether a point exists within the volume of a (trigger) collider? 0 Answers

Help with floaty rigidbody physics 1 Answer

Passing values from Shader to C# script 0 Answers

overlapsphere to destroy NPCs on exit 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges