MineColonies

MineColonies

57M Downloads

Dynamic colony range

Raycoms opened this issue ยท 5 comments

commented

Dynamically calculate the colony range.

The town hall on placement would claim all chunks including the town hall + 3 chunks in every direction.

Every built building would then have an impact on the border around it depending on where they are placed.

Guard towers could give one chunk every 2 levels (into every direction) (on level 1,3,5)
Barracks and the townhall could expand on 1 chunk per level.
Utility buildings could expand 1 chunk every 4 levels (on level 1 and 5)
On destroying a building this would then unclaim the area.

To avoid issues on servers there can be a config with "max size"
and "min size".

Min size would describe a minimum protection radius to avoid other colonies to claim it (would be marked with the "colony close".
Max size would describe the max distance a claimable chunk has.
If max size == min size the system would be the same as it is now but with dynamic borders (good for servers with many colonies).

What needs to be done:

  • Enrich chunk capability with a list of positions of buildings which claim the chunk
  • On attempt to place buiding still check if within the colony
  • On place of the building claim all chunks which do not belong to another colony and do not have colony close (to respect min size)
  • Find a way to respect the existing system (maybe make it trigger with config value with new and existing system)
  • On destroy of the building remove building from chunk claim.
  • Add the radius on upgrade
  • Modify the border calc to respect the new border (basically would find all the claimed chunks which border an unclaimed chunk - maybe we can store this information within the chunk)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

commented

@Raycoms ready for closing?

commented

No commands are still broken

commented

I'd also say that the chunks claimed have to be contiguous with no gaps between claimed chunks.

commented

So, gaps can happen when you destroy a building. But since you can place the chest only in a claimed chunk gaps are avoided already.

commented

OK, do paths with waypoints claim the chunk they are built in? If I have a claim two chunks away, would running any of the paths to it or just placing waypoints claim the unclaimed chunks in between or would they stay unclaimed?