Planet loading and rendering fixes

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    Currently the game will draw segments of planet plates that cannot possibly be seen from wherever you are, causing pointless FPS loss and, on lower segment draw limits, wasting drawn segments that could be used on nearby ships that are far more important and useful to have visible. This needs to be fixed. The game can still load the plates into RAM (If this could be optimized/changed too, that would be great, but eh) but there's no logical reason why it needs to draw obscured segments. Furthermore, all planets besides ice planets should probably load from the top non-air layer down, rather than attempting to load out radially or however it's done currently, which causes a lot of derpy missing surface chunks while the game engine is busy loading up underground areas that we probably don't care about when we're not even landed on the planet yet.
     
    Joined
    Aug 21, 2015
    Messages
    165
    Reaction score
    87
    • Community Content - Bronze 1
    • Purchased!
    Agree. Much like backface culling can be used in 3d rendering to reduce render load, we should have some sort of "backchunk" culling algorithm to determine what should be loaded or not.

    Perhaps preprocess a planet's chunks during initial generation to get a list of all chunks per plate that are visible (ie, not occluded from outside view by other chunks). Then, when a planet is being loaded for a player in-game, do a raypick (ie, mathematically draw line) from the player's camera to a middle point for each plate to get a distance to each plate. Then, from the closest plate to the furthest, load each of the visible chunks for that plate, in some order. After all the visible chunks for all the plates are loaded, load whatever other chunk info you usually cache. That way, you generally see the closest planet chunks to you first, exterior chunks you can't see yet are still being loaded in case you do a fly-by, and you don't worry about loading subterranean chunks until after the surface is loaded.

    Bonus points if you do another set of raypicks occasionally during the planet loading to see if you need to reprioritize the chunks you're loading. That way, if I'm speeding around a planet and I fly to the otherside before the front is done loading, it's still trying to load visible chunks near to me before others.
     
    Joined
    Aug 5, 2015
    Messages
    51
    Reaction score
    42
    • Purchased!
    Yup. And heaven forbid you discover a system with two or three planets in adjacent sectors.

    I once made the mistake of trying to develop one of these rare configurations. Ugh did it crunch my system hard!