Skip to content

Port: PC settings, skip intro, perf tools, and expanded dungeon cap Performance Boost - #59

Closed
millerscout wants to merge 2 commits into
TheMoonPeople:masterfrom
millerscout:port/skip-intro-perf-dungeon-bench
Closed

millerscout wants to merge 2 commits into
TheMoonPeople:masterfrom
millerscout:port/skip-intro-perf-dungeon-bench

Conversation

@millerscout

@millerscout millerscout commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Skip intro logos and improve display performance. Expand dungeon monster pool, add dungeon bench tooling, and improve gamepad logging.

with some QoL for Devs:

Debug mode
Skip intro.
Expanded dungeon monsters (ps2 had hardware limitations)
georama budget (amount of items you can place on georama)

image

Fixes #46

cherry picked the fix carrdylan52@cd1a5ab from @carrdylan52 Thanks!

@millerscout
millerscout force-pushed the port/skip-intro-perf-dungeon-bench branch from a61aba4 to 48de59d Compare October 16, 2026 03:54
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 16, 2026
@millerscout
millerscout force-pushed the port/skip-intro-perf-dungeon-bench branch 2 times, most recently from bef7add to 0890342 Compare October 16, 2026 17:45
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 17, 2026
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 17, 2026
@millerscout
millerscout force-pushed the port/skip-intro-perf-dungeon-bench branch from 1a6fd69 to 8cc13c4 Compare October 17, 2026 05:40
carrdylan52 added a commit to carrdylan52/ChronicleTwo that referenced this pull request Oct 17, 2026
The Run-level sound test clicked fixed tab coordinates, which miss once TheMoonPeople#59
moves the tab strip. It now finds each tab through options::HitTest, so it
follows either layout.
Adubbz pushed a commit that referenced this pull request Oct 18, 2026
game.skip_intro boots past the Sony Computer Entertainment text, the copyright notice and the
Level-5 logo movie while keeping the language select. SCElogoFade's fade loop stops on it through a
unit fixup, MainLoop leaves out the logo's fade-out, and TitleCopyRightStep wraps its retail routine
through a bridge. PC SETTINGS > Game gains Skip intro and Debug mode rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adubbz pushed a commit that referenced this pull request Oct 18, 2026
…59)

With game.auto_use_event_item, an event's Use Item request that names exactly one item the bag
holds is answered as the item picker's choice, using the item up when the request asks, and the
picker never opens. Requests for several items and the fish tournament's picker are unchanged.
MenuItemSelectInit and MenuItemSelectDraw wrap their retail routines through bridges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@millerscout
millerscout force-pushed the port/skip-intro-perf-dungeon-bench branch from 8cc13c4 to 334957b Compare October 18, 2026 01:15
Rebase onto upstream master: PC settings (Georama budget, expanded dungeon
monsters), skip-intro and bench tooling, floor monster list kept from master,
and interpolation that honors frame caps (draw budget off by default).

Fix native SCElogoFade unit_copy (optional nowload header fixup), restore
PortSkipIntro for title hooks, and dbg_font va_list for Clang.
@millerscout
millerscout force-pushed the port/skip-intro-perf-dungeon-bench branch from 334957b to cae668a Compare October 18, 2026 01:43
@millerscout millerscout changed the title Port: PC settings, skip intro, perf tools, and expanded dungeon cap Port: PC settings, skip intro, perf tools, and expanded dungeon cap Performance Boost Oct 18, 2026
Resolve docs/PC.md with current extraction and menu docs; keep DEBUG.md
link. Merge main.cpp Usage: upstream std::println and data.zip help plus
--bench-spawn-enemies from this branch.
Adubbz added a commit that referenced this pull request Oct 18, 2026
…aves

From PR #59, only the dungeon monster limit is kept, reworked as the
game.more_monsters setting (off by default). Off keeps retail's 24 slots and
five-nearest rule; on allows 60 slots. Unit and header fixups count monster
scene slots from DNG_CHARA_SLOT_MONSTER so ps2/ is untouched. The rest of the
PR is dropped: its branch reverts master, adds a modified option.pac, and its
Georama budget setting is superseded below.

Georama has no placement cap and no setting: the polygon and draw budgets
are gone, edit part slots, the placement log, part model heaps, houses, the
menu lists and the draw work stack grow on demand up to the 32767-slot
ceiling of the save format, and every part type's count limit is lifted.
Part removal, fence painting and culture points walk the log once instead
of rescanning it.

Saves are versioned JSON files (BESCES-51190dkcl<N>.json, autosave.json)
with a CRC-32 checksum, holding unbounded town layouts and the autosave
spawn. Existing flat saves, the old autosave and mc0/mc1 card entries are
converted once and moved under imported/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Adubbz Adubbz closed this Oct 18, 2026
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 18, 2026
carrdylan52 added a commit to carrdylan52/ChronicleTwo that referenced this pull request Oct 20, 2026
The JSON saves (TheMoonPeople#59) replaced both functions with PORT_OVERRIDE definitions,
so their two low-bits casts are replaced rather than open, and
Truncations.Check failed on the stale inventory. Regenerated with
scripts/port/truncations.py from the Linux CI build.
carrdylan52 added a commit to carrdylan52/ChronicleTwo that referenced this pull request Oct 21, 2026
The JSON saves (TheMoonPeople#59) replaced both functions with PORT_OVERRIDE definitions,
so their two low-bits casts are replaced rather than open, and
Truncations.Check failed on the stale inventory. Regenerated with
scripts/port/truncations.py from the Linux CI build.
Adubbz pushed a commit that referenced this pull request Oct 21, 2026
* Port: give each debug and monster memory test process its own config.json

config.json is written beside the save root. DebugFixture and the
MonsterMemory fixture set their save root to %TEMP%\dc2_*_<pid>, so every
test process using them wrote the same %TEMP%\config.json (and its .tmp).
Under ctest -j two of them replacing it at once fail on Windows, where an
open file cannot be renamed over, and ConfigChange returns false: the
GamePadSingleDebug, GamePadDebugChord and MonsterMemory/Off failures on the
Windows CI job, a different case each run.

The save root moves a level down, so config.json lands in the process's
own directory, and SetUp asserts that it did.

* Port: zero the test town's part extents before the fence tests read them

CEditPartsInfo::Initialize leaves area3_box for the part's collision data
to fill, as retail does. Town::Define never filled it, and
PaintedFencesMatchRetailRecursion sets only the x of each corner, so
GetFenceSide's y and z came from whatever the vector's heap memory held.
When that was large the fence ends lay further apart than
kFenceChainDistance and no chain formed ("expected.size() > 2, actual 1"):
about one fresh process in five locally, and Windows CI runs at random.

* Port: give the test discovery a minute on a loaded CI runner

ctest lists darkchronicle_tests' cases before running them, and the listing
runs the binary's static initialisers, audio device probing included. On a
Windows runner it once took over gtest_discover_tests' 5 second default,
which fails the whole Test step before any case runs.

* Port: keep the menu hand's clamp valid before the screen size is set

MovePointer clamps the hand to [left, right - 1] of the visible UI extent.
Without a renderer the extent falls back to mgScreenWidth x mgScreenHeight,
which is 0 x 0 until mglib sets the screen, so the upper bound fell below
the lower one. That is undefined for std::clamp, and the Linux Debug build's
libstdc++ assertion aborted MenuCursor.YesNoMouseTints... and
MgTextureGpu.MenuPointerUses... on every CI run; Windows and macOS build
Release libc++, which does not check it. A libc++ build with
_LIBCPP_HARDENING_MODE_EXTENSIVE reproduces both aborts on Windows.

An extent under one unit wide now pins the hand to its left or top edge.

* Port: run every death test in a re-run child, not a fork

Since Tracy joined the test binary, a static tracy::Profiler starts worker
threads before main. A fork-style death test's child has none of them, so
when the child leaves through exit() the profiler's destructor joins a
thread that does not exist and waits until ctest's 60 s limit:
DataReadDeathTest.LoadFileExitsWhenTheFileIsMissing, both
MgFramePositionDeathTest cases, PlatformFirstRun.MissingDataExits... and
SaveSlotTest.RecoveryUsesOnlyPublishedFilesInFreshProcess on Linux, after
gtest's "Death tests use fork() ... detected 5 threads" warning.

The threadsafe style, which MglibFrameDeathTest already used, re-runs the
binary for the child, as Windows always does, so it becomes the default.

Needs Kazarov's "Tests: give the unnamed arena overflow case a fixed
address": PlatformArenaBlock.OverflowOfAnUnnamedArenaGivesItsAddress
expected the parent's address in the child's message.

* CI: give lavapipe's slow GPU cases three minutes

Every case in CT_GPU_SLOW_TESTS (GfxGpu*.* among them) compiles the
renderer's 840 pipelines, which takes llvmpipe about 17 s, and then renders
on the CPU. GfxGpuMeshDc2.FogIsContinuousAcrossSharedClippedEdge and
FogChangesContinuouslyThroughZeroDepthAndW intermittently passed the 60 s
limit on the hosted runner; with this change they passed there in 67.93 s
and 127.84 s. The limit was CT_TEST_TIMEOUT because CT_GPU_SLOW_TIMEOUT
could not be set on its own. It is now a cache variable, and the Linux job
sets it to 180; ordinary cases keep 60.

* Docs: mark CEditMap::SaveData and LoadData's truncations replaced

The JSON saves (#59) replaced both functions with PORT_OVERRIDE definitions,
so their two low-bits casts are replaced rather than open, and
Truncations.Check failed on the stale inventory. Regenerated with
scripts/port/truncations.py from the Linux CI build.

* Port: hand the Flatpak build Luau's source

flatpak-builder configures chronicletwo without network access, so
luau.cmake's FetchContent download failed ("Could not resolve host:
codeload.github.com") on every Flatpak build since Luau landed. Luau is
now an archive source of the module, passed in through
FETCHCONTENT_SOURCE_DIR_LUAU like fastgltf, simdjson, cpptrace, Tracy and
libdwarf, with the hash luau.cmake already checks.

* CI: build macOS against one SDK

Homebrew's clang compiles against the Command Line Tools SDK, while
CMake's find modules search the SDK xcrun names (Xcode's). Iconv was found
there, and its include directory is not one of the compiler's implicit
ones, so every ct_port compile got
-isystem .../Xcode_26.6.app/.../MacOSX.sdk/usr/include ahead of libc++'s
wrapper headers and stopped at "<cstddef> tried including <stddef.h> but
didn't find libc++'s <stddef.h> header". CMAKE_OSX_SYSROOT names xcrun's
SDK for the compiler too.

* Port: compare GetChrFileSize's estimate as a size_t

EstimateCharacterMemory returns a std::size_t, which std::min was asked
to compare with a std::uint64_t. They are one type on Linux and Windows
but not on macOS (unsigned long and unsigned long long), where the call
matched no overload and ct_port stopped building.

* Port: start a macOS crash trace at the faulting function

The signal handler's unwind is trimmed to the frame at the faulting
instruction. macOS's unwinder leaves _sigtramp through the link register,
so that instruction is never among the frames: nothing was trimmed, and a
leaf function that faulted was missing from the report, which went from
__sigtramp straight to its caller. Crash.segv and Crash.segv-frame failed
on the first macOS CI run to reach them ("the symbolised trace has no
CrashTestSegv frame", with CrashTestFire after __sigtramp).

When the faulting instruction is not found, the trace now starts with it
in front of the link register's frame. Linux's unwinder steps through the
signal frame to the faulting instruction, so it is unaffected.

* Kazarov: follow master with the CI fixes (dependency integration)

DEPENDENCY: tools/kazarov points at b93a533 on carrdylan52/Kazarov
pr/gfx-tracy-calibration-pool, Kazarov master 0781d5b plus the three
commits this series needs (the Tracy calibration pool, the fixed-address
arena overflow case for re-run death tests, the macOS Rust link
directory). Replace it with the SHA those commits land as on
TheMoonPeople/Kazarov master once that PR merges.

The pin moves from de810e2, PR #26's head, which is on no Kazarov branch,
to master, which carries PR #26 as 28281ce plus Luau-only script
publication, audio and model compatibility changes. ChronicleTwo keeps the
Retain publication policy (firstrun.cpp still calls the compatibility
entry point). .gitmodules now names master, the branch the pin follows.

Kazarov's PNG loader decodes colour type 2 (RGB) PNGs to RGBA as well as
type 6, for other games' converted data. MgTexture's catalog case that
required an RGB PNG to be rejected now checks that it decodes: nonuniform
RGB pixels come back with their exact bytes, 3 x 2, alpha 255. The legacy
palette metadata rejection is its own case.

---------

Co-authored-by: carrdylan52 <17089587+carrdylan52@users.noreply.github.com>
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.

Constant FPS Drops

2 participants