Files
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

74 lines
4.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ------------------------------------------------------------------------
// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ------------------------------------------------------------------------
#if PAL3
namespace Pal3.Game.Script.Patcher
{
using System.Collections.Generic;
using Constants;
using Core.Command;
using Core.Command.SceCommands;
using Core.Contract.Constants;
public sealed class PalScriptPatcher : IPalScriptPatcher
{
public Dictionary<string, ICommand> PatchedCommands => new ()
{
{
$"{936}_{PalScriptType.Scene}_{1284}_韩用-小四_{56}_{typeof(DialogueRenderTextCommand)}",
new DialogueRenderTextCommand($"知道吗?您现在玩的{GameConstants.AppNameCNFull}是由\\i柒才\\r使用C#/Unity开发(完全重写)的复刻版," +
"免费开源且支持全平台(Win/Mac/Linux/iOS/Android)。" +
"如果您是花钱得到的,那么恭喜您成为盗版游戏的受害者。" +
"当前游戏还在开发中,包括战斗在内的很多功能尚未实现,请耐心等待。" +
"也欢迎加入Q群与作者联系或下载最新版:\\i252315306\\r," +
"您也可以在B站关注Up主\\i@柒才\\r获取最新开发信息!另外,全平台都支持手柄哦~")
},
{
$"{950}_{PalScriptType.Scene}_{1284}_韓用-小四_{56}_{typeof(DialogueRenderTextCommand)}",
new DialogueRenderTextCommand($"知道嗎?您現在玩的{GameConstants.AppNameCNFull}是由\\i柒才\\r使用C#/Unity開發(完全重寫)的復刻版," +
"免費開源且支持全平台(Win/Mac/Linux/iOS/Android)。" +
"如果您是花錢得到的,那麼恭喜您成為盜版遊戲的受害者。" +
"目前遊戲還在開發中,包括戰鬥在內的很多功能尚未實現,請耐心等待。" +
"也歡迎加入Q群與作者聯絡或下載最新版:\\i252315306\\r," +
"您也可以在B站關注Up主\\i@柒才\\r獲取最新開發信息!另外,全平台都支持摇杆哦~")
},
{
$"{936}_{PalScriptType.Scene}_{1005}_龙葵苏醒2_{3891}_{typeof(ActorPathToCommand)}",
new ActorPathToCommand(ActorConstants.PlayerActorVirtualID, 288, 20, 0)
},
{
$"{950}_{PalScriptType.Scene}_{1005}_龍葵甦醒2_{3891}_{typeof(ActorPathToCommand)}",
new ActorPathToCommand(ActorConstants.PlayerActorVirtualID, 288, 20, 0)
},
{
$"{936}_{PalScriptType.Scene}_{1001}_初到镇江_{392}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(1, 318, 142, 0)
},
{
$"{950}_{PalScriptType.Scene}_{1001}_初到鎮江_{392}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(1, 318, 142, 0)
},
{
$"{936}_{PalScriptType.Scene}_{1001}_初到镇江_{688}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(3, 327, 140, 0)
},
{
$"{950}_{PalScriptType.Scene}_{1001}_初到鎮江_{688}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(3, 327, 140, 0)
},
{
$"{936}_{PalScriptType.Scene}_{1001}_初到镇江_{930}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(4, 346, 137, 0)
},
{
$"{950}_{PalScriptType.Scene}_{1001}_初到鎮江_{930}_{typeof(ActorMoveToCommand)}",
new ActorPathToCommand(4, 346, 137, 0)
}
};
}
}
#endif