FORGOTTEN TOWNS

FORGOTTEN TOWNS / DOCUMENTAZIONE DI MODIFICA

Wiki di modifica ↗

Java Riferimento API (Javadoc)

MOD API 15

Sfoglia la wiki

Documentazione corrente dell'API Mod.

La documentazione tecnica è disponibile in inglese. Code and field names follow the current Mod API.

DOCUMENTAZIONE DI MODIFICA

Workstation particles and ceremonies

Placeables declare their existing effect profiles in spriteParticles. TIGER 2.5D owns socket positions in assets/data/sprite_emitters.json: choose the building, open Emitters..., select a facing and socket, then place or drag its point and choose front/behind. All 48 base sockets were migrated without changing their coordinates. The ordinary facing region and sprite anchor project crop-relative points, so atlas packing and footprint rotation do not change their meaning.

The runtime uses coordinates first, including deliberately empty maps. markerAtlasPath is optional for coordinate-only buildings. Legacy projects/mods may still use companion PNGs with one exact opaque metadata pixel per socket. Those images are never drawn as artwork.

The base-game marker manifest identifies each placeableId in assets/data/placeables.json. The builder reads its current atlas, facing crops and marker destination from that registry, so reorganizing sprite sheets cannot leave the validator checking only an unused legacy atlas. The legacy builder now recognizes coordinate-owned buildings and validates their maps without rewriting old PNGs or review hashes. Non-migrated mods retain the original PNG/hash validation. After repacking artwork, run tools/validate_sprite_emitters.py or TIGER's project check. After changing a pose, visually review its points in TIGER. The placeable sheet verifier also checks sockets.

The Essence Smithy's seven socket colors are red #FF0000 (fire), cyan #00FFFF (frost), yellow #FFFF00 (air), green #00FF00 (earth), orange #FF8000 (construct), magenta #FF00FF (spirit), and white #FFFFFF (center disk). These are metadata colors, independent of emitted light. essence_types.workstationEmitterId maps each essence to a socket. Soul and Void, including the Sundering shards, share spirit. Advanced elements retain their elemental socket and own palette.

Emitters have id, markerColor, optional resourceId, fallback color, optional passive (default true), and optional behindFacings. Hidden doorway sockets are occluded by their owning shrine. Front sockets exclude the owning sprite from their mask; foreground terrain and other placeables still occlude them. Shrine roof corners, roof peak, and the front torch participate in the summon flare in every rotation; only the doorway glows passively. For coordinate-owned buildings, each point's layer overrides the legacy behindFacings list.

Authored ritual durations use simulation ticks, so ordinary hunger/rest work-speed bonuses do not shorten the animation.

rituals maps operation names to reusable profiles. Supported workshop events currently include imbue and transform; the shrine supplies summon. A profile specifies:

  • colors: up to three distinct active RGB colors; omitted uses the input essence's palette.
  • failureColors: optional fizzle palette.
  • beam: transfer from the selected socket to focusEmitterId during the last fifth of work.
  • allEmitters: animate every socket instead of only the selected socket.
  • count: 1-32 active orbs per socket; scale: 1-4.
  • outcomeSeconds: 0-10 seconds for a committed result to fade.

An imbuing station's imbuementSeconds overrides its dynamic recipe's ordinary duration. The Essence Smithy uses ten simulation seconds: eight charge the selected element and two transfer light into the center disk. Work and effects wait until the specialist and any equipped recipient are both ready. Pausing freezes animation and work.

The Sundering mod defines its own marker atlas, red active palette, failure palette, intensity, and 300-tick (ten-second) transform recipe in examples/mods/sundering/content.json. Its existing conversion hook performs the roll. The shared workshop service publishes the actual committed output resource or failure; the renderer resolves the output's shard colors automatically. No Sundering identity or conversion rule is embedded in the renderer. Cancellation produces no result effect. Brief cosmetic outcomes are not replayed after loading; persistent inventory is authoritative.

The Shrine of the Unforgotten has a dedicated modal. Starting requires five living civilian residents, a Lightning Storm, an eligible remembered/dead citizen, 20 Soul Essence in physical storage, and shared divine-event eligibility. It creates a high-priority RITUAL work order. Four civilians finish existing work, take distinct authored participant slots, and pray using light work. Once all four are present, a fifth fetches the offering from a stockpile or warehouse container using its ordinary access rules. Loose and pre-carried essence do not satisfy this job. The work-order screen and shrine modal can cancel until the complete offering is delivered. Cancelled partial deliveries drop back at the doorway for normal hauling; carried material remains real inventory for ordinary unloading.

After delivery the work order completes, the shrine flares for 3.5 simulation seconds, then Moranth manifests at a free door-facing worker slot. If the doorway becomes occupied the flare waits. The participants are released when he appears. Gathering assignments, carried quantities, delivered escrow, source shrine identity, and remaining flare ticks survive saves. Removing the shrine before manifestation cancels the event and refunds delivered escrow once. Old saves default new fields to an empty gathering and preserve their existing god-event phase and actor.

Rendering resolves coordinate maps (or legacy marker images) at world bind, queries the manager's sprite_particles index, uses the viewport's existing visibility and foreground masks, and caps visible stations and recent outcomes. Particle clocks and ceremony progress never enter terrain geometry/cache keys.

Native OpenGL QA (tmp/station-preview) covers front and rear shrine sockets and foreground walls. The stationary sample retained gpuScope=visible, submitted 9,659 of 14,843 retained faces, and reported zero uploaded bytes and zero rebuilt terrain bands.

The native fixture also exercised a real equipped Fire imbuement through its final beam and success, followed by a real Sundering conversion through red charging and failure. Shared conversion tests separately cover both guaranteed success and guaranteed failure across saves.

The modal lists stored offering availability, lightning, eligible resurrection candidates, five citizens, and the settlement happiness requirement. The modal and priorities row share gathering, carrier, missing-storage and doorway explanations. Need interruptions release appointments without cancelling the ritual; the normal eating/sleeping and hauling systems run before rejoining. Low hunger or rest alone does not exclude citizens when there is no meal or sleeping place. Participants and carriers periodically try needs at a movement boundary and release their appointment only when eating or resting actually starts. Carried offerings remain accounted for through normal inventory/unloading rules. Focused coverage checks unavailable and available needs for both a prayer participant and a loaded carrier, cargo conservation, and newly available food.