I am trying to make a game where players can create a ship out of blocks and sail it around. The problem is that unity no longer supports non-convex colliders with non-kinematic rigidbodies. I need a non-kinenmatic rigidbody to use some sort of collision system that allows the player to walk around inside the ship they built. Note that the ships players can build can potentially be made out of hundreds of blocks. Is there any effective way to create a new collision system for this type of purpose?
It looks like it will be more effective in terms of performace to generate navmesh instead of hundreds of colliders. But I would test performance with 1000 static colliders on target platforms to see if it meets the requirements. Generating navmesh from that constructor of yours will require a lot of work on programming side.
I don’t know if I would be able to use that approach as ships should be able to ram each other in the game.
I wonder how the game “From the Depths” did it…
For ships ramming each other you may use few other, simple colliders.
You can merge colliders into fewer bigger one. Don’t have to be single none-convex.
Some colliders approximisation.
You most likely will need mesh merging, for LOD.
If you consider as well buoyancy, there is far more involved, than you may initially anticipate. That may involve flood algorithms of some sort.
Then dealing with debris is another matter, if willing to implement them too.
And then, you want move around potentially wobbly ship like vesicles, for which orientation changes dynamically, while keeping moving character stability.
In the end, huge amount of challenges.
What if I were to use Unity 4.x Before the physics Update? What kind of features would I be missing and what bugs could I encounter?
First question is, why would you do that?
Because I am told you can use non-convex mesh colliders with non-kinematic rigidbodies which would make doing this much easier. Note that the ship combines the blocks it is made out of into one mesh then adds a mesh collider to it.
But then you ask
yet FTD is far beyond Unity 4.x.
Major thing you are going to miss Using 4.x, is detailed profiler.
And you are not going make cutting edge game, with older tech. Lot of information related to that Unity version, will be fading in discoverability, since many stuff will be related to latest editions of Unity. Then you will introduce more likely yourself lot of frustration, since stuff won’t work, as described on internet.
Due to game nature you are trying to make, dealing with none convex colliders, is far more complex, than cubes, or any other convex mesh.
I suggest drop it, and look for other optimal solutions.
Well I need the player to be able to walk around inside the ship, so a convex collider is not an option.
Can you explain why is not an option in your opinion?
Refer to the video to see what kind of game I am trying to develope:
When the ship is spawned into the world it causes extreme frame drops. I am trying to optimize the game by making the ship combine all the blocks into a single mesh as to increase performance while at the same time making the ship have a collider that comes in the shape of the hull.
EDIT: Is there a way to combine several primitive colliders into one giant collider with a rigidbody?
Yes,
Simply add game object with collider to Rigidbody as child.
Will using hundreds of collider child objects cause perfermance issues?
If you start running into issues, then
Thanks but I have one last question, how do I “Merge colliders into fewer bigger ones” using code?
Yes, you need do scripting.
But how, it is another matter, as topic is much wider, specially you don’t have just cubes.
I gave you some idea to look for, Greedy Meshing. Search on forum or outside.
This typically applies for meshes, but you can utilize it with meshes.
Rest is your task, as game designer, since it is game specific.
Some components like the cannons will not be merged with the rest of the ship. Only the parts like blocks will be merged.
Of course.
You need to find optimal solution.