Technical and Library Mods

From the Fear Nightfall wiki · Technical mods
Technical and Library Mods

The Technical and Library Mods are the performance, library and server-administration mods in Fear Nightfall. They add no monsters, items or biomes of their own. Instead they provide the code that other mods depend on, speed up chunk generation, lighting and server ticks, and give server operators tools for profiling, pre-generation and crash recovery. A player rarely sees them directly, but they decide whether the world runs smoothly, whether the server survives a broken entity, and whether the content from the other mods loads at all.

The group has three roles. Libraries such as Cristel Lib, Iron's Lib and the general-purpose APIs are required by content mods and cannot be removed without breaking them. Performance mods such as C2ME and Lithium run in the background without any player action. Admin tools such as spark, Chunky and Neruina are used by the server operator. Some of these mods are installed on both server and client, and others on the server only.

Overview

The pack runs 132 mods, and many of them depend on shared libraries. Those libraries are installed as dependencies and are listed under the auto-added dependencies in the Mod List. They supply APIs for configuration, rendering, data-driven content and world generation, so that the structure, biome and item mods can share one code base.

The performance mods target the parts of Minecraft that slow down most in a large modded world: chunk generation on worker threads, the light engine, the redstone implementation, server tick logic and memory use. Several of them change game code directly, and the pack adds a small number of bytecode patches to other mods where they conflicted (see Changes to vanilla and In Fear Nightfall below).

Horror is the pack's theme, and the technical layer supports it indirectly. Structure density, biome weighting and chest loot all run through the worldgen libraries described below, so the way horror content appears in the world depends on these mods as much as on the content mods themselves.

Content

Performance mods

  • C2ME (Concurrent Chunk Management Engine, NeoForge) runs chunk generation and loading across multiple threads. It is installed on both server and client.
  • ScalableLux rewrites the light engine to improve lighting performance and fix lighting errors. It is installed on both server and client.
  • Lithium optimises game logic on the server, and ModernFix reduces startup time and memory use. Both are installed on both sides.
  • Ferrite Core reduces memory use. It is installed on both sides.
  • Noisium optimises worldgen performance.
  • Alternate Current replaces the redstone dust implementation with a non-locational one that is more efficient. It is installed on the server only.
  • Ksyxis speeds up world loading by removing chunks that are not needed. It is installed on the server only.
  • Structure Layout Optimizer is an attempt to optimise jigsaw structure generation. It is installed on the server only.
  • Dynamic FPS and More Culling are client-side rendering optimisations. Sodium (0.8.13) is the client-side rendering engine used in the pack.

Admin and server tools

  • spark profiles the server and client, so that lag sources can be found.
  • Chunky pre-generates chunks quickly and safely, so that players do not wait for new terrain.
  • Neruina (Ticking Entity Fixer) stops a single broken ticking entity, block entity, block state, item stack or player from crashing the world. It is installed on both sides.
  • ServerCore is a server-side management mod, installed on the server only.
  • Lootr provides per-player loot chests. See Lootr.

Worldgen libraries

  • Lithostitched is a worldgen library with extra configurability and compatibility enhancements. It is required by Terralith and is installed on the server only.
  • Biolith provides world-generation utilities from TerraformersMC. It is installed on the server only.
  • TerraBlender adds biome regions. During biome work the pack adjusted its region weights for Biomes O' Plenty and Regions Unexplored, and those weights were then superseded by a custom biome table.
  • Cristel Lib provides structure configuration and runtime datapacks. It is required by Towns and Towers.
  • Moog's Structure Lib is required by the Moog's Structures sets. It is installed on the server only.
  • Formations (Structure Library) is the structure library for the Formations sets. It is installed on the server only.
  • Sparse Structures controls how far apart structures are placed. See In Fear Nightfall below.

Content libraries

  • Accessories and the Curios API provide accessory slots. The mod that uses them is Accessories and Curios.
  • Iron's Lib provides common code and content for the Iron's mods, including Iron's Spells 'n Spellbooks.
  • Architectury API, Bookshelf, Cloth Config API, Configurable, CoroUtil, Framework, Geckolib, GlitchCore, Kiwi, Lodestone, Moonlight Lib, oωo, Player Animator, Prickle, Puzzles Lib, Resourceful Config, Resourceful Lib, TxniLib, YetAnotherConfigLib, YUNG's API, Atlas Lib, Elysium API and Necronomicon API are general-purpose libraries for configuration, rendering, data-driven content and multi-loader development.

Mechanics

Most of these mods run without any player action. The player only notices their effects, which fall into four areas.

Chunk generation and loading. C2ME and Noisium spread the cost of generating new terrain across several threads. Chunky lets the operator generate chunks ahead of time, so exploring a new area does not stall the server. Ksyxis removes unneeded chunks when the world loads. Generation changes apply only to new chunks, so an existing world keeps the terrain it already has.

Lighting and redstone. ScalableLux rewrites the light engine to improve lighting performance. Alternate Current updates redstone dust without the locational rules of vanilla, which keeps large wiring cheap to update.

Server tick and crash safety. Neruina catches exceptions thrown by ticking entities, block entities, block states, item stacks and players. The automatic removal of entities is switched off in the pack (auto_kill_ticking_entities: false), and the exception threshold is 10. This keeps one broken mob or block from bringing down the whole world. Lithium and ModernFix reduce the work the server does on each tick.

Profiling and monitoring. spark records where the server and client spend their time, so an operator can find the mod responsible for lag.

Changes to vanilla

These are the changes a player will notice in the base game.

  • Redstone works on the Alternate Current dust implementation, not the vanilla one.
  • Lighting is computed by ScalableLux, which replaces the vanilla light engine.
  • Chests from Lootr are per-player. Each player opens their own copy of a chest's contents, and the chest keeps its vanilla look.
  • Server watchdog is disabled (max-tick-time=-1). Without this change the server stops when a rare-biome search (/locate biome) takes longer than 60 seconds.
  • Worldgen runs through Lithostitched, Biolith and TerraBlender, so biome and structure placement follow the pack's data rather than vanilla defaults.

In Fear Nightfall

The pack adds configuration and patches on top of the technical mods, so the server behaves differently from a stock install.

  • Structure density. Sparse Structures is tuned per structure set, and its configuration is generated for the pack. Non-horror structures are about three times sparser than with the mods at their default spacing. Horror structures, such as the Graveyard set, Born in Chaos and Sleepy Hollows, are placed about 30% closer together, and about twice as many horror structures generate in the pack's sample area. Where a horror structure shares a set with other structures it gets six times the weight.
  • Worldgen thread safety. Formations' bed-colour processor shared one random generator across chunk threads, which C2ME's multi-threaded generation exposed. The pack gives each call its own random generator with the same seed, so the colours are unchanged and the 19 exceptions and three wrong colours seen with eight threads no longer occur.
  • Watchdog. The server watchdog is turned off because the /locate biome search for rare biomes takes about 14 seconds, which is longer than the default 60-second limit.
  • Chunky is installed so that operators can pre-generate the terrain before players arrive.
  • spark runs with its background profiler turned off (backgroundProfiler: false), because the native profiler crashed the game on macOS when a new world was joined.
  • Lootr is set to vanilla textures (vanilla_textures = true) so that opened chests look normal on the client. Some containers cannot be made per-player and remain shared, first come first served. These are the Graveyard coffins and urns, Farmer's Delight cabinets, Hexerei chests, Sleepy Hollows coffins and the Nether Expansion brazier chests.
  • Phone-home calls from Iron's Lib and Traveler's Backpack were redirected to localhost, so the server does not contact external services.
  • Client. The Sodium add-on chain was reduced to what the client can run. Sodium Dynamic Lights and Sodium Options API were removed from the client, and Immersive Lanterns is installed on the server only.