Repository navigation
Port: fix dungeon crashes from PC memory and map staging limits - #1
Closed
millerscout wants to merge 23 commits into
Closed
millerscout wants to merge 23 commits into
millerscout wants to merge 23 commits into
Conversation
Keep upstream's row-count hit tests and assert the tab-strip gap at y=117. Use remove_all on mc1 before replacing it with a file so InitForMC's directory is fully cleared.
Every bag slot draws the same 40x50 koma from mt0, so its dark smudge reads as a stamped grid at high resolutions. Mirror each slot by a fixed hash of its row and column (the slot frame is symmetric) and shade a low-frequency brightness field across the board. Both follow the bag row, so the pattern scrolls with the board and stays stable.
Mirroring whole slots still left every frame line visible. Draw the board by stochastic tiling instead: each vertex of a lattice that ignores the slot grid owns a mirrored patch of the slot's interior (frame lines excluded), and every lattice cell blends its four corners' patches with weights that sum to one, so no patch edge shows. The first pass replaces and the other three add. The capacity line under the last usable row is kept.
Each patch carried the slot art's dark centre and lighter rim, so the blended board looked blotchy. Divide that shading back out per vertex with a cubic fit of the slot's brightness, on a finer lattice, and soften the macro brightness field.
Entering a dungeon floor with a zipped upscaled pack read about 10,000 PNG headers through ReadPrefix, and each one reopened the multi-gigabyte archive. Keep one handle per archive mount for those reads instead.
An area registers the same external PNGs many times; their logical extents are now memoized. KZ_TEXTURE_TRACE also reports where texture registration spends its time (extents, resolution, decode, upload, mip downsampling).
Area and character IMG sets decoded every pack PNG serially on the main thread; with 4x packs that is tens of milliseconds per texture. They are now prefetched in batches of 32 into the decode cache, like glTF images.
Pictures whose decoder names their pixels no longer keep a pristine copy or decode every palette variant up front; they are compared by name and alternate variants decode on selection, from the decode cache. Catalog documents now name their pixels by their source files, so re-entered area textures are reused without decoding.
stb_image inflates slowly; the png crate behind kazarov::png_decode_rgba decodes upscaled textures several times faster. stb_image still reads anything the bridge rejects. Needs Kazarov perf/png-decode.
Kazarov's png_decode_rgba (TheMoonPeople/Kazarov#15); move this to the merged commit once that pull request lands.
The glTF ApplySkin fast path ignored bind-pose base_matrix and frame_id, so shoe meshes could lag behind animated feet. Prefer retail palette math when base_matrix is set, and add VisualMotion regressions.
…a budget. Use an opaque header and tab band over mnwinback so retail parchment and ghost tab labels do not show through; Georama polygon budget lives on the Game tab.
…xpanded dungeon cap
…cting ISO in folders
Let players shorten chest and floor-clear event pacing via game.dungeon_ceremony_qol (off, manual, auto) on PC overlay and retail options.
Raise character model stack budgets and main_buffer headroom, isolate dungeon monster/FX arenas from MainBuffer, and enlarge BuffReadData with staging guards and tests so large floor maps (e.g. d04f01s) cannot overwrite later globals.
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main_bufferheadroom so dungeon entry no longer hitsArenaOverflowon human stack 0 (68500 qw retail cap).BuffReadData(1M qw), addPortAssertDungeonReadCursor, and document budgets indocs/PC.md.CActiveMonster,CEffectScriptMan, andCMonsterManoff theMainBufferslab into dedicated arenas so floor map staging cannot corrupt later globals (e.g.TreasureBoxManond04f01s).CharaMemBudget,DungeonStageBudget,DungeonMapStaging.FloorMapsFitStagingBuffer, and headlessDungeonStaging.HeadlessDungeonEntryctests.The memory-budget change is commit
08dc183; this branch also includes the local beta stack not yet onorigin/beta. Squash or rebase before merge if you want a single commit.Test plan
ctest -R 'CharaMemBudget|DungeonMapStaging|DungeonStageBudget|DungeonStaging.Headless'_LOAD_DUNGEON_MAP_FILEford04f01s(cfgd01f01)