Commit Graph

37 Commits

Author SHA1 Message Date
0921fedb76 anim_clips: ask report_paths for the report-path guard 2026-12-01 19:44:42 -05:00
fcac19c235 tools/anim_clips: write --out JSON report atomically (ANIM-CLIPS-ATOMIC-JSON) 2026-11-26 20:02:00 +07:00
f9cd3118f7 anim_clips: harden sequence/clip decoding and gap-page fallback 2026-11-23 22:25:39 +01:00
b79c6f1f09 anim_clips: decode the .motionmatcher layout (ASSET-258) (#3377)
Squash-merged after review of PR #3377 - anim_clips: decode the .motionmatcher layout (ASSET-258)
2026-11-23 08:12:36 -06:00
aff9338187 anim_clips: count clip windows; the clip timing rule over all 785,174 entries (was 4,471 in 300 sampled dictionaries) (#4881)
Squash-merged after review of PR #4881 - anim_clips: count clip windows; the clip timing rule over all 785,174 entries (was 4,471 in 300 sampled dictionaries)
2026-11-23 08:11:05 -06:00
51931245d5 docs: point 15 more tools at their --help usage line (#5535)
Squash-merged after review of PR #5535 - docs: point 15 more tools at their --help usage line
2026-11-23 08:09:32 -06:00
94e682cff4 Merge pull request #3341 from NiiRoZz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:19 -05:00
f22aa1472f Merge pull request #3341 from NiiRoZz 2026-11-22 17:01:32 -05:00
9628bf207e anim_clips: count the +0x20 array of multi-axis motion nodes
From @ismailchaka1's check on #3341: types 4-8 have a {ptr, count} array at
+0x20 (null on type 4 and on 431 of 482 type-5 nodes; on every type-6/8 node,
items {u32, 0, u32, 0}). Counted as motion_node_pairs:<type>:<count|null> and
documented; the values are not decoded. Rechecked on anim.rpf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:58:31 +01:00
d9c5ca2698 anim_clips: identity needs one item per list; read times and node apart
Review of #3341: sample_k_is_child_k compared only each list's first child,
so [[0, 1], [1]] counted as identity; it now requires one item per list.
A malformed parameter node no longer resets a readable +0x70 time table to
None. Rechecked on anim.rpf: the totals in docs/animation.md are unchanged
(6,970 identity, all 17,247 time tables readable).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:02:26 +01:00
ef9230b950 Merge pull request #3155 from Kacper Serewis 2026-11-22 15:15:15 -05:00
61e07ef204 Merge pull request #3038 from Kacper Serewis 2026-11-22 15:14:16 -05:00
80cace8b06 Merge pull request #3026 from Leo Leahy 2026-11-22 15:14:09 -05:00
688a2cf6ba Merge pull request #2818 from Kacper Serewis 2026-11-22 15:12:18 -05:00
d39dcc3bd6 ASSET-259: decode .motion node types and the sample-to-child lists
Parameter node types 3, 4, 5, 6 and 8 carry 1-5 axes ({u32 name hash, u16,
u16} at +0x10); types 4/5/6/8 keep their sample count at +0x90/+0x90/+0x50/
+0xA0, type 1 at +0x20. The .motion's +0x90 lists (one per node sample,
items {u32 child, f32, f32}) map each sample to a child: checked on all
8,932 one-node motions in anim.rpf. Counts only; synthetic tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:10:20 +01:00
262423974d Require pack membership evidence before a named page boundary 2026-11-22 20:47:42 +01:00
a3989d4302 Recognize referenced animation packs at page boundaries 2026-11-22 20:41:58 +01:00
f0dda53c3f Keep named animation dictionary roots out of incomplete page groups 2026-11-22 20:32:56 +01:00
796ea02fdf Read selected GLB animation dictionary pages on demand 2026-11-22 20:10:48 +01:00
de875521cf anim_clips: recognise a .motion clip with an inline name 2026-11-22 16:08:16 -03:00
5a6837c76b Preserve retail continuation pages with name tables and root-like prefixes 2026-11-22 19:23:12 +01:00
95840b70ce Locate animation page counts across bounded contiguous streams 2026-11-22 19:23:12 +01:00
15173f2ade Merge pull request #2737 from Vonsek 2026-11-22 13:17:27 -05:00
56f0ea032d fix(tools): read all pages of a selected animation dictionary
Targeted decoding capped the input stream list before the page grouper could resolve the count declared by the dictionary.
2026-11-22 19:05:02 +01:00
ec9a99c69e tools: a process pool gets at most 61 workers on Windows
Windows waits on a pool's workers with WaitForMultipleObjects, which takes
at most 64 handles. With --jobs 62 or more, awc_opus.py, awc_shorts.py,
world_lights_paths.py and world_build.py stopped with "ValueError:
max_workers must be <= 61" (ProcessPoolExecutor), and anim_clips.py
(multiprocessing.Pool) printed "ValueError: need at most 63 handles" from
a helper thread and never returned: 62 workers were killed after 60 s where
61 finish in 0.8 s (Windows 11, Python 3.12.5).

awc_opus.py and awc_shorts.py default --jobs to half the CPU count, and
make_game.py hands its own --jobs to awc_opus.py, so a machine with 124
logical CPUs reached this with no option given.

tools/pool_workers.py holds the limit, and the five pools are created with
process_workers(jobs): unchanged elsewhere, 61 at most on Windows. The
job count is lowered rather than refused so that a build with a large
--jobs keeps running. world_census.py, which refuses --jobs above 61, is
not changed.

tests/test_pool_workers.py runs each tool's own code: with the limit
patched in and a recording pool (every platform), the audio tools from the
command line with --jobs 62, and the real pool with 62 jobs on Windows.
8 of its 10 tests fail on the tools as they were.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:54:49 -05:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
2df55517d5 Merge pull request #1530 from bbareth 2026-11-22 07:08:04 -05:00
640c500606 anim_clips.py: reject invalid time budgets before scanning 2026-11-22 12:59:33 +01:00
67ff7aafee Merge pull request #1441 from pushkarreddyy 2026-11-22 06:38:05 -05:00
0499e046d1 anim_clips: refuse report paths that overwrite the source archive 2026-11-22 16:57:54 +05:30
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
17f39ac44f anim_clips: read .motion child times and one-axis parameter nodes
.motion +0x70 holds one 0x28-byte item per child: the child's duration, its
duration in the blend and a (child time, blend time) curve. On anim.rpf the
first float is bit-for-bit the named .clip's duration for all 111,948 children
that name a .clip there; 158,991 of 159,584 curves are the identity and 402 are
monotonic time warps.

The parameter node is at +0x138 (+0x58 = 1) or at +0x18 of the block +0x120
points at (+0x58 = 2). Type 3 (10,171 of 17,247) is one sampled axis: a name
hash, (sample index, value) items sorted by value, min and max. 10 of the 88
axis name hashes resolve to joaat32 names such as yawangle and speed.

Also documents that the unlisted-last-page recovery needs the page map in a
listed stream (whattheflop's review on #1174): no anim.rpf root and no
story000 clip dictionary has its page map in such a tail. A synthetic test
keeps that layout unresolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:08:55 +00:00
2cd416311f Merge pull request #1189 from Tayar 2026-11-22 03:14:25 -05:00
f117977225 anim_clips: reject negative frame counts 2026-11-22 05:05:35 -03:00
590225ad0d anim_clips: join the 36 unresolved dictionaries and resolve .motion children
The 36 roots whose second system page is not the next listed stream have it
right after the first stream: a zlib stream inflating to 16-48 bytes, which
anim_index.py does not list (it keeps streams of 64 bytes or more), or a
16-byte raw page. group() now tries that page and joins it only when the
pages parse as a clip dictionary. All 36 join; 191,042 animations decode.

.motion clips list their children as {u64 0; u32 clip hash; u32 dictionary
hash} at +0x60, and the root's hash-only +0x70 references are dictionary
hashes. scan() joins both across the archive: 111,948 of the 114,925
children whose dictionary is in anim.rpf name a .clip of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:45:31 +00:00
4d47a08f90 anim_clips: count the budget as spent at >= so a coarse clock still skips
On Windows time.monotonic() ticks at about 15 ms, so a zero budget read an
elapsed 0.0 and nothing was skipped (test_budget_skips_instead_of_blocking
failed in CI). Compare with >= instead of >.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:35:03 +00:00
09d3841df8 anim_clips: decode the clip dictionaries in anim.rpf to keyframes
tools/anim_clips.py groups the stream walk of anim_index.py into RAGE
resources via the page map at the +0x08 pointer, finds the clip
dictionaries (system-only, 1 or 2 pages) and decodes dictionary -> clips
-> packs -> animations -> sequences -> channels. Channel types 0-5, 7, 8
and the GTA VI type 10 (second-order delta coding) are decoded. Output is
counts and per-dictionary rows only; --decode prints one dictionary's
values to stdout for local use.

docs/animation.md gets a "Keyframe decoding" section with the layouts and
the measured full-archive counts, and the statements it makes stale are
updated: 0x98e1750c is joaat32("bonerotation"), the 2/3 packed streams
are second system pages of 0DRP resources, and keyframes are decoded for
the clip dictionaries. tests/test_anim_clips.py builds synthetic
resources, including a type-10 encoder for a round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:17:56 +00:00