'Box' planets

    Joined
    Aug 30, 2013
    Messages
    6
    Reaction score
    0
    Rather then focusing on circlular planets and such, box shaped planets where in each side has its own gravitational pull and at the center is a 6x6 (or so) core of Lava preventing someone from hitting directly in the center of the six gravity points and making the player bug out. as you get to the edge of one of the side you get pulled to the other side and the gravitational pull of that side becomes your active pull.
     
    Joined
    Jul 2, 2013
    Messages
    81
    Reaction score
    3
    However there are a number of issues to workout.

    The big problem is that the six gravity fields meet creating a number of transition planes. Image below:



    These transition planes are primarily what Schema has commented on as being the issue, since creating cube planets would be relatively easy. First problem Schema brought up was the corners of the planet. Essentially, he was worried about players being able to stand on the edge of the blocks. I have two fixes for this. First, is that you make the transition planes infinitely small so the player is always considered to be standing on a face. If that isn\'t doable my second fix is to basically make an executive decision about which way the gravity goes when there is uncertainty. Image below:



    The other issue he brought up I haven\'t been able to find a fix for. The problem is that the shift in gravity would be too jarring. On the surface this isn\'t so much a problem as the players will be able to see it coming and ready themselves accordingly. However caves aren\'t so friendly. Image below:



    If the player moves from point A to B through the cave they fall down a hole for a bit then get flipped 90 degrees at the transition plane and end up walking on cave floor. Pretty cool. Unfortunately, going the other direction is not so cool. Starting at B and moving towards A the floor suddenly becomes a wall after the gravity transition. The player gets their face smacked against the now wall and slides (falls) back into the previous gravity field. And this problem only gets worse the father down you go because the transition planes start getting really close to each other.

    If these problems can be overcome we might see cube planets in the game at some point. At the moment though, I\'ve got nothing. I\'d like to hear people\'s thoughts on the matter.
     
    Joined
    Aug 15, 2013
    Messages
    52
    Reaction score
    0
    • Legacy Citizen
    are actually one and the same; by measuring the player\'s position with only a single comparison per division plane, the program takes care of this automatically.

    Here\'s some fake code:



    if ( player.x > ab_division ) player.gravity_vector = vector_a;
    else player.gravity_vector = vector_b;


    Of course, the final vector would depend on six such checks, but the same concept is there: only check one side, and group points on the plane itself with the other side. This is common practice in certain types of programming comparisons.



    The gravity-jerk issue I still can\'t quite sort out a fix for. It can be mitigated somewhat by reducing gravity strength as you near the core, but something more elegant needs to happen to make it work as anything more than an experiment.
     
    Joined
    Aug 30, 2013
    Messages
    6
    Reaction score
    0
    I am glad to fuel some ideas :D. I remember testing the idea on my own a while back but I do not remember what I did to make it work. I do know it was buggy, hense why I mentioned the player bugging out at certain points, like in the center and what not. But it definitely can be done so that it works.
     
    Joined
    Jul 2, 2013
    Messages
    81
    Reaction score
    3
    The issues with planet cores. I didn\'t even bring that up because every style of planet has problems with it and so multiple solutions have already been brought up. It\'s to the point where I don\'t even think to mention it anymore.
     
    Joined
    Aug 15, 2013
    Messages
    52
    Reaction score
    0
    • Legacy Citizen
    core actually fixes that problem as well. If you do something like


    gravity_force = max(( block_count * distance_from_center ) - deadzone_radius, 0 )

    You\'ll end up with gravity scaling to zero at a distance of deadzone_radius from the center, and remaining at zero for that space, so any movement inside it will transition smoothly between divisions. It also has the effect of giving more gravity to planets that are larger (and, since I threw block_count in there, more massive).

    I\'d be all on board for cube planets if it weren\'t for those darned transition planes.
     
    Joined
    Jul 4, 2013
    Messages
    30
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    Personally, I\'m pretty happy with the current planetary system. Anything else just seems really awkward when broken down fundementally, though I can certainly understand why they\'d be cool. And I do agree. Round planets obviously won\'t happen, but square ones are certainly more feasible. Personally I\'d love for this to happen, but until a fix can actually be brought up for the gravity planes transition, I don\'t see the point in people bringing up a topic every ten minutes discussing the idea of round or square planets. If you like the thought of it, find a topic, post your thoughts, opinions and ideas. There\'s not really any point in cluttering the suggestions forum with tons of these topics.
     
    Joined
    Jul 5, 2013
    Messages
    372
    Reaction score
    0
    If you read the comments on schema\'s post about planets, people gave solution to that a few times; diagonal planes (as drawn by sagethe13th above). I could only add to that by saying that transition from 1 gravity side to other shouldn\'t be instant, but player would slowly turn to the new facing. This because schema said that the transition might be confusing to some players.
     
    Joined
    Jul 5, 2013
    Messages
    372
    Reaction score
    0
    That is not a problem, and it shouldn\'t be attempted to overcome. If you dig a hole down, it is a hole. You don\'t intend on being able to climb it up.
     
    Joined
    Jul 11, 2013
    Messages
    277
    Reaction score
    20
    • Purchased!
    • Legacy Citizen 4
    If only there was a reliable way to do a smooth transition of the player around the blocks, always keeping the player at a 90 degree angle towards the centre block wherever he may be on the planet.

    That could pretty much solve the issue of flat vs cube planets and pave way towards simple round planets.



    As for the core and transitions within the core - why not fill the core with lava and just make it so that it cannot be entered without obliterating any ship/player? Not being able to get in would surely solve most issues people could have with this and once the core is gone, there would be no planet there anymore- just free floating asteroids with no gravity. Well that\'s just my view on the subject ^^



    I\'m fine having a disc planet, it would be great to be able to have planets shaped like islands sticking out of water - irregular shaped, double sided islands, similar to this:
     

    Snk

    Joined
    Aug 30, 2013
    Messages
    1,186
    Reaction score
    155
    • Legacy Citizen
    • Top Forum Contributor
    I thought of a idea where you decrease the amount of planets, but make them much larger. Basically, they\'d consist of several hexagons about the size of our current planets, stuck together at an angle so they make a sphere.
     
    Joined
    Jul 2, 2013
    Messages
    81
    Reaction score
    3
    We are talking about cube planets in this thread. There is already a very active topic discussing spherical planets. If you want to post your idea over there I\'ll be happy to talk with you about it.

    Edit: Actually since this is a new approach you may be better off starting a new topic.
     
    Joined
    Jul 2, 2013
    Messages
    81
    Reaction score
    3
    Alright I\'ve put the various contributions posted in this topic together into a single model for how to do cube planets. Image below.



    Pretty much what I had before, only this time the transition planes are now transition fields. They don\'t look any bigger than they did before because the planet is just that large. So, let\'s take a closer look.



    For this example I\'ve reduced the planet down to a thin layer of blocks around the no gravity core, which is filled with lava. The transition fields are about four blocks wide, enough to cover the edge block and the next two blocks on either side.

    When the player passes through a transition field they gradually tilt until they are angled properly with respect to the next gravity field. The transition would have to happen the same no matter how close to or far away from the core the player is. From a technical standpoint I\'m not sure how this would be accomplished as it would require a completely local, that is to say player specific, shift in gravity. These kind of gravity mechanics are a little beyond my current understanding.

    There are also some advanced features I would like to see. Advanced features:

    Variable gravity based on mass. Image below.



    Removing gravity and the atmosphere when the planet is reduced to less than 1000 mass.



    Thanks to Sparkes, Alexander Prime, and anyone else who proposed ideas that appear in this topic even if I didn\'t remember who you were.
     
    Joined
    Aug 15, 2013
    Messages
    52
    Reaction score
    0
    • Legacy Citizen
    This is untested Java. It assumes a 2D world, but could be expanded into 3D without much work.


    private static final int G_HALF = 1, L_HALF = 2, G_QTER = 4, L_QTER = 8;

    public float[] getGravityVector( Entity ent ) {
    int sector = 0; // Bitfield integer
    int x = getLocalCoords( ent ).getX(),
    y = getLocalCoords( ent ).getY();

    if ( y > x + 2 ) sector = sector | G_HALF;
    if ( y < x - 2 ) sector = sector | L_HALF;
    if ( y > 2 - x ) sector = sector | G_QTER;
    if ( y < -2 - x ) sector = sector | L_QTER;

    switch ( sector ) {
    case 0: default: return new int[]{0,0}; // At center, no gravity
    case 1: return interpolate( new int[]{0, 1}, new int[]{ 1,0}, ip_factor );
    case 2: return interpolate( new int[]{0,-1}, new int[]{-1,0}, ip_factor );
    case 4: return interpolate( new int[]{0, 1}, new int[]{-1,0}, ip_factor );
    case 5: return new int[]{0,1};
    case 6: return new int[]{-1,0};
    case 8: return interpolate( new int[]{0,-1}, new int[]{1,0}, ip_factor );
    case 9: return new int[]{1, 0};
    case 10: return new int[]{0,-1};
    }
    }


    Something else has just come up while I was typing this, so I\'ll have to define interpolate() and ip_factor later.

    (Great, tags aren\'t working either. Have a pastebin.)
     
    Joined
    Aug 3, 2013
    Messages
    34
    Reaction score
    2
    • Purchased!
    • Legacy Citizen 9
    I\'m hoping the discs stay. All the conjecture is deafening.
     
    Joined
    Jun 20, 2013
    Messages
    94
    Reaction score
    0
    Hemispheres are the quickest way to deal with the disc-planet whining. They\'d require a few tweaks to the existing world generation and that would be it.
     
    Joined
    Sep 3, 2013
    Messages
    3
    Reaction score
    0
    • Legacy Citizen
    First I will say this idea for box planets is the best so far for this game in my humble opinion, it would make this game very unique that way.

    My sugestion about the change in gravity direction, while moving on/in a box planet, would be simply \"tilting\" the player towards the edge of the gravity field when they come within a few blocks of it.

    Giving them a sense of how close they are to the \"flip\" in orientation before it happens.

    The leaning direction is worked out based on their position relative to the core of the planet and will gradually kick in once they walk within 4 or 5 blocks of an edge.

    When you leave the influence of gravity near an edge by flying away, the leaning will rotate back to normal.

    The only problem I can see with the gravity split along 6 diagonal planes is what happens when you hit that change in gravity direction. As an example think of trying to jump over the edge from the top/north side onto the left/west side, before you reach the left/west side you will be under it\'s gravitational influence and will thus \'fall\' backwards toward the top/north before you complete your jump.



    This is only a problem if you aproach the edge slowly and your momentum is not sufficient to carry you over and onto the other side of the block, it\'s a strange thing to think about but sounds fun!



    What do you all think of this?
     
    Joined
    Jul 5, 2013
    Messages
    372
    Reaction score
    0
    I am sure most people would welcome this kind of unique cube-planet physics. You don\'t see it anywhere else :p
     
    Joined
    Jul 2, 2013
    Messages
    81
    Reaction score
    3
    @Marcus Cogworks

    However, you do raise a good point. I was clearly over thinking things, because there is no need for a complicated shift in gravity at the transitions. The tilting will give players all the warning they need and will keep them from suffering the jarring visual change that normally occurs when the gravity changes, even when they cross into the other gravity fields\' influence.

    So is that problem solved or am I missing something?
     
    Joined
    Sep 3, 2013
    Messages
    3
    Reaction score
    0
    • Legacy Citizen
    With the tilting the player would even be able to see over the edge they are walking over.
    It seems like a solid idea :)