Blockland Forums > General Discussion
Better Brick Collision Project [KotaiCol]
Tendon:
This project is dedicated to creating better collision for all default bricks.
I want to make the collision better so that I can make racing maps out of normal bricks and I don't have to worry as much about players getting stuck or driving through walls.
To do this, I am putting a static shape "core" inside of each brick just after it is planted.
The static shapes are scaled down to half of their original size, in my experience this gives the shape better collision.
The cores must be smaller than their bricks so that a player can hit the brick with a wrench or other tool without hitting the core.
I chose to inset the core by 0.1 units.
Insetting the core by 0.005 units will lead to most vehicles violently bouncing off of the brick.
There are some costs to using static shapes for bricks collision. Most of these are related to lag.
At ~5000 shapes my computer drops just below 60 fps.
At ~11000 my computer sits at around 17 fps.
I have a method of reducing this lag.
If a client does not know that a static shape is in the scene, the client does not have to perform any calculations for it.
These cores are meant to halt high speed collisions. During normal play, they do not need to be sent to the client.
I have two ways to stop the server from sending these cores to the client.
Option 1 is a glitch. If I set the engine to always send the core to the client, then remove the core from the "list" of things to send to new clients, new clients will not receive the core.
It's a glitch, it's hacky, and it requires that clients rejoin the server every time a new map is loaded, or over 5000 new bricks are planted.
Option 2 is a DLL. A hacked server must load a DLL which allows me to set the core to not be sent to any clients. Specifically, the SelectiveGhosting DLL by Zeblote.
I am currently taking advantage of option 1 for my testing.
As for option 2, I do not believe the BlocklandLoader hack by port has been updated to the latest version of Blockland yet.
Ideally, the elements of SelectiveGhosting would be present in Blockland by default. I made a post to this effect in Suggestions and Requests, but it hasn't received much attention and I have no way of knowing if Badspot even reads that board anymore. :x
Currently I have finished the collision for Bricks, Plates, and Rounds:
I intend to finish the rest of the default bricks(Special, Ramps, and Baseplates) before tackling the default brick Add-Ons:
As far as testing goes:
The Jeep
Seems to have an easier time rolling over these bricks.
Turning towards a brick while driving at speed does not allow the jeep to go through the brick anymore.
High speed collisions will now cause the jeep to bounce off or stop.
It is still possible to get stuck in a brick.
It is still possible to trigger a violent blowback.
The Magic Carpet
You can still get stuck.
You can still get bounced back.
But you can't get through.
maxymax13:
speedkart 2: one less thing to worry about colliding into
Conan:
instead of using staticshapes, try using vehicleblocker objects. they should have collision defined similarly to dts statichshapes. i dont know much more other than they exist and nobody uses them, but torque supports them and they have their own typemask so hopefully its more reliable than staticshape spam
Tendon:
I just tried vehicleblockers. They are no better than brick collision. Scaling them down doesn't have the same effect of improving the collision performance.
I have used vehicle blockers before, to keep a truck from rolling while it was in park. Rotation does work on them, so they are useful to keep a vehicle still when it is on a hill.
They do not cause lag like static shapes. Very similar to brick collision.
If you want to crash the game, put 22000 of them in one place and drop a vehicle on it. xP
phflack:
so currently it makes a static shape for every brick?
potentially spray the bricks you want with undulo or something and only put static shapes there?