* 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
13 KiB
Pal3.Unity
<<仙剑奇侠传三>>和<<仙剑奇侠传三外传:问情篇>>C#/Unity实现
简体中文 | English
简介
这是一个使用C#/Unity重新实现的仙剑奇侠传三以及仙剑奇侠传三外传的开源项目(注意:不是移植,是重写)。实现方式为重写游戏逻辑和加载读取利用原始游戏资源并按照原始游戏的运行方式和效果进行的重新实现,具体实现方法请阅读源代码。
注意:仙剑奇侠传三以及仙剑奇侠传三外传属于原上海软星作品,版权属于软星科技以及大宇公司所有,本项目不包含任何仙剑奇侠传三以及仙剑奇侠传三外传的游戏本体数据。本项目遵循GPL-3.0协议,但仅限于此项目的代码,任何与仙剑奇侠传三或者外传有关的图片,音视频,游戏数据均不在此范围,任何未经版权方许可的情况下使用仙剑奇侠传三或者外传游戏数据进行商业行为都是违法的。
主分支当前编译状态
| 游戏版本 | Windows | Linux | MacOS | Android | iOS |
|---|---|---|---|---|---|
| 仙剑奇侠传三 | |||||
| 仙剑奇侠传三外传:问情篇 |
如何运行项目
使用 ProjectVersion.txt 指定的 Unity 版本打开项目。项目使用 URP Forward+。 因为项目本身不含有仙剑奇侠传三或仙剑奇侠传三外传的游戏数据,所以你需要持有一份仙剑三或外传的游戏原始文件(Steam或者方块游戏获得皆可)。
- 第一次打开Unity项目之后,先双击选择Scenes\Game作为当前场景,然后点播放键即可。如果选择Scenes\ResourceViewer,则会打开游戏资源查看器。
- 第一次打开的时候会自动弹出文件夹选择窗口,请选择当前电脑上仙剑奇侠传三(或者外传)的安装文件夹即可。
- 如果你在Steam获取的游戏是繁体中文版的,游戏中的文字会出现乱码,请在游戏设置里选择繁体中文版,然后重启游戏后即可生效。
- 因为原始游戏的过场动画为Bink格式,Unity并不原生支持,所以请自行转码视频为Unity所支持的格式放在游戏根目录下的movie文件夹即可(大部分设备和系统支持.mp4等主流格式视频,Linux下仅支持.webm格式视频)。
- Linux用户可以使用FFmpeg转码视频为.webm格式封装,首先您需要选择Scenes\ResourceViewer场景,然后点击"Extract all .cpk files"按钮来解压所有原始游戏中的.cpk压缩包(包含movie.cpk,所有的Bink动画文件均在这个压缩包中)
ffmpeg -i input.mp4 -c:v libvpx -b:v 3M -c:a libvorbis output.webm // vp8 + vorbis
如何在终端设备上运行游戏
- 在打包后的运行时,第一次游戏启动的时候,游戏会搜索 Application.persistentDataPath 目录或者 StreamingAssets 目录来检测游戏数据是否存在。在桌面版本的游戏中,如果未能检测到原始游戏的数据文件,游戏则会弹出文件夹选择窗口,请选择当前设备上原游戏安装文件的根目录即可。
- 如果上一步未成功,请拷贝整个仙剑奇侠三(或者外传)原游戏目录到 Application.persistentDataPath 下即可。注意:如果自行拷贝游戏数据至这个目录的话,如果是仙剑三,文件夹的名称必须为PAL3,如果是仙剑三外传,文件夹名必须为PAL3A。iOS设备请使用iTunes将文件夹共享给游戏应用(这个位置就是persistentDataPath所在的地方)或者在编译时自行打包游戏原始数据到StreamingAssets文件夹下也可。
如何切换仙剑奇侠传三/仙剑奇侠传三外传
两部游戏版本在项目中的切换是靠 Custom scripting symbols 实现的,PAL3对应仙剑奇侠传三,PAL3A对应仙剑奇侠传三外传。我在Unity编辑器菜单栏里面加了一个快捷按钮可以一键切换(菜单栏->Pal3->Switch Variant->PAL3A),切换之后对应的游戏文件夹也自动的从PAL3转换成PAL3A。切换的过程中,包括Symbol,图标和应用程序名在内的所有名称和标示都会由PAL3变为PAL3A。
旧版卡通渲染截图
关于特效和卡通渲染
两作都默认使用 URP 原版画风,保留原作贴图、烘焙光照和透明混合。可在「游戏设置 → 画风」选择「卡通与实时光影」,重启后生效。两档都使用仓库内的 shader,运行时从玩家本地读取原版游戏资源。
「游戏设置 → 画面与特效设置」提供接触阴影、角色光照、增强夜景火光和火光投影四个独立开关,在卡通画风中即时生效。接触阴影和火光投影在桌面设备默认开启,手持设备可按需开启。夜景火光使用暖色灯光与冷色环境底色。火光投影也适用于暗色迷宫,桌面默认四盏,控制台可通过 Settings.ToonFireShadowBudget 设置 0–4 盏,阴影图集随预算扩容。泛光可以独立开关,默认仅桌面原版画风开启。
上方截图来自旧版卡通渲染。可选剧情特效默认关闭。请在本地安装与 URP 兼容的编号预制体到 Assets/Resources/Prefabs/VFX/PAL3/ 或 Assets/Resources/Prefabs/VFX/PAL3A/,再启用「可选剧情特效」。关闭时会立即隐藏当前可选特效。重新启用后,仍在场景中的持续特效会恢复,后续触发的剧情特效会照常显示。
公开构建请使用未导入本地付费素材的全新检出。若工程中有可选特效预制体、Hovl Studio、RealToon 或旧版卡通材质,Unity 会阻止构建。仅供个人使用的构建可通过环境变量 PAL3_ALLOW_PRIVATE_ASSETS=1 启动本地 Unity 来显式启用。工程打包菜单会将这类构建输出到带 -Private 后缀的版本目录。
按键以及操作
- 鼠标键盘:鼠标左键点击操作人物行走方向(键盘方向键也可以),AD控制镜头旋转,空格与周边附近的物品或者NPC交互(也是跳跃键),M键打开大地图,U键或ESC键打开剧情选择菜单,Tab键切换角色(迷宫中)。
- 手柄:左摇杆控制人物行走,右摇杆控制镜头旋转,A键交互,菜单和选择按钮对应大地图和剧情选择菜单,LB/RB切换上一个/下一个角色(迷宫中)。
- 触屏:仅在有触摸屏的手持设备上才会启用,虚拟摇杆控制行走,交互键互动。
项目进度以及路线图
仙剑奇侠传三以及仙剑奇侠传三外传的剧情部分已经全部完成,两部游戏都可以完整的从头玩到尾体验一遍剧情,也可以使用游戏内提供的剧情选择菜单跳转至预设好的剧情时间点。两部游戏中的迷宫机关也基本全部实现,剧情中出现的大部分特效也已经重新实现。但是战斗,小游戏以及围绕支持战斗系统的各类系统和功能均尚未完成。另外主菜单和大部分界面也需要重新设计和实现(毕竟现在还要做手机端的适配)。
如何贡献?
因为项目还处于早期实现过程中,很多系统还没有实现,暂时不接受比较大的Pull request,特别是feature类型,如果您有好的想法,意见或者发现了Bug请欢迎提交issue或者加入交流群与我讨论。 另外您还可以参考这个项目解析视频:https://www.bilibili.com/video/BV1Pr4y167sF
为什么要做这个?[TL;DR]
学了几周Unity之后,一直想找项目练手,一开始自己尝试做了一下新仙剑的第一关,大概了解了RPG游戏的制作流程,后因机缘巧合发现了zby大佬的PAL3patch项目以及dontpanic92大佬的OpenPAL3项目,所以给技术上实现仙三复刻带来了可能。至于为什么选择C#/Unity?选择Unity的原因有两点,第一是Unity对全平台全端的支持和打包做的很好很方便,第二个是Unity提供Mac上arm64原生IDE支持(我大概有一半时间是在Mac上写代码的)。当然其实本项目的实现几乎没有用到Unity引擎的大部分功能,特别是编辑器功能,因为几乎是100%纯代码实现的,所以其实理论上不需要花太大的代价就可以把本项目移植到其他支持C#脚本的引擎中。
社区
- 仙剑三(及外传)复刻版讨论群:252315306
- 仙剑三(及外传)复刻版开发群:330680869


