Skip to content

Commit

Permalink
Migrate developer wiki to main wiki
Browse files Browse the repository at this point in the history
 - See #40 for other docs which are not yet migrated
  • Loading branch information
drojf committed Sep 4, 2022
1 parent 12dc0e2 commit 4076574
Show file tree
Hide file tree
Showing 19 changed files with 1,401 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/developer/legacy/adv-mode-and-lipsync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Written by [@enumag](https://github.com/enumag/).

The main thing to do here is to run the compiler script `higurashi:full-arc-upgrade`. See the [compiler documentation](https://github.com/07th-mod/higurashi-dev-guides/wiki/How-to-use-higurashi-patch-compiler#higurashifull-arc-upgrade-arc) for details.

TODO: things to do before running the script, things to do after running the script, possibly a video covering the work with fixing bugs etc.
335 changes: 335 additions & 0 deletions docs/developer/legacy/code-overview.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions docs/developer/legacy/technical-details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
> Written by @ItaloKnox
![code_2018-02-16_08-25-23](https://user-images.githubusercontent.com/4702556/36303352-0b09818e-12f3-11e8-9acc-49284797c69a.jpg)

The patch installer (pictured above) was built entirely in [Advanced Installer](http://advancedinstaller.com/). It consists of two parts, which are going to be covered by this article:

1. The main framework (built in Advanced Installer)
2. The installation code (built in Windows batch)

The installer uses the default installation method, with no complex changes. The executable bundles all the dependencies ([aria2c](http://aria2.sourceforge.net/), [7z](http://7-zip.org/)) and a script (sample below) that pulls the latest installer code from our [Resources repository](https://github.com/07th-mod/resources/). It can be easily replaced with a zip containing all the dependencies, a better script that handles the download using available base command line tools or a different installer creator.

```batch
@echo off
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
call :colorEcho a0 "Removing the current installation script..."
echo.
call :colorEcho 0a "If you get an error, this is completely normal!"
echo.
del .\install.bat > nul
timeout /t 2 > nul
call :colorEcho a0 "Downloading the installation script..."
echo.
timeout /t 3 > nul
.\aria2c.exe -o install.bat https://raw.githubusercontent.com/07th-mod/resources/master/onikakushi/install.bat
call :colorEcho a0 "Running the installation script..."
echo.
timeout /t 3 > nul
call install.bat
exit
:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
```

After the user selects the install folder and start the installation, the installer will unpack the dependencies into a folder called ``temp``, that is located at ``HigurashiEp**_Data`` (where ``**`` equals the chapter number). This ``temp`` folders holds all the base files to install the patch, as pictured below:

![firefox_2018-02-16_08-38-32](https://user-images.githubusercontent.com/4702556/36303874-cdd24132-12f4-11e8-90e9-ed04e3cef1b0.png)

* ``7za.exe``, ``7za.dll`` and ``7zxa.dll`` are 7-zip dependencies required to extract the patch.
* ``aria2c.exe`` is a dependency required to download the patch.
* ``Onikakushi Patch Installer.exe`` is a converted Windows batch file (``*.bat``) that uses the code sampled above. We have a flaw in Advanced Installer that makes us unable to call Powershell using a regular ``.bat`` instead of the ``.exe`` file. See the next page for more details.
* ``installer.bat`` is the file pulled from our [Resources repository](https://github.com/07th-mod/resources/) to download and install the patch. See the next page for more details.
* ``updater.bat`` is the file pulled from our [Resources repository](https://github.com/07th-mod/resources/) to update the patch without requiring a new installation. It uses the file ``local.txt`` (that holds the link to the latest patch) to keep the version tracking. See the next page for more details.

The current installer settings ends prematurely leaving only the command line window (that runs ``installer.bat``) open. This is a known issue, but it doesn't affect the usage or installation. The ideal scenario would be to have the installation window close after the command line window finished working, closing the two at the same time and showing the success message.

For the breakdown on how the installation code works, see the next page: [Code overview](https://github.com/07th-mod/higurashi-dev-guides/wiki/code-overview).
5 changes: 5 additions & 0 deletions docs/developer/misc/git-line-endings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
We have had some issues in the past with windows/unix line endings. This issue should be fixed now when using the new installer, as it automatically converts .bat files to windows line endings. However, if installing manually could still be an issue.

This stackoverflow answer describes how to show the actual stored line endings of a file: [https://stackoverflow.com/a/35204436/848627](https://stackoverflow.com/a/35204436/848627). It uses the Git `ls-files` command.

If you're committing to the `resources` directory and have many files listed as 'changed' even though you didn't change anything, consider deleting the .gitconfig file in your local repository (but don't commit it).
17 changes: 17 additions & 0 deletions docs/developer/overview/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Here is the list of the main features in out patches. Each feature should later have it's own page with documentation how the feature was implemented and how to replicate it for future chapters along with all the resources necessary to do so.

----------
|Feature|Credits|
|--|--|
|Voices from PS2 and PS3 versions|@enumag (voice insertion script), @ItaloKnox (main work)|
|Backgrounds, sprites and CGs from PS3|@Grelo, @IriPM|
|Weather sprites|@Grelo, @IriPM|
|Updated MG sprites|@jwgrlrrajn|
|ADV-mode|@enumag (automatic script), @Grelo (text background image)|
|DLL updates|@P-Chang (original contributor), @DoctorDiablo (current maintainer), @enumag (update script)|
|LipSync|@P-Chang (original contributor), @DoctorDiablo (current maintainer), @enumag (update script)|
|PS3 Poems|@DoctorDiablo, @ItaloKnox|
|Moving backgrounds|@P-Chang|
|New UI|@Inochi-PM, @Nozoki17|
|New scenes and translations improvements|@Norgus, @DoctorDiablo, @ItaloKnox|
|Patch installers|@ItaloKnox|
6 changes: 6 additions & 0 deletions docs/developer/overview/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Welcome to the Higurashi developer wiki!

This wiki is currently being moved and takes a long time to be updated. Because of that, some information might be old and not used anymore, but it is still up for reference.
The team is working very hard to make sure all documentation is properly written and updated as soon as possible, but this might take some time.

If you are familiar with our workflow, please contribute by writing missing pages or updating information that doesn't reflect the current state of the patch.
83 changes: 83 additions & 0 deletions docs/developer/overview/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Written by [@enumag](https://github.com/enumag/).

# Main process

This section covers the main process of creating a patch for each new chapter.

Step 1: Voices
----

1. [Run voice insertion script.](https://github.com/07th-mod/higurashi-dev-guides/wiki/Automated-voice-inserter)
2. Fix the rest manually (link).
3. Release a voices-only patch.

Step 2: Graphics patch
----

It is recommended to have at least the automatic voice insertion completed first to avoid conflicts.

TODO: We need to make a new workflow for this based on our recent rework of the graphics patches.

Step 3: ADV-mode
----

Steps 1 and 2 are required for this. The game should still run with vanilla DLL after this step.

Run ADV-mode update script (link).

TODO: First release should probably happen either after this step or after DLL updates.

Step 4: DLL update
----

1. DLL hacking (link). Note: This can be started right away when a new chapter comes out. No need to wait for the previous steps to be completed.
2. Run update script. This requires all previous steps to be completed first.

Step 5: LipSync
----

1. DLL hacking (link). This can be done together with Step 4 DLL hacking.
2. Run update script. This requires all previous steps to be completed first.

TODO: LipSync update script needs to be separated from new graphics patches update.

# Other tasks

These tasks can generally be done at any time during the process.

MG patch
----

The first 2 steps need to be completed first, then this can be done at any time and doesn't block anything.

(link)

PS3 poems
----

TODO (Applies for question arcs only.)

Moving backgrounds
----

TODO

New UI
----

TODO

New scenes and translations improvements
----

TODO

Sui Soundtrack
----

TODO

Patch installers
----

TODO
34 changes: 34 additions & 0 deletions docs/developer/overview/patch-folder-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Patch folder structure

> Written by @ItaloKnox
To make the installation as simple as possible, we can take advantage of nested folders to cut down the installation steps and greatly reduce the number of actions the installer requires to take. In the section below, you can see all the nested folders currently used in our patch. **It is greatly recommended to follow the example to the letter.**

## Nested folders

> HigurashiEp0``*``_data, where ``*`` is the chapter number. For example, Onikakushi = 1, Meakashi = 5.
- *-CGAlt.7z
- ``HigurashiEp0*_data/StreamingAssets/CGAlt``

- *-CG.7z
- ``HigurashiEp0*_data/StreamingAssets/CG``
- *-Voices.7z
- ``HigurashiEp0*_data/StreamingAssets/voice``
- ``HigurashiEp0*_data/StreamingAssets/spectrum``
- ``CHAPTER TITLE``.Voice.and.Graphics.Patch.*\.zip
- ``HigurashiEp0*_data/Managed``
- ``HigurashiEp0*_data/Plugins``
- ``HigurashiEp0*_data/StreamingAssets``
- *-UI.7z
- ``HigurashiEp0*_data/sharedassets0.assets``
- ``HigurashiEp0*_data/sharedassets0.assets.resS`` (from Chapter 3 - Tatarigoroshi onward)
- *-Movie.7z
- ``HigurashiEp0*_data/StreamingAssets/movies``

In **ConsoleArcs** only:

- *-BGM.7z
- ``HigurashiEp04_data/StreamingAssets/BGM``
- *-SE.7z
- ``HigurashiEp04_data/StreamingAssets/SE``
114 changes: 114 additions & 0 deletions docs/developer/patch-compiler/how-to-use-higurashi-patch-compiler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Written by [@enumag](https://github.com/enumag/).

Generally it's a collection of console scripts to easily do some changes in the higurashi game scripts and/or to analyze them to discover likely mistakes and make the work on other parts of the patch easier.

The voice inserter is not part of this repository only because it's older and there is a little benefit for integrating it now.

In this guide I'll cover how to make it work, how to use the scripts and which command is for what. Note that many of the commands are now obsolete and I'll intentionally skip them.


Installation
----

The voice inserter script is written in PHP and you can find it in this [repository](https://github.com/07th-mod/higurashi-patch-compiler).

To run it you'll need PHP 7.1+. Some modules that are not enabled by default might be necessary too but I can't remember which. It should be relatively easy to find it out from the errors.

You will also need [composer](https://getcomposer.org/) to install some PHP libraries.

Some of the commands (mainly those related to ADV mode) require a MySQL database (MariaDB should work too). I also recommend to get a tool like [adminer](https://www.adminer.org/) to browse the database and run commands.

When everything is installed check your installation using `php -v` and `composer --version`.

Finally download or `git clone` the [compiler repository](https://github.com/07th-mod/higurashi-patch-compiler).


Preparation
----

Run composer install in the compiler root directory (where composer.json file is located).

Create a MySQL database and run the database.sql file in it. I usually do it using adminer.

Copy the `config/local.example.yml` to `config/local.yml` and adjust the database connection parameters to match your database.


Commands
----

You can run the commands using `php console.php <command> [<parameters>]`. For full list of commands run `php console.php list`. Any command not listed on this page is either new, internal (used by other commands) or obsolete. Avoid using them unless you really know what you're doing.

Most of the commands will put the updated scripts into `temp/<directory>` where directory should match the command you're running.

## `higurashi:full-arc-upgrade <arc>`

Fully upgrades a newly released MG arc or a newly translated console arc with ADV mode, DLL updates and LipSync.

`<arc>` = name of the arc you want to upgrade, for example `higurashi:full-arc-upgrade someutsushi`. Shortcuts are supported so `higu:full some` is equivalent.

This command internally uses `higurashi:adv`, `higurashi:dll-update`, `higurashi:lip-sync`, `higurashi:voice-pack`, `higurashi:sprite-pack` and other commands. It's basically the all-in-one upgrade.

The output files will be available in `temp/full-upgrade` directory.

Note: for regular MG arc, the PS3 voices and graphics patch should be done before using this.

Aside from the updated scripts there will be some sh files to generate sprite packs (including lipsync sprites) and voice packs (including spectrum files). To use these shell scripts you will need to prepare a directory structure with the PS3 sprites and voices. See this issue for details: https://github.com/07th-mod/onikakushi/issues/103 (Note: download links in that issue are outdated and won't work anymore. The devs have access to the backups.)

## `higurashi:voice-pack`

Simple script to generate an sh script to prepare `voice` + `spectrum` directories for a chapter. For now it's mainly useful for the console arcs since they don't use PS2 voices.

The output files will be available in `temp/voicepack` directory.

Unlike `higurashi:voices` it doesn't make any changes to the scripts. This means that the scripts have to use the correct convention for voice paths for this script to be used. Therefore this command is the one to use long-term while `higurashi:voices` is getting obsolete.

Note: PS2 files are not yet supported. This will have to be implemented later. The problem is that in same cases it might not be possible to copy PS2 voices automatically since they have wrong directory structure and duplicate filenames.

## `higurashi:adv`

TODO: Link to ADV mode update guide

## `higurashi:colors`

This command can be used if to change character name colors for ADV mode when you can no longer rerun the normal compilation.

The colors are set manually in the database. There are two columns for colors - one should be picked form PS3 sprite and the other from MG sprite of the character. The command will calculate the final color from these to get a good compromise.

## `higurashi:combine`

In the MG release of Meakashi there were a lot of cases like this:

```
OutputLineAll(NULL, "\n", Line_ContinueAfterTyping);
OutputLineAll(NULL, "\n", Line_ContinueAfterTyping);
```

This script combines such lines to this which is better for ADV mode compilation.

```
OutputLineAll(NULL, "\n\n", Line_ContinueAfterTyping);
```

## `higurashi:dll-update`

TODO: Link to DLL update guide

## `higurashi:lip-sync`

TODO: Link to LipSync update guide

## `higurashi:insert-names`

I think this was written when we found out that Tatarigoroshi was missing LOT of voices which were PS2-specific. After manually inserting the voices I wrote this to add the character names needed for ADV mode since the normal ADV mode compiler command could not be used again. You'll not need it normally but could be useful sometimes.

## `higurashi:missing`

This command is basically the last thing to use when the patch is complete. It detects missing files (images, voices, sounds). Beware though that it can report some false-positives like missing MG sprites - that's ok for characters who don't have MG sprites.

## `higurashi:normalize`

A `ClearMessage();` command in the script means that a new screen follows. So the last line before it should have `Line_Normal`. Some lines have `Line_WaitForInput` which is fixed by this script.

## `higurashi:parse`

TODO: Link to ADV mode update guide
Loading

0 comments on commit 4076574

Please sign in to comment.