Level Of Detail For Items (LODFI)
LODFI is both a way of removing objects from the world to reduce rendering time and an optimization for save game and multiplayer. LODFI is a pair of values in the [aspect] block of a template called lodfi_lower and lodfi_upper.
For the purposes of rendering time, LODFI works to remove objects with LODFI values greater than 0 from the world so that they are not drawn. Objects whose LODFI is lower than the value represented by the in-game object detail bar, whose range is from 0.2 to 1.0, will be drawn. Objects whose LODFI is higher than this setting are not drawn.
However, LODFI is used for many things even if the detail slider is not involved. For example, while a path-blocking bed in a farmhouse is considered "required" due to it's blocking property and should never go away regardless of the slider, it should not be marked as -1. It should instead be marked as 0 so it's still considered a LODFI object but is always loaded. LODFI objects are not saved out in the save game (because their state cannot change) and they are not transmitted over the network in multiplayer. They do not show up in AI sensor queries and are considered 100% pure eye candy. They are specially permitted to block paths, and that's what the local-plain is meant for, but they're still considered LODFI in the eyes of the save game system.
From the perspective of the loader, objects can be broken down into three LODFI categories. The categories are Global, Local-LODFI, and Local-plain.
Global: Objects with lodfi_upper < 0. Used for anything that is generally interactive, like monsters, doors, or openable chests. Local-LODFI: Objects that are client-side only and are used for decorations and have lodfi_upper >= 0. Local-plain: Special objects that are loaded locally but may have global effects. The server needs to load them for frustums outside its screen player's (usually reserved for blocking objects), and are set on the server if lodfi_upper=0, we're in multiplayer, and aspect:does_block_path = true.
As described in components.gas:
[lodfi_upper] { type=float; default=-1.0; constrain=range[ 0.0, 1.0 ]; doc = "Upper bound for level of detail for items - will always render if object detail level higher than this (set -1 for critical/global)"; } [lodfi_lower] { type=float; default=-1.0; constrain=range[ 0.0, 1.0 ]; doc = "Lower bound for level of detail for items - will not render at all if object detail level lower than this"; }
The numbers correspond to the object detail slider on the options menu, where the lowest detail setting was chosen to be 0.2 and the highest is 1. The upper/lower_lodfi settings in [aspect] define a range. If the object detail is lower than the range, it never loads, and if it's higher, then it always loads. If it's somewhere in the middle then there is a random chance it will load (this is good for shrubs). Here is the algorithm that the loader uses when deciding to load an object:
If lodfi_upper <= 0 then load always
If object detail level > lodfi_upper then load always
If object detail level < lodfi_lower then never load
Pick random number between lodfi_lower and lodfi_upper. If object detail level < this then don't load, otherwise load.
Note again that we chose a minimum value for the object detail bar of 0.2, and not 0 as perhaps would be expected.
Item Modifier LIsting
Modding FAQ