Skip to content

Commit

Permalink
Update README.md and add README.en-US.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7c13 committed Mar 24, 2023
1 parent ddc1e75 commit 74a1cd8
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 6 deletions.
75 changes: 75 additions & 0 deletions README.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<p align="center">
<img width="128" align="center" src="Assets/Resources/UI/game-icon-PAL3.png">
+
<img width="128" align="center" src="Assets/Resources/UI/game-icon-PAL3A.png">
</p>
<h1 align="center">
Pal3.Unity
</h1>
<p align="center">
The Legend of Sword and Fairy 3 & The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian re-implementation using C#/Unity
</p>
<p align="center">
<a style="text-decoration:none">
<img src="https://img.shields.io/badge/unity-2022.2.12-blue?style=flat-square" alt="Unity Version" />
</a>
<a style="text-decoration:none">
<img src="https://img.shields.io/badge/platform-Linux%20%7C%20Win%20%7C%20Mac%20%7C%20iOS%20%7C%20Android-orange?style=flat-square" alt="Platform" />
</a>
<a style="text-decoration:none">
<img src="https://img.shields.io/badge/license-GPL--3.0-green?style=flat-square" alt="License" />
</a>
<a style="text-decoration:none">
<img src="https://img.shields.io/github/repo-size/jasonstein/pal3.unity?style=flat-square" alt="Size" />
</a>
<a style="text-decoration:none" href="https://github.com/0x7c13/Pal3.Unity/actions/workflows/main.yml">
<img src="https://img.shields.io/github/actions/workflow/status/0x7c13/Pal3.Unity/main.yml" alt="Size" />
</a>
</p>

README: [简体中文](README.md) | English

# Intro
This is an open-source project that re-implements [The Legend of Sword and Fairy 3](https://en.wikipedia.org/wiki/Chinese_Paladin_3) and [The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian](https://en.wikipedia.org/wiki/Chinese_Paladin_3_Gaiden:_Wenqing_Pian) using C#/Unity. The implementation involves rewriting of the game logic, loading and utilizing the original game assets, and recreating the original game's behavior and effects. Please refer to the source code to see how it is been made.

Note: The Legend of Sword and Fairy 3 and The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian are original works of Softstar Technology (Shanghai) Co., Ltd., with copyrights belonging to Softstar Technology (Shanghai) Co., Ltd. and Softstar International Inc. (I might be wrong but please verify yourself). This project does not contain any game data from the original game. The project is under the GPL-3.0 license but is limited to the code of this project excluding Unity assets and other assets and plugins that I used and get from Unity Asset Store. Any textures, audio, video, or game data related to The Legend of Sword and Fairy 3 or The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian are not covered by this license.

## Why make this
After learning Unity for a few weeks, I've been looking for a project to practice. After sometme, I discovered the [PAL3patch](https://github.com/zhangboyang/PAL3patch) project by created by zby and the [OpenPAL3](https://github.com/dontpanic92/OpenPAL3) project created by dontpanic92, which made the re-implementation of a remake for The Legend of Sword and Fairy 3 possible. As for why I chose C#/Unity, there are two reasons: First, Unity has excellent cross-platform support and packaging, and second, Unity provides native IDE support for Mac with M1/M2 chips (Why? I spend about half of my time coding on a Macbook). Although this project barely uses most of Unity's engine features, especially its editor features, since it's almost 100% code-based, it could theoretically be ported to other engines that support C# scripting with minimal effort.

## How to run the project
Open the current project folder using Unity 2022.2.X. For the specific Unity version required for the current project, please check the badge displayed above. In theory, any Unity 2022.2+ version should work. You can also try a lower version to see if it builds.
Since the project itself does not contain any game data from the original game, you will need a copy of the original game files for The Legend of Sword and Fairy 3 or The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian (Link to the game on Steam: [The Legend of Sword and Fairy 3](https://store.steampowered.com/app/1536070) and [The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian](https://store.steampowered.com/app/1536080); Note: currently the build only supports Simplified Chinese version).

After opening the Unity project for the first time, double-click to select "Scenes\Game" as the current scene, and then press the play button. If you select "Scenes\ResourceViewer", it will open the game resource viewer.
The first time you open it, a folder selection window will automatically pop up. Please select the installation folder for The Legend of Sword and Fairy 3 (or The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian) on your computer.
Since the original game's cutscene videos are in Bink format, which Unity does not natively support, please convert the videos to a format supported by Unity and place them in the movie folder at the game's root directory (most devices and platforms support mainstream formats like .mp4, while Linux only supports .webm format).
Linux users can use FFmpeg to convert videos to .webm format (vp8 + vorbis): ffmpeg -i input.mp4 -c:v libvpx -b:v 3M -c:a libvorbis output.webm
Note: You need to first decompress the OG game data to get the .bik videos. You can do this by running "ExtractAllCpkArchives" command under "Scenes\ResourceViewer" scene.

## How to Run the game on Handheld Devices
In runtime, all platforms use the Application.persistentDataPath directory to read the orignal game data by default. For the specific location of this directory, please refer to the Unity documentation: [Application.persistentDataPath](https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Application-persistentDataPath.html)
After installing the game on a handheld device for the first time, run it once, then connect the handheld device to your computer and copy the entire The Legend of Sword and Fairy 3 original game directory to the persistent directory. If it is The Legend of Sword and Fairy 3, the folder name must be PAL3; if it is The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian, the folder name must be PAL3A.
For iOS devices, use iTunes to share the folder with the game application. You can also copy the files into [StreamingAssets](https://docs.unity3d.com/2022.2/Documentation/Manual/StreamingAssets.html) and use it for the build.

## How to Switch Between two variants of the game
The version switching is implemented through [Custom scripting symbols](https://docs.unity3d.com/2022.2/Documentation/Manual/CustomScriptingSymbols.html). PAL3 corresponds to The Legend of Sword and Fairy 3, and PAL3A corresponds to The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian. I added a shortcut button in the Unity editor menu bar for one-click switching (Menu bar->Pal3->Switch Variant->PAL3A). After switching, the corresponding game folder will automatically change from PAL3 to PAL3A.

## Screenshots with realtime lighting and toon shading enabled
![PAL3 卡通渲染+光影](Screenshots/PAL3_ToonShading_Lighting.png?raw=true)
![PAL3A 卡通渲染+光影](Screenshots/PAL3A_ToonShading_Lighting.png?raw=true)
![PAL3 卡通渲染+光追](Screenshots/PAL3_ToonShading_RayTracing.png?raw=true)

## About VFX and Toon Rendering
Note: All currently implemented special effects and toon rendering in the game use resources from the Unity Asset Store, so there is no way to open-source this part of the implementation (VFX Prefabs and Toon shader). The project will use the open-source Shader for rendering by default (consistent with the original game's rendering style), and VFX will not be displayed in your cloned project (it won't affect the build and run of the project).

## Controls and Operations
- Mouse and keyboard: Left mouse button to click and control character movement (arrow keys can also be used), A/D to control camera rotation, Spacebar to interact with nearby items or NPCs (also used as the jump button when available), M key to toggle the big map, U key or ESC key to open the story selection menu, Tab key to switch characters (in the maze).
- Gamepad: Left joystick to control character movement, right joystick to control camera rotation, use gamepad south button to interact, menu and select buttons corresponding to the map and story selection menu, LB/RB to switch to the previous/next character (in the maze).
- Touchscreen: Only enabled on handheld devices with a touch screen, virtual joystick for movement, interaction button for interaction.

## Project State and Roadmap
The story parts of The Legend of Sword and Fairy 3 and The Legend of Sword and Fairy 3 Gaiden: Wenqing Pian are complete. Both games can be played entirely from start to finish to experience the story, and the story selection menu provided in the game can be used to jump to different story points in the game. Most of the switches and puzzles in the mazes in both games have also been implemented, but combat, mini-games, and various systems and features related to supporting the combat system have not been implemented. In addition, the main menu and most of the UI/UX need to be redesigned and implemented.

## How to Contribute?
Since the project is still in the early stages of implementation, many systems have not yet been implemented, and I am temporarily not accepting large Pull Requests, especially feature ones. If you have good ideas, suggestions, or have discovered bugs, please feel free to submit an issue or leave a message in the discussion page.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
</a>
</p>

README: 简体中文 | [English](README.en-US.md)

# 简介
这是一个使用C#/Unity重新实现的仙剑奇侠传三以及仙剑奇侠传三外传的开源项目,注意:不是移植,是重写/利用原始游戏资源从零开始重新实现。仙剑奇侠传三以及仙剑奇侠传三外传属于原上海软星作品,版权属于软星科技以及大宇公司所有,本项目不包含任何仙剑奇侠传三以及仙剑奇侠传三外传的游戏本体数据。本项目的实现方式为运行时读取仙剑奇侠传三原始游戏数据实现,具体实现方法请见源代码。本项目遵循GPL-3.0协议,但仅限于此项目的代码,任何与仙剑奇侠传三或者外传有关的图片,音视频,游戏数据均不在此范围,任何未经版权方许可的情况下使用仙剑奇侠传三或者外传游戏数据进行商业行为都是违法的。
这是一个使用C#/Unity重新实现的仙剑奇侠传三以及仙剑奇侠传三外传的开源项目(注意:不是移植,是重写)。实现方式为重写游戏逻辑和加载读取利用原始游戏资源并按照原始游戏的运行方式和效果进行的重新实现,具体实现方法请阅读源代码。

注意:仙剑奇侠传三以及仙剑奇侠传三外传属于原上海软星作品,版权属于软星科技以及大宇公司所有,本项目不包含任何仙剑奇侠传三以及仙剑奇侠传三外传的游戏本体数据。本项目遵循GPL-3.0协议,但仅限于此项目的代码,任何与仙剑奇侠传三或者外传有关的图片,音视频,游戏数据均不在此范围,任何未经版权方许可的情况下使用仙剑奇侠传三或者外传游戏数据进行商业行为都是违法的。

## 为什么要做这个?
学了几周Unity,想找项目练手,一开始自己尝试做了一下新仙剑的第一关,大概了解了RPG游戏的制作流程,后因机缘巧合发现了zby大佬的[PAL3patch](https://github.com/zhangboyang/PAL3patch)项目以及dontpanic92大佬的[OpenPAL3](https://github.com/dontpanic92/OpenPAL3)项目,所以给技术上实现仙三复刻带来了可能。至于为什么选择C#/Unity?选择Unity的原因有两点,第一是Unity对全平台全端的打包做的很好很方便,第二个是Unity提供Mac上arm64原生IDE支持(我大概有一半时间是在Mac上写代码的)。当然其实本项目的实现几乎没有用到Unity引擎的大部分功能,特别是编辑器功能,因为几乎是100%纯代码实现的,所以其实理论上不需要花太大的代价就可以把本项目移植到其他支持C#脚本的引擎中。
学了几周Unity之后,一直想找项目练手,一开始自己尝试做了一下新仙剑的第一关,大概了解了RPG游戏的制作流程,后因机缘巧合发现了zby大佬的[PAL3patch](https://github.com/zhangboyang/PAL3patch)项目以及dontpanic92大佬的[OpenPAL3](https://github.com/dontpanic92/OpenPAL3)项目,所以给技术上实现仙三复刻带来了可能。至于为什么选择C#/Unity?选择Unity的原因有两点,第一是Unity对全平台全端的支持和打包做的很好很方便,第二个是Unity提供Mac上arm64原生IDE支持(我大概有一半时间是在Mac上写代码的)。当然其实本项目的实现几乎没有用到Unity引擎的大部分功能,特别是编辑器功能,因为几乎是100%纯代码实现的,所以其实理论上不需要花太大的代价就可以把本项目移植到其他支持C#脚本的引擎中。

## 如何运行项目
使用 Unity 2022.2.X 打开当前项目文件夹即可,具体当前项目所需要的Unity版本请查看上面的Badge显示的版本,理论上任何Unity 2022.2+版本都没问题。
Expand All @@ -44,26 +48,26 @@
## 如何在手持设备上运行
- 在打包后的运行时,所有平台都默认使用Application.persistentDataPath目录读取仙剑三文件,具体这个目录在哪里,根据平台决定,请阅读Unity文档:[Application.persistentDataPath](https://docs.unity3d.com/2022.2/Documentation/ScriptReference/Application-persistentDataPath.html)
- 第一次安装游戏到手持设备后,请先运行一次,然后将手持设备连接电脑,拷贝整个仙剑奇侠三(或者外传)原游戏目录到游戏App目录下即可,如果是仙剑三,文件夹的名必须为PAL3,如果是仙剑三外传,文件夹名必须为PAL3A。
- iOS设备请使用iTunes将文件夹共享给游戏应用
- iOS设备请使用iTunes将文件夹共享给游戏应用或者自己打包游戏原始数据到 [StreamingAssets](https://docs.unity3d.com/2022.2/Documentation/Manual/StreamingAssets.html) 文件夹下

## 如何切换仙剑奇侠传三/仙剑奇侠传三外传
版本的切换是靠Define symbol实现的,PAL3对应仙剑奇侠传三,PAL3A对应仙剑奇侠传三外传。我在Unity编辑器菜单栏里面加了一个快捷按钮可以一键切换(菜单栏->Pal3->Switch Variant->PAL3A),切换之后对应的游戏文件夹也自动的从PAL3转换成PAL3A。
两部游戏版本在项目中的切换是靠 [Custom scripting symbols](https://docs.unity3d.com/2022.2/Documentation/Manual/CustomScriptingSymbols.html) 实现的,PAL3对应仙剑奇侠传三,PAL3A对应仙剑奇侠传三外传。我在Unity编辑器菜单栏里面加了一个快捷按钮可以一键切换(菜单栏->Pal3->Switch Variant->PAL3A),切换之后对应的游戏文件夹也自动的从PAL3转换成PAL3A。切换的过程中,包括Symbol,图标和应用程序名在内的所有名称和标示都会由PAL3变为PAL3A

## 卡通渲染与光影下的截图
![PAL3 卡通渲染+光影](Screenshots/PAL3_ToonShading_Lighting.png?raw=true)
![PAL3A 卡通渲染+光影](Screenshots/PAL3A_ToonShading_Lighting.png?raw=true)
![PAL3 卡通渲染+光追](Screenshots/PAL3_ToonShading_RayTracing.png?raw=true)

## 关于特效和卡通渲染
注意:游戏当前实现的所有特效以及卡通渲染部分使用了Unity Asset Store的资源,所以这部分实现(特效Prefab和Toon shader)没有办法开源。项目启动后默认会使用开源实现的Shader进行渲染(与原始游戏渲染风格一致),特效的话则会不显示。
注意:游戏当前实现的所有特效以及卡通渲染部分使用了Unity Asset Store的资源,所以这部分实现(特效Prefab和Toon shader)没有办法开源。项目启动后默认会使用开源实现的Shader进行渲染(与原始游戏渲染风格一致),特效的话则会不显示,注意:这并不会影响游戏的编译和运行

## 按键以及操作
- 鼠标键盘:鼠标左键点击操作人物行走方向(键盘方向键也可以),AD控制镜头旋转,空格与周边附近的物品或者NPC交互(也是跳跃键),M键打开大地图,U键或ESC键打开剧情选择菜单,Tab键切换角色(迷宫中)。
- 手柄:左摇杆控制人物行走,右摇杆控制镜头旋转,A键交互,菜单和选择按钮对应大地图和剧情选择菜单,LB/RB切换上一个/下一个角色(迷宫中)。
- 触屏:仅在有触摸屏的手持设备上才会启用,虚拟摇杆控制行走,交互键互动。

## 项目进度以及路线图
仙剑奇侠传三以及仙剑奇侠传三外传的剧情部分已经全部完成,两部游戏都可以完整的从头玩到尾体验一遍剧情,也可以使用游戏内提供的剧情选择菜单跳转至预设好的剧情时间点。两部游戏中的迷宫机关也基本全部实现,但是战斗,小游戏以及围绕支持战斗系统的各类系统和功能均尚未完成。另外主菜单和大部分界面也需要重新设计和实现(毕竟现在还要做手机端的适配)。
仙剑奇侠传三以及仙剑奇侠传三外传的剧情部分已经全部完成,两部游戏都可以完整的从头玩到尾体验一遍剧情,也可以使用游戏内提供的剧情选择菜单跳转至预设好的剧情时间点。两部游戏中的迷宫机关也基本全部实现,剧情中出现的大部分特效也已经重新实现。但是战斗,小游戏以及围绕支持战斗系统的各类系统和功能均尚未完成。另外主菜单和大部分界面也需要重新设计和实现(毕竟现在还要做手机端的适配)。

## 如何贡献?
因为项目还处于早期实现过程中,很多系统还没有实现,暂时不接受比较大的Pull request,特别是feature类型,如果您有好的想法,意见或者发现了Bug请欢迎提交issue或者加入交流群与我讨论。
Expand Down

0 comments on commit 74a1cd8

Please sign in to comment.