Commit Graph
24 Commits
Author SHA1 Message Date
Jiaqi Liu d1b2c05eb4 Optimize resource loading and fix PAL3A script execution (#92)
* Optimize DDS texture creation and static POL meshes

Separate file decoding from Unity upload through format-neutral texture data
and explicit world, sprite and skybox policies. Validate DDS layouts, preserve
alpha coverage and use native BC uploads with software RGBA fallback.

Compact referenced POL vertices and batch nearby static opaque groups sharing
materials. Keep water and dynamic geometry separate, with source ranges retained
only in the Editor. Add DDS layout and POL index regression tests.

Validation: PAL3 and PAL3A each passed 24 Editor tests, eight combined Game and
ResourceViewer style regressions, 936 paired skybox comparisons, and both macOS
Player builds on Metal. Editor provenance and Core tests are excluded from Players.

* Add core protocol regression tests and copyright checks

Cover SCE command contracts, binary readers, resource layouts and full local CPK decompression for PAL3 and PAL3A. Fix CVD time rebasing, binary read bounds and short reads, and CPK/NAV validation.

Standardize first-party copyright headers, preserve correct creation years, and update console source generation. Validate both variants in Unity and verify all live CPK entries.

* Implement PAL3A command handlers and isolate script execution

Correct PAL3A parameter signatures and add handlers for fortune selection,
skybox sequences, actor facing and attacks, team and progression state,
camera constraints, and battle preparation flags.

Give script instances separate locals, advance grouped waits concurrently,
and pause PAL3A parents only for their directly decoded child calls. Cancel
stale interactions and save replay on reset, preserve finite action semantics,
and restore camera orientation after releasing horizontal constraints.

Persist supported state in v2 saves and add protocol, runtime, and progression
regressions. Full combat gameplay remains outside this change.

Validation: PAL3 274/274 and PAL3A 291/291 EditMode tests; 18 PAL3 and 22 PAL3A
runtime checks. All 77,889 PAL3A instruction boundaries match EXE signatures.

* Run CI only for pull requests and upgrade build actions
2026-11-13 09:28:31 +08:00
Jiaqi Liu 8ef2c946db Migrate PAL3/PAL3A rendering to URP Forward+ with independent Toon lighting (#90)
* Migrate original rendering and frosted UI to URP Forward+

Port the original materials, fog and screen passes to URP. Capture the finished scene for frosted UI and keep the renderer assets ready for clustered lighting.

* Add standalone Toon lighting and shared model rendering support

Add independent Toon shaders, scene and character lighting, contact shadows and fire controls. Share POL materials, preserve MV3 seams and texture swaps across both styles, and support scene-specific Toon water.

* Skip redundant CVD mesh updates

Reuse unchanged poses and UVs, and recompute Toon normals only when geometry or the linear transform changes.

* Manage game Bloom and screen effect state by camera

Expose a persisted Bloom switch, restore the active style default on reset, and release camera and volume state when the manager is disposed.

* Restore opt-in story VFX loading

Use the existing local VFX resource path for synchronous and asynchronous loading. Keep the preference off by default and document compatible optional assets.

* Save Unity 6.6 and URP project settings

Persist the current graphics, quality, player and shader graph settings plus the URP material upgrade marker.

* Fix Unity 6.6 startup compiler warnings

Use Unity assembly discovery and object lookup APIs, keep PAL3 command reflection independent of UnityEngine, and preserve the runtime GDB dictionaries in JSON exports.

* Use the new Input System as the only input backend

Select Input System Package as the sole backend. Remove the extra scroll-sensitivity reductions in the console and file browser, preserving their previous Both-mode scrolling behavior.

* Preserve two-sided model normals across animation

Recognize coincident MV3 vertices by their complete animation trajectories and skeletal vertices by their bind positions and bone. Separate opposing faces only where a source normal group is shared, preserving UV seams and adjacent single-sided faces.

* Isolate optional VFX lifetimes and private asset builds

Centralize optional prefab loading, persistent attachments, active-effect cleanup and cache invalidation. Runtime toggles hide active effects and restore surviving attachments. Block private VFX and legacy Toon assets in public builds, with an explicit local private-build override.

Release portal attachments on destruction, reject dead parents and prune orphaned persistent attachments.

* Manage camera post-processing, anti-aliasing and menu glass

Give each game camera its own VolumeStack without mutating shared profiles, and restore inherited camera and effect state on disposal. Map the old PPv2 Bloom intensity through its exponential compositing coefficient; this does not establish visual equivalence across pipelines. Share saved and live MSAA handling with ResourceViewer, and make the main menu acrylic background whiter with less scene color showing through.

Restore pipeline settings even after partial initialization or service cleanup failure. Protect the persistent URP asset from ordinary Play Mode saves and restore the two runtime fields across Play exit and script reloads without reverting unrelated edits.

* Tune Toon lighting, water and bounded point-light shadows

Strengthen indoor and outdoor lighting contrast, integrate SSAO and baked shading while retaining character detail, and light transparent water with the shared Toon shader. Expose independent switches and strengths through the console. Support up to four shadowed fires with bounded allocation-free selection, preserve saved preferences, adapt the shadow atlas, and default desktop devices to four shadowed fires.

Report invalid console strengths and shadow budgets without saving rejected values.

* Fix DXT3 alpha decoding that produces foliage stripes

Expand the high alpha nibble into both halves of the output byte. Fully opaque DXT3 texels now decode to 255 in both pixel positions, preventing alternating coverage in the cutout and blended rendering passes. Add editor regressions for opaque RGB/alpha, all sixteen alpha levels in pixel order, and partial blocks with buffer-tail protection.

* Document Unity CI after disabling the Codacy integration
2026-11-12 02:28:17 +08:00
Jiaqi Liu b1d9e3b0ac Bug fix + Bump Unity version + Update copyright text
- Fixed a bug caused by inconsistent state check between managed and native object.
- Bump Unity version.
- Update copyright text
2025-03-05 21:13:59 -08:00
Jiaqi Liu 2bb0d5e2f3 Upgrade to Unity 6 LTS 2024-10-17 21:37:38 -07:00
Jiaqi Liu 264db76be5 Move combat related code to Combat folder 2024-09-21 03:46:09 -07:00
Jiaqi Liu 991bb6823b Code refactoring: Use explicit type instead of var
Code refactoring: Use explicit type instead of var
2024-09-09 03:41:55 -07:00
Jiaqi Liu 7abe307bd1 Code refactoring 2024-01-07 03:30:05 -08:00
Jiaqi Liu b8bb1e018f Update header 2024-01-07 02:37:35 -08:00
Jiaqi Liu 18e3fb68ad Bump year in license 2024-01-01 05:15:04 -08:00
Jiaqi Liu ae08e1ff92 Code refactoring 2023-10-25 21:00:54 -07:00
Jiaqi Liu de98baab9b Code refactoring 2023-10-23 06:47:55 -07:00
Jiaqi Liu bdcb7fa784 Code refactoring 2023-10-21 18:08:23 -07:00
Jiaqi Liu 8ef806cca0 Fixed script var value type + code refactoring 2023-10-20 01:59:59 -07:00
Jiaqi Liu 9f4c731069 Code refactoring 2023-10-18 00:20:55 -07:00
Jiaqi Liu 3792944d10 Code refactoring + perf optimizations 2023-10-15 23:52:39 -07:00
Jiaqi Liu 3a6016f94e Texture2D and Sprite abstraction 2023-10-14 04:08:46 -07:00
Jiaqi Liu 1a03b20e0e More abstractions and bug fixes 2023-10-11 20:49:46 -07:00
Jiaqi Liu 8b265c5459 Reduce heap allocation when re-using Mv3ModelRenderer 2023-10-09 20:35:23 -07:00
Jiaqi Liu 4e85f6ef9f More factorings 2023-10-08 21:11:33 -07:00
Jiaqi Liu 77cc03d167 Bug fixes and code refactoring 2023-10-08 18:40:18 -07:00
Jiaqi Liu 01a586e028 Abstract YieldInstructions 2023-10-08 17:51:04 -07:00
Jiaqi Liu f3da6151eb Get rid of UnityEngine.Time dependency in game code 2023-10-07 22:41:54 -07:00
Jiaqi Liu 72b14f8069 More abstractions to make game code engine agnostic 2023-10-06 20:50:21 -07:00
Jiaqi Liu 5fb27d643e Namespace refactoring 2023-10-04 17:45:26 -07:00