Quick Nav


Back To Top

Overview

ArchiSections allows you to subdivide a region - generally your base - into a number of separate "zones" - usually just individual rooms - to improve rendering performance by culling everything you cannot see. This is not dissimilar from visibility culling in many games, in particular the "Rooms" mechanic in FortressCraft Evolved.

Details

World rendering in Minecraft can be roughly divided into three blocks: Chunk rendering, entity rendering, and TileEntity (TESR) rendering. The former is done in 16x16x16 subchunks (as the DragonAPI /chgpkt command will show), while the latter are done one by one at whatever position the entity or TileEntity is located at. With Archisections culling active, rendering of these objects is cancelled for any entity or TESR that does not share a zone with you (ie it will not render if you are not in its zone, including if it is not in a zone and you are, and vice versa). Since chunk rendering is segmented, it is culled only if you are in a zone - no chunk culling will take effect if you are outside one - and will cull any subchunk that does not intersect with your zone or its "buffer area" (see below).

Usage

Definition of zones is done by placing a "Room Definition Controller" block; this will extend rays in all six directions to determine the bounds of its zone. These rays will continue through transparent blocks like glass, but are stopped by anything visually opaque. Anything within the extents of those six rays will be defined as in that zone. Note that this only allows for cuboidal zones; you cannot have rooms which are, for example, L-shaped. This means that ArchiSections is best used with a base consisting of discrete rooms between which there is limited visibility; it can be safely used anywhere, but if rooms intersect, or one space consists of multiple rooms, you could end up with very visible "pop-in" as machines and entities enter or exit your render list. To help reduce the risk of this, there is a config option to only accept as valid rooms with solid walls.

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: 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

Demonstration

This video demonstrates the culling behavior - notice how the contents of the little house are generally not visible once outside it, and while inside, the only things visible outside are the blocks themselves (minus whatever TESRs were bound to them), and even then, only for a short distance.

Notes

This mod is very ASM-dependent; it relies on my adding large numbers of hooks into the render engine to selectively control what renders and when. If you disable DragonAPI ASM patches - for example to gain compatibility with a VR mod - ArchiSections is unlikely to work.

Source Code

The source code for ArchiSections can be found here:GitHub

Downloads

Via CurseForge