Done Chunk Loader cost for 1x1

Discussion in 'Direwolf20' started by lmclark, Dec 2, 2015.

  1. lmclark

    lmclark Well-Known Member

    Messages:
    14
    Likes Received:
    0
    Local Time:
    12:45 PM
    Trying to understand the new chunk loader ... and the cost for a 1x1 chunk. For one 1x1 chunk I am paying 20 while in another it is just 5.

    How does it determine the cost ? is it the number of machines in the chunk (this would make sense)? If so, at what point is the cutoff for a cost of 5, and of 10?

    I really don't need a 3x3 loaded, just a couple of 1x1 chunks. I'd really like to balance them out to all cost 5.
    Info would be appreciated. Thanks!
     
  2. Adrianfish

    Adrianfish Well-Known Member

    Messages:
    802
    Likes Received:
    244
    Local Time:
    3:45 PM
    for every machine, mob, etc will slowly increase the amount of tickets it will go through. and the amount it shows will be how many it will go through in 1 min.
    this way for people that are endgame it cost a lot more tickets to keep there base chunkloaded but for people that are just starting out its really cheep

    and i think the amount is how many ticks your base causes but not to sure how its actually calucated
     
  3. Ash00182

    Ash00182 Well-Known Member

    Messages:
    1,205
    Likes Received:
    378
    Local Time:
    8:45 PM
    Like Adrian said the cost scales with the amount of tile entities you have in that chunk.
     
  4. tyler489

    tyler489 Well-Known Member

    Messages:
    1,873
    Likes Received:
    202
    Local Time:
    2:45 PM
    not exactly what i was told.. i was told that was how many every 1200 ticks i could be wrong but i was told when the server has slower tps it consumed tickets slower.
     
  5. Ash00182

    Ash00182 Well-Known Member

    Messages:
    1,205
    Likes Received:
    378
    Local Time:
    8:45 PM
    20 ticks = 1 second
    1200 / 20 = 60 seconds
     
  6. lmclark

    lmclark Well-Known Member

    Messages:
    14
    Likes Received:
    0
    Local Time:
    12:45 PM
    Still not understanding how the cost for a 1x1 chunk is being calculated.... anyone know ?

    So, if Adrian is correct and it is based on entities in the chunk then, for example, removing 8 survivalist generators and replacing with 1 survivalist generatorx8 (upgraded version) would shrink the number of entities from 8 to 1, right?
     
  7. Ash00182

    Ash00182 Well-Known Member

    Messages:
    1,205
    Likes Received:
    378
    Local Time:
    8:45 PM
    The only person that knows is Slind as he wrote the plugin.
     
  8. Slind

    Slind Founder

    Messages:
    8,332
    Likes Received:
    3,018
    Local Time:
    9:45 PM
    Code:
    	int getUpkeepCost() {
    		int baseAmount = ChunkManager.instance.config.getMinuteCost();
    		int amount = 0;
    		int x = loc.getChunkX();
    		int z = loc.getChunkZ();
    		World world = loc.getWorld();
    		if (world != null) {
    			for (byte i = (byte)(-range); i <= range; ++i) {
    				for (byte j = (byte)(-range); j <= range; ++j) {
    					int activeTileEnts = ChunkManagerForge.instance.getActiveTileEnts(world.getName(), x + i, z + j);
    					int entities = ChunkManagerForge.instance.getEntities(world.getName(), x + i, z + j);
    					int chunkValue = activeTileEnts + entities * ChunkManager.instance.config.getEntityToTileEntityValue();
    					if (chunkValue > ChunkManager.instance.config.getHeavyChunkExtraChargeFactor()) {
    						amount = amount + (baseAmount * (chunkValue / ChunkManager.instance.config.getHeavyChunkExtraChargeFactor()));
    					} else {
    						amount = amount + baseAmount;
    					}
    				}
    			}
    		}
    		//offline loader extra charge multiplication
    		if (!isOnlineOnly && !isOwnerOnline()) {
    			amount = amount * ChunkManager.instance.config.getOfflineMultiplication();
    		}
    		return amount;
    	}
     
    Lawmonark and MrWisski like this.
  9. MrWisski

    MrWisski Well-Known Member

    Messages:
    1,110
    Likes Received:
    522
    Local Time:
    3:45 PM
    For those who don't speak Java :
    For every chunk in the range of the chunkloader, it gets a count of how many active Tile Entities and entities are in that chunk.
    It adds them together, and then multiplies it by a conversion factor (so you're not paying a ticket for each one every second).
    IF you have a large number of active elements in this chunk, you are assessed an addition "Heavy Chunk" fee.

    After the total is calculated, if this is an active offline chunk loader, the cost is multiplied by a certain amount.

    The calculated value is then returned to the plugin as the ticket cost you need to spend that cycle to keep the chunks loaded :)[DOUBLEPOST=1449078159,1449076232][/DOUBLEPOST]Basically, if that chunk is somewhere you haven't built, you're not really going to see anything above the base charge for it (which is tiny). If its got stuff above the threshold, you're going to be charged per entity and tile entity.
     
    Adrianfish likes this.
  10. Tabsz

    Tabsz Well-Known Member

    Messages:
    81
    Likes Received:
    12
    Local Time:
    2:45 PM
    Ok so to put real numbers to this,
    If I have 15 machines and 35 entities, with 3 chunks loaded. It will cost me 150 tokens per minute?

    What constitutes a tile entity?
    Is it the machines only or is it the cables, pipes, and chests too?
     
  11. Slind

    Slind Founder

    Messages:
    8,332
    Likes Received:
    3,018
    Local Time:
    9:45 PM
    No, tile ents have a weight of 1 and entities of 5. The base price applies for a weight of up to 50, if exceeded the price goes up by 5 * (weight / 50) So if the chunk has a weight of 100 the price is 10 instead of 5.
     
  12. lmclark

    lmclark Well-Known Member

    Messages:
    14
    Likes Received:
    0
    Local Time:
    12:45 PM
    Going back to Tabsz's questions ...
    maybe Slind (or someone) can quickly explain (and maybe give a couple of examples :) ) of what counts as an entity and what as a tile entity?
     
  13. Slind

    Slind Founder

    Messages:
    8,332
    Likes Received:
    3,018
    Local Time:
    9:45 PM
    Entities are blocks that don't have a fixed location. E.g. monster, animal, minecart, dropped items.. (dropped items are not counted :D) TileEntities are the others that have a fixed place but some extra functionality e.g. machines, facades, chests..
     
  14. tyler489

    tyler489 Well-Known Member

    Messages:
    1,873
    Likes Received:
    202
    Local Time:
    2:45 PM
    assuming the server is running at 20 tps
     
  15. lmclark

    lmclark Well-Known Member

    Messages:
    14
    Likes Received:
    0
    Local Time:
    12:45 PM
    So with entities (mobs) being 5 each, you'd really need to be careful with a mob grinder/spawner setup.
     
  16. Slind

    Slind Founder

    Messages:
    8,332
    Likes Received:
    3,018
    Local Time:
    9:45 PM
    you usually don't have more than 10 with a grinder setup. Further more the limit is at 30 within a 3x3 chunk area on most servers. That's 3.3 on average per chunk.
     

Share This Page