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.
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.
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.