Besiege

Besiege

Not enough ratings
Collison Mod
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
930.480 KB
Jun 14, 2020 @ 8:13pm
Mar 8, 2022 @ 6:49pm
17 Change Notes ( view )

Subscribe to download
Collison Mod

Description
Current features:

This mod grants users four abilities:
  1. The ability to control Continuous Collision Detection for each block, found in each Block's Block Mapper tool.
  2. The ability to select blocks with F9, which outputs data from each collision involving that block to the console.
  3. The ability to control how precise Unity's physics engine calculates the results of each collision, found in each Block's block mapper tool and in the added console commands.
  4. The ability to suppress grabber explosions, a rare phenomenon which occurs when Grabbers are stretched too far away from the object they're attached to.

Collision Data
In vanilla Besiege, it is very difficult to gather numerical data, especially involving collisions. This mod adds a feature to gather data in a configurable manner about any collision that involves Blocks. To begin using this feature, you must use the mod's method of selecting blocks for gathering data while in simulation mode:
Press F9 while mousing over a block in simulation to select it. Press F9 over an already selected block to deselect it.
In Multiverse, only the host has this capability to conserve performance and obviate the need for messaging.
If only one block is selected, data from every collision involving that block will be output to the console.
If more than one block is selected, data from collisions involving exclusively selected blocks will be output to the console.

Continuous Collision Detection
In the Block Mapper menu for each block, you will find a new menu option with the settings
"Discrete", "Continuous", and "ContinuousD".

This new menu option will change Unity's Continuous Collision Detection mode for that block.
In Besiege, objects can 'tunnel' partway into or even entirely through other objects. The CCD option added with this mod reduces this behaviour, at the cost of increased load on your computer's CPU.
  1. The 'Discrete' option is how things are in vanilla Besiege.
  2. The 'Continuous' option will reduce tunneling through static objects, such as most level objects.
  3. The 'ContinuousD' option (Continuous Dynamic) will reduce tunneling through static objects, and blocks with either Continuous or ContinuousD mode activated.
See https://docs.unity3d.com/540/Documentation/ScriptReference/CollisionDetectionMode.html for more information.

Physics Solver Iterations controls
Besiege runs on Unity 5.4, and the physics engine has a number of adjustable values that impact how interactions are calculated. Among these are the number of iterations the solver goes through to calculate things after an impact, and this mod grants you control of that.

In the Block Mapper Menu along with the CCD controls you will also find values named Solver Iterations and Solver Velocity Iterations. These values are truncated to integers internally, so only the integer component of the floating-point value has any effect.
The Solver Iterations value controls how accurately joint bending is modeled on a collision.
A higher value makes for stiffer Joints, but will reduce performance.
The Solver Velocity Iterations value controls how accurately block speeds are calculated on collision.
A higher value makes bounces more accurate, but will reduce performance.
See https://docs.unity3d.com/540/Documentation/ScriptReference/Rigidbody-solverIterations.html and https://docs.unity3d.com/540/Documentation/ScriptReference/Rigidbody-solverVelocityIterations.html for more information.

Console Commands
All console commands accept exactly one parameter. There are three types of console commands:
  1. Collision filter commands, which serve to supplement the Collision Data logging by filtering out unnecessary data from the output
  2. Physics solver iterations setters, which change the global versions of the values found in the mapper. These are for advanced users only.
  3. the ssge command, which suppresses grabber explosions when it's passed true as an argument.

Collision Filter Commands
sddm (set data display mode) sets the data display mode according to one of the following settings:
  • 0 is Collider-based data display, which is the most precise but becomes unintuitive if any selected block has more than one Collider and is prone to spamming the console, which causes performance drops.
  • 1 is GameObject-based data display, and the default mode. Arguably the most useful one, so long as the number of GameObjects colliding at once is limited.
  • 2 is Collision-based data display. Although it is the least accurate, it also minimizes console spam on larger collisions.
sdft (set display force threshold) sets the minimum force threshold that must be surpassed for a collision's data to be output to the console. The default value is zero, which excludes only degenerate collisions with zero force. Assigning a negative value will reintroduce these kinds of collisions, and assigning a positive value will result in some number of weaker collisions being excluded, depending on the value.
scim (set collision ignore mode) sets what types of blocks will be ignored by the collision data logger, somewhat like a "Ignore static" option but with more choices.
  • 0 logs every collision
  • 1 ignores static objects
  • 2 ignores everything that isn't a Block

Physics Solver Iterations setters
spdsi (set Phyics.defaultSolverIterations) and
spdsvi (set Physics.defaultSolverVelocityIterations)
These commands change Unity's default values for physics solver iterations, which unfortunately affects only a subset of GameObjects due to the fact that vanilla Besiege changes these values for most blocks.
See https://docs.unity3d.com/540/Documentation/ScriptReference/Physics-defaultSolverIterations.html and https://docs.unity3d.com/540/Documentation/ScriptReference/Physics-defaultSolverVelocityIterations.html for more information.

Planned features:
  • Localization capabilities

KNOWN BUGS:
  • Collisions involving multiple selected blocks will have inconsistent deselecting behaviour if a selected block breaks.
10 Comments
fogolol Oct 31, 2024 @ 10:37am 
Why doesn't this mod work in the level editor? I get why wouldn't be allowed in multiverse but the level editor is the whole reason why i wanted this mod
Isaac Hipkiss Jun 15, 2023 @ 2:52am 
Does this mod allow you to entirely disable collision on a part as well?
Davitor Feb 6, 2023 @ 3:59am 
@TheFlamingNacho Thanks, dope mod
Xefyr0  [author] Feb 6, 2023 @ 1:05am 
@Davitor
Continuous Speculative is not an option present in Unity 5.4, the version Besiege runs on.
Davitor Feb 6, 2023 @ 1:02am 
@TheFlamingNacho This is a long shot but is there any reason continuous speculative isn't also an option?
Sir Vyvre the Lone Oct 19, 2022 @ 10:56pm 
It says in the description that there is an error.
Pathos Oct 16, 2020 @ 12:48pm 
it reduces that behaviour - makes thing not go through each other, which can happen at high speeds - especially cannonbal impacts
regera29 Jun 28, 2020 @ 4:30am 
im confused as to what it does does it disable collisions and make parts go through each other and not collied sorry im a tad bit dumb too
Xefyr0  [author] Jun 23, 2020 @ 2:37am 
@Imbodenator
I updated the description to hopefully be more clear. If you are still confused, please explain what exactly is confusing to you and I'll try to help.
Imbodenator Jun 21, 2020 @ 7:35am 
What does this even mean?! I'm so dumb...