Hello players,
The newest update is currently in testing, and will come very soon.
Meanwhile I did some proof of concept. While I always knew that spherical planets in a full 3d block world give problems, I've never actually tried to do it. Until now.
don't get excited, this will probably not come in this way. It's a showcase I implemented. Maybe I'll add it as a gimmick one day, but I doubt it will be worth much.
There are 2 basic ways used in games to project a plane or a cube to a sphere.
The first one is simple spherical coordinates. You may have seen this on youtube on some other engines maybe. It looks great, but has one deciding disadvantage: the planet is not full 3D. It's just a simple visual effect. The planet surface is a plane that is warped (kind of like very wide lense photo cameras) by converting all the points into spherical coordinates and make the ends repeat (so it loops). But a plane has as we all know only one up direction, and while you could have the visual effect of it even rotating, other objects would have to be warped in the same way as the planed surface. It looks like it's working, but without a real 3d space, there will be logic problems with every other object not in that planet's context.
The other one is what I used. It allows the planet to maintain its logic as a full 3d objects. However it also warps space: What is done is that the object is "spherified" from a cube shaped planet:
You can see where the problems with that would come in: What to do with the gaps of 90 degrees? The spherification makes some strange shapes on the seams. The generation would have to be adapted on the seams. Other objects around it would either be normal which would be strange on a round surface (making it bigger would not really solve the problem), and the physics performance would be crippling, or it would warp with the planet, which would magnify the blocks the farther away the ship is (in that sector).
Now some general problems with spherical objects: Performance of physics. Collision with a non box object is as you can imagine way harder. It's not only harder is several magnitudes more performance taking. While there is a way around by warping the object itself into the context and then do a normal collision, the work, very likely glitches, and bugs of doing so is just not worth it. Every aspect would have to be warped too: lasers, missiles and anything else would all be strange.
Another general problem is that more than one standard is used to do things. Not only can that very confusing for the player, the core has to be always implemented for both cases.
The nature of warping also magnifies blocks the farther they are from the zero surface. Adding more equally sized blocks per layer would kill performance as it would destroy the logic of the grid. Same problem with ships flying away or landing. Either the blocks of the ship grow as the ship flies away, or the blocks of the planet could have a different size as the blocks of the ship, and that not only is crippling for physics, and other calculations, it would also look and feel very strange.
My solution will be a spherical two sided planet. Like putting another one on the bottom of the current planets, and elevating the middle a little. OR, a cube planet kind of like in the picture, but tugged in. The problem is that it's impossible to determine what direction the gravity should go, if for example a corner is mined out, and the player is standing right in the intersection of the polyhedrons of the cube.
I hope I was able to explain myself. It's not that I wouldn't want to have spherical planets, but I don't want to destroy the simplicity of the block system for it.
Thanks for playing StarMade,
- schema
The newest update is currently in testing, and will come very soon.
Meanwhile I did some proof of concept. While I always knew that spherical planets in a full 3d block world give problems, I've never actually tried to do it. Until now.
don't get excited, this will probably not come in this way. It's a showcase I implemented. Maybe I'll add it as a gimmick one day, but I doubt it will be worth much.
There are 2 basic ways used in games to project a plane or a cube to a sphere.
The first one is simple spherical coordinates. You may have seen this on youtube on some other engines maybe. It looks great, but has one deciding disadvantage: the planet is not full 3D. It's just a simple visual effect. The planet surface is a plane that is warped (kind of like very wide lense photo cameras) by converting all the points into spherical coordinates and make the ends repeat (so it loops). But a plane has as we all know only one up direction, and while you could have the visual effect of it even rotating, other objects would have to be warped in the same way as the planed surface. It looks like it's working, but without a real 3d space, there will be logic problems with every other object not in that planet's context.
The other one is what I used. It allows the planet to maintain its logic as a full 3d objects. However it also warps space: What is done is that the object is "spherified" from a cube shaped planet:
You can see where the problems with that would come in: What to do with the gaps of 90 degrees? The spherification makes some strange shapes on the seams. The generation would have to be adapted on the seams. Other objects around it would either be normal which would be strange on a round surface (making it bigger would not really solve the problem), and the physics performance would be crippling, or it would warp with the planet, which would magnify the blocks the farther away the ship is (in that sector).
Now some general problems with spherical objects: Performance of physics. Collision with a non box object is as you can imagine way harder. It's not only harder is several magnitudes more performance taking. While there is a way around by warping the object itself into the context and then do a normal collision, the work, very likely glitches, and bugs of doing so is just not worth it. Every aspect would have to be warped too: lasers, missiles and anything else would all be strange.
Another general problem is that more than one standard is used to do things. Not only can that very confusing for the player, the core has to be always implemented for both cases.
The nature of warping also magnifies blocks the farther they are from the zero surface. Adding more equally sized blocks per layer would kill performance as it would destroy the logic of the grid. Same problem with ships flying away or landing. Either the blocks of the ship grow as the ship flies away, or the blocks of the planet could have a different size as the blocks of the ship, and that not only is crippling for physics, and other calculations, it would also look and feel very strange.
My solution will be a spherical two sided planet. Like putting another one on the bottom of the current planets, and elevating the middle a little. OR, a cube planet kind of like in the picture, but tugged in. The problem is that it's impossible to determine what direction the gravity should go, if for example a corner is mined out, and the player is standing right in the intersection of the polyhedrons of the cube.
I hope I was able to explain myself. It's not that I wouldn't want to have spherical planets, but I don't want to destroy the simplicity of the block system for it.
Thanks for playing StarMade,
- schema