Modding Help Chunk Size, World Loader, Planet Loader

Discussion in 'Starbound Modding' started by VasVadum, Feb 23, 2014.

  1. VasVadum

    VasVadum Cosmic Narwhal

    I was looking into some persistent farming stuff and found one mod that causes an issue with client side performance while in an area with lots of plants. So I remembered something I had in Minecraft, a chunk loader with variable size. It let you set it to keep 1 chunk which was 16x16x256 blocks to remain loaded even when no one was around, or a 3 chunk grid, that's 3x3 chunks, or 5 chunk, and 7 chunk. I used these quite a lot to keep a nuclear power plant running. I know, totally different game, but still. Would a chunk loader work in starbound?

    What are the size of starbound chunks? It's 2D so one of the dimensions is cut off, obviously. 50x50? I found mention of chunk size in celestial.config so that's where I got the number.

    Would it be possible to have a device that if the player holds in his hand, it would put lines around each chunk to show where chunks are?

    Would it also be possible for a device placed inside a chunk to keep that chunk loaded even when a player isn't around? As if a player was there.

    The shipworld is always loaded, from what I understand. So what happens if say, you have a planet, always loaded? How much memory would the smallest planets take to keep loaded? And how much memory would the largest planets take? Am I safe in assuming that it'd be to much to keep an entire planet always loaded? I had thought about asking devs to make home planets always loaded but then I realized this little thing, that planets may be to much to be kept loaded.
    Tiny planets would have 1,232 chunks, if chunks really are 50x50, huge planets would have 44,851 chunks. Assuming, again, that chunks are 50x50 in size. Seems like quite a bit of data to keep loaded, that's not counting all the monsters that would be roaming around in such a vast amount of territory.

    I'm just looking for a little info on if something is possible, before I request that someone try to make such a mod. I don't want to go requesting the impossible now.
  2. The game is not broken up into "chunks" like minecraft is as far as I am aware. I just loads the blocks around the players.
    It would certainly be too much to keep an entire planet loaded just for a simple crop.

    Also in regards to JTE's persistant farmables... The lag is from rendering the crops as a wired object, nothing else. I take it he has not updated his scripts to work on normal objects yet to reduce that issue?
    What you are asking is completely possible as of Enraged as there was a new chunk loader introduced to Lua. Take extreme caution though,as there is no testing done on this yet in regards to how/when/where everything is loaded. For instance, we do not know if scripts will continue to load even if a player goes off world (EXTREME performance issues will occur here if a player leaves a chunk loader on every planet!)

    Be careful with this:
    Daimoth and The | Suit like this.
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    Honestly I don't see much reason to keep an area loaded.
    I think the way JTE did it was best
    Mark the 2 times and evaluate how much something is done between those 2 times.
  4. Agreed. However I dont understand why he has such a low delta script. The crop does NOT need to be running 60 times a second. There is a bit of optimization he could do, but hey... its his mod.
  5. VasVadum

    VasVadum Cosmic Narwhal

    I don't know how to code, so I couldn't do it myself to begin with. The best I can do is edit items that already exist. xP Anyhow.

    Yea, I was talking about keeping a world loaded for anything else too. I'm not sure there is currently anything in the game that would require such though, just crops right now. But then again there are smelting so if you leave while smelting something it stops. Had hoped perhaps in the future we could do stuff involving electricity in the game, and nuclear generators with automated crafting, inventory management systems, and all that good stuff, that would also require the chunks to stay loaded. Kind of hard imagining AE in a 2D game but it is possible I bet. You just need to get creative. Hah.

    So what's this 50 then? The chunk size I mean. When I land on a planet and fly to fast, faster than my connection allows, I load a large square of blocks here and there and several remain unloaded that look like they are about 50 in size. So I know I have at least 9 chunks of data on my screen at all time. You sure they aren't set coordinates? Like chunk 0 begins at 0x0 on the map coordinates, while chunk 1 begins at 50x0 and so on so forth? It's just the first 50 blocks you see is your chunk?
  6. I BELIEVE that it is just the radius on the left and right for the how much the client will request at a time. I could be wrong. I have not done intensive research into the matter.
  7. snatvb

    snatvb Yeah, You!

    I also encountered the same problem in minecraft used chunkloader, will be added in the Starbound same thing?
    Sorry for my english.
  8. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    I do know from my own testing that the game does seem to in fact be separated into chunks, though I haven't pinned down the exact dimensions. If you move very fast around the map, such as by carefully using say the bubble boost or any other tech that will allow you to remain in the air, you can become capable of moving faster than chunks will load. There are many times like this where I will fire off into an unloaded area and then my character will jitter until it loads. Near the ground you can see definitive lines where the land hasn't loaded yet, and it's especially apparent during weather as the weather will not go into an unloaded area and will even accumulate and spill off of it until it loads. They seem to be square shaped and may be in 50x50 blocks as has already been stated. I do not have the know-how to code something like this, though having a chunk remain loaded seems like a better alternate to say persistent farmables. I use PF myself, though it does seem like there should be a better way to accomplish these tasks.
  9. The | Suit

    The | Suit Agent S. Forum Moderator

    Keeping a chunk loaded is a far worse idea then the way PT does it.
    That would mean constantly having resources dedicated to the task.

    PT instead calculates the difference between the time loaded and unloaded - and gives the result. Hence no constant drain on system resources as a chunk loader would cause. The problem with PT's method is his constant call of farm able to main - which lags the system as more plants exist within the loaded chunk.
    Last edited: Feb 27, 2014

Share This Page