# What math would be required for a Bloxburg/RoVille building system

Hi DevForum,

So i’m making a game that has a building system, similar to Bloxburg. I’ve been scripting for almost 2 years now and understand everything, except the math that is required for this level of scripting. I really wanna finish the game so i’m motivated to learn all of the math that is related to this.

That’s also why my question is: what math like, formulas, laws, etc. would be needed to script something similar to Bloxburg? I want to understand what i’m scripting.

2 Likes

Could you provide the different functions that this would have? eg. Rotating, Moving

I’m mainly talking about the wall placing, the roof building, etc. right now. Like, how it fills all of that stuff automatically trough algorithms.

Well, I am not too familiar with Bloxburg building, could you perhaps explain a bit more in detail?

I would think basic arithmetic as 1. rotating is a simple as multiplying by an angle CFrame 2. Grid snapping is simple division and multiplication and 3. positioning a part to a mouse is simple as hardly any math is even needed.

However, roof building may be complex (depends on what you’re doing)

I have been scripting 2.5 years and have made grid snapping, placement.

Here’s a video on it. Especially the first 5 minutes show the most of what i want to achieve.

I’d think the only math would be math.floor in the usage of a grid system, and more.

I’m not talking about the furniture placement, i’m talking about the actual construction of the house, how it automatically builds a roof, based on how ur walls are placed, etc.

For the filling, you would need a filling algorithm. Basically, this starts at a tile in a grid. This then checks all adjacent tiles and checks if the tile is able to be filled (eg if there is a wall blocking it). This process repeats on the new tiles until there are no new tiles that can be created.

I see, you have any good algorithms for that?