1. If you're looking for help-related things (for example, the key rebinding tutorial), please check the FAQ and Q&A forum! A lot of the stickies from this forum have been moved there to clean up space.
    Dismiss Notice

Planet Seeds: How do they work?

Discussion in 'Starbound Discussion' started by Katzeus, Jul 26, 2013.

  1. Katzeus

    Katzeus Chucklefisherman Chucklefish

    Interesting theory!! That's a connection I missed, it could be a possibility. The number 10 comes up a lot, it's a number that's going to be important to game systems for sure.
     
  2. blazer33333

    blazer33333 Phantasmal Quasar

    Thanks for clearing this up. I think this system works well. So if we ever explore one sector too much, they can make a new one. I just hope that they randomize some stuff, otherwise the game wouldn't have much of a point. (loot wise)
     
  3. blazer33333

    blazer33333 Phantasmal Quasar

    The problem with the idea of generating your own universe is the fact that it would take ages. If it takes 30 seconds on a computer to generate a terraria map, how long do you think it would take to generate more than a billion worlds?
     
  4. Jman1177

    Jman1177 Void-Bound Voyager

    Ah, but here's the differences. Those worlds are not generated on the first time you play. They're generated when you warp to the planet, during the warping animation. The information about the planets (size, biome, etc....) may be generated only when you click on the planet, I'm not sure. But yeah, it won't be a problem, there's no way they're generating them all at once ^.^
     
  5. TheLoanArranger

    TheLoanArranger Ketchup Robot

    Literally can't happen.
     
  6. wraithbone

    wraithbone Pangalactic Porcupine



    Ahh yes... a friend and I were discussing this the other day.

    You don't, of course, generate the whole universe at once. This is where the term "procedural genertation" comes from. Terraria in the strictest sense of the word in not "procedurally generated". The world is generated once, then thats it.
    Instead of generating your massive coordinate system of 200 million x 200 million all at once, you do it in blocks of a much smaller amount. To save data and processing time.
    Of course you need to store all that eventually, right?

    Well a world is made up of blocks. So we need to generate all these blocks?
    The trick to optimising both processing time and hard disk space is to, in fact, generate as little as possible from the outset.
    Why? Simple (math warning):

    What is the smallest way to store all the information about a block?​
    You needs its:​
    • Position ( 3 bytes)
    • Type and Sub Type/ ID (2 bytes) <- This includes whether it is foreground or BG
    • Color (1 byte)
    6 bytes per block...​

    Thats expensive, when a world could be 2000x2000 blocks or 4 Million blocks.​

    24MB of Raw Data for a large world.​

    You wanna generate a billion of those? We'll... you'll need 24TB of Hard Disk space​

    So while this may seem obvious... what you don't do is generate the world and save all the Raw Data.​

    So the question we asked was wrong...

    What is the smallest way to store a planet?​
    Now we are asking the right question!​
    Quite topically, the smallest information we need to store a whole planet is its seed.​

    64 bit or 8 bytes.​

    Wanna generate a billion of those? Well that's 8GB that would be small compared to most hard disks.​




    I speculate that while you are travelling to a planet Starbound will create the seed by generating a random 8 byte number and putting that through the terrain generation engine generate all the blocks.

    Then, when you leave that planet, all Starbound has to remember is the seed.If that is the case then, when you arrive on a world all Starbound has to do is generate the landscape from the seed as you move.

    When you change something though its obviously not going to work. The seed can't include the changes you have made. Starbound now has to return to saving your changes at a costly 6 bytes per block. However we still don't need to store a 24MB file for the planet, what I think that Starbound does now is... save only the changes (what Terraria does).

    When you travel to a home world with your awesome castle on it. Starbound will generate the world as if you had never been there, then re-draw your castle and any other changes onto the world.

    So say we change 4,000 blocks to build our epic castle!​
    Well starbound needs to store 24kB + our 8 byte seed. So 24.008kB​


    Now lets pretend you are a supercomputer and you somehow manage to build an epic 4,000 block castle on a million worlds.
    Well that would take up 24GB of HDD space.

    But here is another cool thing about optimisation. Lets say the devs knew that Watson (the supercomputer) was really keen to play a bit of Starbound. Say it actually built this epic empire of castles on a million worlds.

    Well there is more we can do to optimise our world so that even Watson cant use up 24GB with its mighty empire of worlds.
    Firstly Starbound assigns default block, such that if we assign no information other than location, than any block without extra info is this default block. They do this in minecraft, that block (as it would also be in Starbound) is: air.
    Any blocks Watson digs up but doesn't fill only use up 3 bytes worth of position data. Plus we can go even more crazy and when a large, square groups of blocks are together we let the world generator only store the corners of that square (great for reducing the amount of data you need to store big background tile groups ).

    That could reduce our data usage by about 33% meaning that even a supercomputer building a seemingly enormous empire would only use 16GB of data.


    So the advantage of genuine procedural generation mean that Starbound is not only almost infinite, it would be impossible for a person to use up to much processing time or data by exploring all these worlds.


    Sorry for the really long post... but is it possible for a dev to confirm this?
     
    Dis likes this.
  7. Solomon Darling

    Solomon Darling Scruffy Nerf-Herder

    @ Katzeus

    Thanks a lot for clearing this up for us, man. I was actually imagining many ways it could work.
    I have some other doubts, though, but I will discuss them some other time - it's a bit late here -.

    @ Wraithbone

    I admit it, I didn't take the time to read through all your post 'cause I'm in a bit of a hurry. I promise I will tomorrow, though (>.<), so forgive me if I missed something.

    But what is your point? I mean, yes, if Watson could play Starbound and make a huge empire in millions of worlds (which is humanly impossible), it would take more then 24GB in your HD. Even though I don't really see that as a problem - considering I have lots of videos and music, the whole Adobe pack, some Autodesk softwares, a few game engines and around 30 games installed in my computer and I still have more then half my HD free -, plus, it's not like people can actually get to such level of buildness (?). Your avarage player would probably take only 1GB tops of HD for maps and stuff which, imo, is pretty optimized already.

    Again, I'm sorry I didn't had the time to read or fully understand your comment and I will tomorrow. Plus, I'm sleepy... Chances are I said something stupid.
     
  8. wraithbone

    wraithbone Pangalactic Porcupine


    Yeah I know that for one million worlds, which is humanly impossible alone that is not that much, but it was an example. OmnipotentEntity breifly talked about this in feb.

    To quote what OmnipotentEntity said:
    Which is more than I expected, so either the worlds are 3.3x larger than I expected or I missed something. Which is why I want to confirm my estimates on the information block sizes, because it seems that I must have missed something, else I would have got an answer closer to OmnipotentEntity.
     
  9. imrevned

    imrevned Scruffy Nerf-Herder

    I just want to clarify, will the planet that we start on be the same for everybody (it's position in the universe), or will it be in a 'random' location of the universe?

    I've heard that it's the 'same' planet for everyone and that it's 'random', so I am confused.
     
  10. TheLoanArranger

    TheLoanArranger Ketchup Robot

    Hopefully it's random- would suck to join a multiplayer server and the starting planet was totally mined of potential fuel sources and have to wait for someone to deliver you some. It was the same in the demo this morning, but, might have been just for the demo.
     
  11. imrevned

    imrevned Scruffy Nerf-Herder

    I'm assuming we'll begin on different planets because if the universe itself is the same in regards to planets (how they look/location), and the chances of us coming across the same planets are slim because of the vast amount, we'd have to spawn on a different planet. Unless I am missing something.

    Also, if we spawn on a 'random' planet, what if we spawned on a very cold planet, or are cold planets not a tier 1 planet?
     
  12. like00111

    like00111 Zero Gravity Genie


    There might be like restrictions for what kind of planet you can spawn on, so that doesn't happen to us. But I hope we spawn on different planets with the billion of planets there will be.
     
  13. greenskye

    greenskye Pangalactic Porcupine


    I'm thinking that it wouldn't be hard to exclude extremely cold/lava filled planets from low level tiers, but I have no confirmation of this. Could be accomplished by forbidding certain biome types from Tier 1 planets
     
  14. Solomon Darling

    Solomon Darling Scruffy Nerf-Herder


    This is definely not a hard thing to work on.

    I was thinking about it a few days back, actually. I just hope the devs realised that they'd insta-gib us if they aren't careful with that, lol.
     
  15. greenskye

    greenskye Pangalactic Porcupine


    At one point in the in stream you see them travel to a threat level 4 world and get spawned at the bottom of an arctic ocean. By the time they reach the surface, the character dies of hypothermia. Which seems rather unfair. Especially if you were playing a hardcore character. I assume it's just a bug, but it's something to keep in mind. And while it happened on a threat 4 world, it's possible that it could happen on a threat 1 world as well. (Maybe not freezing, but certainly drowning)
     
    Solomon Darling likes this.
  16. TheLoanArranger

    TheLoanArranger Ketchup Robot

    Well, he could have beamed back up to the ship immediately. I guess he didn't notice he was freezing. Maybe a more readily apparent indicator would help with that.
     
  17. greenskye

    greenskye Pangalactic Porcupine


    It needs a sound effect or something. And I personally feel like I'll fail to notice it a lot at the bottom of the screen. But perhaps it'll be different once I get my hands on it. I was surprised at how quickly it drained. It was much, much faster than the breath meter.
     
  18. TheLoanArranger

    TheLoanArranger Ketchup Robot

    Near freezing water is much, much more dangerous than cold air even of the same temperature (it looks like they've taken this into account, which is cool, pun partially intended). If you look at the meter whenever it pops up, there's an arrow on either side indicating how far outside of normal temperatures you are.

    e- which, incidentally, means that planets without atmosphere shouldn't really have freezing temperature concerns? As there's basically nowhere for the heat from your body to escape to. Hmm.
     
    greenskye likes this.
  19. Solomon Darling

    Solomon Darling Scruffy Nerf-Herder


    Mhmm. It's indeed possible. Let's just pray the devs think about this.

    Otherwise, I guess I know what's my first mod's going to be :p
     
  20. crazygamer2255

    crazygamer2255 Phantasmal Quasar

    any game that has a seed system there is always going to be that one person, who is just like "where do i find the seed" and "can i put it on another world", i hate when that happens
     

Share This Page