' Playground - FREE Destructible Construction System - WIP

Hey guys

Got a bit carried away from my last goals but for good.
I was able to improve three things that bugged me from the beginning.

1. Structure Rotation:
If you watched some earlier videos, you might have noticed that the placed Structures did not rotate. (Weeeeellll…they did rotate but had to be 0°,90°,180° or 270°).
My building system relies on a grid function that takes a certain distance and rounds the x,y,z values with a defined gridsize.
For this to work the placed mesh and it’s reference location cannot be rotated.
GridFunction:
[spoiler]GridFunction:


Solution:
[/spoiler]
I just couldn’t figure out a way to solve this limitation
… Till the day before yesterday. I spend literally 5 hours building my main function from the ground up and trying and trying… just to realize how easy the solution was :smiley:
The key to it all was to invert the transform rotation and revert it back after calculating the Grid.

2. Improved “Air” Placement using CollisionBoxes:
Till now it wasn’t possible to place Structures like in similar building systems with a click in the “air”
I didn’t want to use CollisionBoxes at first because I wanted to be able to build from far away, relying only on the grid, without them beeing in the way.
but it was getting annoying having to manually transform Structures every time just so the could be placed where I wanted them. (manual transform seen in OverviewVideo from 0:50-1:15)

I found a Compromise:
[spoiler]

[/spoiler]
This function takes a predefined number of CollisionBoxes that are stored in an Array and places them at available socket locations of the InstancedMesh at runtime. Like this I only have Collisions where I want them to.
(What I mean can be seen best from 0:55-1:06 in the latest video while the debug mode is enabled.)

3. The Way Instances are Saved:
This is by far the biggest and most important improvement for me because it enables access to InstanceData MUCH faster then previously.
It now doesn’t matter if you have 50 or 50k instances. You only have to loop through 40 something Indices (current amount of different Structures). By using Tags I could theoretically reduce the Loop even further.
[spoiler]Saving Data:


Retrieving Data:

[/spoiler]
Till this post I have only implemented Health & Owner, but I have plans for different building materials and Structural Integrity.

The way I see it: Every Structure will have two values for Load (example: 200kg, 250kg).
0-200kg=fine, no damage,
200-250kg = still holding, but losing Health till it breaks or gets stabilized
250kg+=immediate destruction

PhysicsObjectMode is on hold because this is more fun to make :3

Also…I won’t Update the Downloadlink just now, because there are some things that I want to change and comment.