Skip to content

gameinterop: report precache names the loaded world lacks - #127

Merged
paralin merged 1 commit into
masterfrom
precache-pending
Nov 15, 2026
Merged

paralin merged 1 commit into
masterfrom
precache-pending

Conversation

@paralin

@paralin paralin commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Precache adds names to the next session manifest, but a host could not tell whether the world it runs already holds them. A host that starts another mod on the map already loaded had to either reload the map on every switch, which ends anything running in that world, or risk starting the mod in a world without its models.

PrecacheList holds the hero and resource names, each once, and records whether a name arrived after the last manifest build. The manifest builder marks it built after registering every name, and EngineHost::PrecachePending reports it. Names stay for the life of the process, so a host reloads at most once for each new name. precache_list_test covers the list.

Not for merge until it has been read.

Precache adds names to the next session manifest, but a host had no way to
tell whether the world it runs already holds them. A host that starts another
mod on the map already loaded could not know whether that mod's precache
needs a map reload, so it had to either reload on every switch or risk a
world without the mod's models.

PrecacheList now holds the hero and resource names, each once, and records
whether a name arrived after the last manifest build. The manifest builder
marks it built after registering every name, and EngineHost::PrecachePending
reports it. Names stay for the life of the process, so once a world has
loaded a name, asking for it again never makes the host reload.

Cost: Add was already a linear scan of the held names per call; it now also
sets a flag. PrecachePending reads one bool. Nothing runs per frame.

Signed-off-by: Christian Stewart <christian@aperture.us>
@paralin
paralin merged commit 59ea241 into master Nov 15, 2026
7 checks passed
@paralin
paralin deleted the precache-pending branch November 15, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant