Author Topic: Better Brick Collision [KotaiCol]  (Read 4681 times)

This add-on puts server-sided static shapes inside of Blockland's default bricks.
The static shapes are created in a way where they have better collision than any bricks I know of.

There were some issues with lag at first.  But those are fixed now.
Here is a video, testing it with the magic carpet.

Download: https://blocklandglass.com/addons/addon.php?id=1151

Project Topic: https://forum.blockland.us/index.php?topic=324130.0

After enabling the mod, collision is still enabled but somewhat in a glitchy state when I use an event to fakekill bricks.

I will fix that.  Completely forgot about fakekill.

Submitted update to glass.
« Last Edit: August 22, 2019, 05:37:44 PM by Tendon »

does this impact performance

Nope, not as far as i can tell.  No extra datablocks, no extra load time.  I tested plant speed by duping a truck load of 1x1 plates, i didnt see any difference in speed.  Its all server sided.

I will fix that.  Completely forgot about fakekill.

Submitted update to glass.
Alright, it works now. Thank you dude.

Nope, not as far as i can tell.  No extra datablocks, no extra load time.  I tested plant speed by duping a truck load of 1x1 plates, i didnt see any difference in speed.  Its all server sided.
looking at the code: can the TSStatic instance shapefile have a visual portion of the model as well? ive never seen this method to create static shapes before, and thats cool af if it doesnt require datablocks at all

looking at the code: can the TSStatic instance shapefile have a visual portion of the model as well? ive never seen this method to create static shapes before, and thats cool af if it doesnt require datablocks at all
TSStatic can have a visual portion.
If you do not provide one, Blockland will fill one in using whatever other layers are available, such as the collision layer.  I was actually taking steps to remove the visual portion, as it would really suck to turn rendering off on a brick and see the core underneath.
However that's not necessary anymore now that it doesn't even ghost the core to the client.

So what if I wanted to make some of my brickpacks support something like this? How would I go about it?

I intended to make that work through expansions to this add-on.  I can add support for this soon.

So, for "Brick_TestBricks" you would make a separate add-on called "Kotai_TestBricks"
in Kotai_TestBricks there would be:
[description.txt]
[server.cs]
[shapes/*.dts]

You would create .dts shapes slightly smaller than your bricks.  While not a completely accurate inset, you can use shrink/fatten in blender to get an approximate core.
The .dts file names MUST be the same as the brick datablock names.  This is how I match them up.
I will add a testing preference to allow you to see the cores in the bricks, so you can make sure they're the right size.

I would prefer if brickmakers used the above method to add kotaiCol support to their bricks.  I believe it would make it easier for users to determine which of their brickpacks are using kotaiCol and which aren't.

Another option would be to make KotaiCol search through other add-ons for a folder called "Brick_*/kotai/*.dts" and attempt to add those shapes.

Further, a brickmaker could just add a dts shape and these few tags to their bricks and it would also work:
brickTestData.kotaiColCount = 2;
brickTestData.kotaiCol[0] = "Add-Ons/Brick_Test/kotai/brickTestData 0.dts"
brickTestData.kotaiCol[1] = "Add-Ons/Brick_Test/shapes/brickTestData 1.dts"


Update v1.1.0
Now also loads collision shapes from "Add-Ons/Kotai_*/shapes/*.dts"
« Last Edit: August 26, 2019, 08:05:27 PM by Tendon »

Because it spawns a static shape inside the brick does that mean it stops the rain?

Because it spawns a static shape inside the brick does that mean it stops the rain?
I think you need physical zones to stop rain.

I think you need physical zones to stop rain.
why doesnt he make a physical zone around the static shape too

this is the epic brick fix we have waited for

i think last time he did that it was really laggy

Because it spawns a static shape inside the brick does that mean it stops the rain?
Rain is client-sided, and the static shapes are not ghosted, so no.

i think last time he did that it was really laggy
Yes.  For rain I think you have to plan ahead.  Maybe use special bricks.
I had an idea once to use a spray can to "water proof" bricks.  You would spray it on the roof of your build and it would add the physical zones to the roof bricks.
« Last Edit: August 26, 2019, 08:05:09 PM by Tendon »