Configuration
The mod comes with fairly extensive configuration to fine-tune how you want the room definition and culling to behave. In particular, there is a complex system for defining whether and which blocks count as transparent for the purposes of room calculation. Firstly, there are a number of yes/no properties the mod can query on blocks to compute whether it should be transparent or not. How or if these properties are evaluated and combined to determine the final opacity is up to the user.
The valid properties are as follows:
- OPAQUECUBE (Block isOpaqueCube() returns true)
- NORMALRENDER (Block renderAsNormalBlock() returns true)
- RENDERTYPEZERO (Block has render type of zero (standard cube))
- FULLLIGHTOPACITY (Block has total light opacity)
- ZEROLIGHTOPACITY (Block has zero light opacity)
- OPAQUEMATERIAL (Block material is marked as opaque)
- AIRMATERIAL (Block has air material type)
- LIQUIDMATERIAL (Block has liquid material type)
- ISLEAVES (Block is a leaf block)
These properties are then combined with a user-defined logical combination. The format is based on Stellaris condition scripting, and is simple to understand; for example:
{
AND = {
OR = {
OPAQUECUBE
RENDERTYPEZERO
FULLLIGHTOPACITY
}
NOR = {
AIRMATERIAL
LIQUIDMATERIAL
}
}
}
This block will define any block as opaque if it has a "true" value for the OPAQUECUBE, RENDERTYPEZERO, or FULLLIGHTOPACITY properties, as long as neither the AIRMATERIAL or LIQUIDMATERIAL properties evaluate to true.
All the standard logical combinators are valid, using the following names: AND, OR, NOT, XOR, NOR, NAND, XNOR. Note that XOR with more than two inputs is treated as "one and only one of them is true", and XNOR is simply the inverse of XOR. Also note that there is an implicit top-level AND around all top-level parameters, but explicitly specifying it is recommended.
Here is a more complex example:
{
AND = {
OR = {
OPAQUECUBE
AND = {
RENDERTYPEZERO
NORMALRENDER
FULLLIGHTOPACITY
}
AND = {
RENDERTYPEZERO
NORMALRENDER
OPAQUEMATERIAL
}
}
NOR = {
AIRMATERIAL
LIQUIDMATERIAL
ISLEAVES
}
}
}
This is the default configuration in the mod, and will define as opaque any block that 1) has neither AIRMATERIAL, LIQUIDMATERIAL, nor ISLEAVES, and 2) has either OPAQUECUBE, the group RENDERTYPEZERO, NORMALRENDER, andFULLLIGHTOPACITY, or the group RENDERTYPEZERO, NORMALRENDER, and OPAQUEMATERIAL.
These rules are set in the ArchiSections_Opacity_Calculation.cfg
file in the config folder.
There is also a specific override configuration file (ArchiSections_Opacity_Overrides.cfg
) to force certain blocks to be treated as transparent or opaque. Blocks can be specified by name or ID, with or without metadata (separated from the name/ID by '$'). Example valid definitions include:
46 = TRUE //Marks block ID 46 (TNT) as opaque
35$15 = FALSE //Marks block ID 35 with meta 15 (wool, black) as NOT opaque
RotaryCraft:blastglass = TRUE //Marks RotaryCraft's 'blastglass' block as opaque
ChromatiCraft:crystalglass$0 = TRUE //Marks meta 0 (black) of 'crystalglass' block from ChromatiCraft as opaque
Source Code
The source code for ArchiSections can be found here:
GitHub