Search code examples
unreal-engine4

Building system like clash of clans / boom beach


Is anyone knows how to do a building system like coc / boom beach? I know how to do a fortnite building system but there's only 1x1 structures to do while i need 3x2, 5x3 and many more sizes to go. I'm going to do it using UE4 with Blueprints. I've been looking so long and couldn't find answer. Hope you'll help me! Thanks.


Solution

  • As the question is rather vague and doesn't give anyone much to go on. I'll try to take a stab at it, conceptually at least.

    I'd assume that you have a base building BP or struct so, in there I would create a Vector2D variable or something similar to give it a length and width per building.

    Then when you are trying to spawn the building, check the tiles that are that length and width away from the center of the screen/cursor for any existing buildings. Then when you spawn the building make sure that the building takes claim over the tiles that it is using so others will not be able to overlap later on.

    So your main "meat and potatoes" of this project will be creating a grid system and also creating a system that can check whether or not a tile is inhabited already and also using and releasing tiles when needed.

    If you want someone to give you a more concrete answer, you will need to show what you have done and tried in your question. Especially for one as broad as this one.