Эх сурвалжийг харах

Documentation

Also, some changes to test builders.
Iñigo Valentin 2 өдөр өмнө
parent
commit
04d90dce33

+ 0 - 1
CMake/Packaging.cmake

@@ -24,7 +24,6 @@ install(
         ${CMAKE_SOURCE_DIR}/COPYING.txt
         ${CMAKE_SOURCE_DIR}/doc/AUTHORS.md
         ${CMAKE_SOURCE_DIR}/doc/HISTORY.md
-        ${CMAKE_SOURCE_DIR}/doc/INSTALL.md
         ${CMAKE_SOURCE_DIR}/doc/INSTALL_DATA.md
         ${CMAKE_SOURCE_DIR}/doc/RUN.md
     DESTINATION ${VGEARS_INSTALL_DOCDIR}

+ 73 - 34
README.md

@@ -1,67 +1,106 @@
 # <img src="v-gears.png" alt="V-Gears" width="50"/> V-Gears
 
-## What is V-Gears? 
+**Final Fantasy VII, running on a new, free engine.**
 
-V-Gears is a free implementation of the game Final Fantasy 7 engine, designed to work with the original game data.
+V-Gears is a reimplementation of the Final Fantasy VII engine. It takes the data from your own PC copy of the game and runs it natively on a modern system, with no emulator in between. The fields, the battles, the menus and the world map are being rebuilt one piece at a time, with open code that anyone can read, fix and extend.
 
-It's designed to run the original game data on modern operating systems, making the game playable without the need of emulators.
+<p align="center">
+  <img src="https://v-gears.inigovalentin.com/img/screenshot/battle.gif" alt="A battle running in V-Gears" width="400"/>
+  <img src="https://v-gears.inigovalentin.com/img/screenshot/worldmap.gif" alt="The world map running in V-Gears" width="400"/>
+</p>
 
-It's free software, and it's designed to be cross-platform. It, of course, doesn't include any copyrighted data from the original game, but it provides an installer to get the required data from your own PC copy of the game.
+> V-Gears contains **no copyrighted data** from the original game. Its installer extracts what it needs, on your machine, from your own disks. All the screenshots on this page are real V-Gears captures, but the models, textures, backgrounds and other art in them belong to the original game and are not distributed here.
 
-It's a continuation of [q-gears](https://github.com/q-gears/q-gears "Q-Gears on Github"), which is an enormous project started by some great people many years ago, with the same purpose as this, but which unfortunately became stalled.
+## How far along is it?
 
-## Current status
+It's a work in progress: there is plenty to see and play, but expect bugs and missing pieces.
 
-Note that, while these are actual screenshots of V-Gears, none of the images, sprites, textures, backgrounds, etc are part of the project. They have been extracted locally from an original Final Fantasy VII game, and are in no way distributed here.
-### Field maps:
+| Part | State | In short |
+|--|--|--|
+| [Field maps](#field-maps) | 🟢 Mostly playable | Almost all maps work, with dialogs, music and videos |
+| [Battles](#battles) | 🟢 Mostly playable | Most commands and spells work; many are still missing their effects |
+| [Menus](#menus) | 🟢 Mostly complete | Items, materia, equipment, party, shops, saving and more |
+| [World map](#world-map) | 🟡 Playable, with bugs | Walk, drive, sail and fly around |
+| Minigames | 🔴 Missing | They are skipped, and the story goes on |
+
+This page describes the current development code, which can be ahead of the latest release. The [changelog](doc/CHANGELOG.md "Changelog") tells what each release brought.
+
+## Field maps
+
+Walk around Midgar and beyond. Most models, animations and script opcodes are converted and running, along with background music, animated backgrounds, random encounters and the original videos. Some maps still have bugs or quirks, and a few can crash the game.
 
-Most of the field maps are working. Some are buggy, some have their own quircks, and some can even crash the whole game, but overall, almost oll of them are playable. Most models, animations and opcodes are extracted and implemented. Background music work, and FMVs can be played
 |**Cloud model**|**Dialogs**|**Animations**|
 |--|--|--|
-|[<img src="https://v-gears.inigovalentin.com/img/screenshot/cloud.png" alt="Cloud model" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/cloud.png "Cloud model")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/dialog.png" alt="dialog" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/dialog.png "Dialogs")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/animations.gif" alt="animation" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/animations.gif "Animations")|
+|[<img src="https://v-gears.inigovalentin.com/img/screenshot/cloud.png" alt="Cloud model" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/cloud.png "Cloud model")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/dialog.png" alt="Dialog" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/dialog.png "Dialogs")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/animations.gif" alt="Animation" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/animations.gif "Animations")|
 |**Transparencies**|**Timers**|**Choices**|
 |[<img src="https://v-gears.inigovalentin.com/img/screenshot/transparent_dialogs.png" alt="Transparency" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/transparent_dialogs.png "Transparency")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/timers.png" alt="Timers" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/timers.png "Timers")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/choices.png" alt="Choices" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/choices.png "Choices")|
 
-### Battle:
-Battles are... playable. Battle models and animations are implemented. The battle commands show according to the equiped materia. Basic attacks and magic are working, and some spell effects are shown. But there is atill a lot to fix: Most formulas, a lot of commands, summons...
-**Battle Flow**|
-|--|
-[<img src="https://v-gears.inigovalentin.com/img/screenshot/battle.gif" alt="Battle Flow" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/battle.gif "Battle Flow")|
+## Battles
+
+Battles are pretty much playable, with the original enemies, formations, models, animations and AI scripts.
 
-### Menus:
+- **Rules:** damage, hit and turn order formulas, checked against the original executable.
+- **Commands:** the battle menu follows the equipped materia, with attacks and magic, Steal, Sense, Throw, Coin, Morph, Manipulate, Mime, Enemy Skill, the W commands and more.
+- **Materia:** linked support materia such as All, Quadra Magic, Counter or Final Attack.
+- **Limit breaks:** the limit bar, learning new techniques and multi-hit attacks.
+- **Spectacle:** the original battle cameras, caster auras, effects for the Fire, Ice, Bolt and Cure spells and some status magic, and the Shiva, Ifrit and Ramuh summons.
 
-All menus are implemented and working. They behave exactly like the originals. 
+Still on the way: effects for the other spells and summons, Cait Sith's and Vincent's special limits, and plenty of fine tuning.
 
-|**Begin**|**Main**|**Name**|
+
+## Menus
+
+Most menus are implemented and behave like the originals: items, magic, materia, equipment, status, order, limits, config, party swapping, shops and saving. A few details are still missing. For example, characters keep their default names, as the name menu is switched off for now.
+
+|**Begin**|**Main**|**Materia**|
 |--|--|--|
-|[<img src="https://v-gears.inigovalentin.com/img/screenshot/begin_menu.png" alt="Begin Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/begin_menu.png "Begin Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/main_menu.png" alt="Main Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/main_menu.png "Main Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/name_menu.png" alt="Name Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/name_menu.png "Name Menu")|
-|**Items**|**Key Items**|**Equip**|
-|[<img src="https://v-gears.inigovalentin.com/img/screenshot/item_menu.png" alt="Item Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/item_menu.png "Item Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/item_menu_key.png" alt="Key items menuy" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/item_menu_key.png "Key items menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/equip_menu.png" alt="Equip Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/equip_menu.png "Equip Menu")|
-|**Materia**|||
-|[<img src="https://v-gears.inigovalentin.com/img/screenshot/materia_menu.png" alt="Materia Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/materia_menu.png "Materia Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/save_menu.png" alt="Save Menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/save_menu.png "Save Menu")||
+|[<img src="https://v-gears.inigovalentin.com/img/screenshot/begin_menu.png" alt="Begin menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/begin_menu.png "Begin Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/main_menu.png" alt="Main menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/main_menu.png "Main Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/materia_menu.png" alt="Materia menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/materia_menu.png "Materia Menu")|
+|**Items**|**Save**|**Equip**|
+|[<img src="https://v-gears.inigovalentin.com/img/screenshot/item_menu.png" alt="Item menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/item_menu.png "Item Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/save_menu.png" alt="Save menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/save_menu.png "Save Menu")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/equip_menu.png" alt="Equip menu" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/equip_menu.png "Equip Menu")|
 
-### World map:
 
-The world map is bareli playable. The world map models are extracted and can be displayed. The world map is navigable, and most cities can be entered. Most vehicles are implemented and can be used, but there are still a number of bugs
+## World map
 
-|**Worldmap**|**Dialogs**|**Animations**|
+The world map is playable, and it runs on the original world scripts, so it follows your progress in the story. Explore the overworld, the depths of the ocean and the snowfield: walk, enter most cities, get into fights, and travel by chocobo, buggy, Tiny Bronco, submarine or airship, with animated water, fog, snow and changing music. There are still a number of bugs and some unfinished scenes.
+
+|**World map**|**The Highwind**|**On the move**|
 |--|--|--|
-|[<img src="https://v-gears.inigovalentin.com/img/screenshot/world_map.png" alt="The worldmap and the vehicles" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/world_map.png "The worldmap and the vehicles")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/highwind.png" alt="The Highwind, mid-flight" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/highwind.png "The Highwind, mid-flight")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/worldmap.gif" alt="World map working" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/worldmap.gif "World map working")| 
+|[<img src="https://v-gears.inigovalentin.com/img/screenshot/world_map.png" alt="The world map and the vehicles" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/world_map.png "The world map and the vehicles")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/highwind.png" alt="The Highwind, mid-flight" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/highwind.png "The Highwind, mid-flight")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/worldmap.gif" alt="World map working" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/worldmap.gif "World map working")|
+
+## The installer
 
-### Installer:
-The installer is the tool that extract the data from the original game
-|**Installer**|**Advanced**|
+The installer turns your copy of the game into data that V-Gears can use. Point it to the ISO image of the PC install disk, choose a folder, and let it work. It converts the sounds, the music and the videos (with the help of FFmpeg and TiMidity; the videos come from the three game disks), and then it can verify the result and launch the game.
+
+|**Installer**|**Advanced options**|
 |--|--|
 |[<img src="https://v-gears.inigovalentin.com/img/screenshot/installer.png" alt="Installer" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/installer.png "Installer")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/installer_advanced.png" alt="Advanced options" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/installer_advanced.png "Advanced options")|
 
-### Debug Tools
+## Under the hood
+
+V-Gears is written in C++14, with [Ogre](https://www.ogre3d.org/ "Ogre") for the graphics and LuaJIT for the scripts. The original field and world scripts are decompiled into Lua during the installation, and the battles and menus are written in Lua too, so a lot of the game can be read and changed without recompiling.
+
+When the original behaviour isn't documented, it is worked out from the game itself: damage formulas, camera scripts, summon effects and more come from studying the original executable and data files.
+
+Debug tools help to see what is going on:
+
 |**Field maps**|**Walkmesh**|**Console**|
 |--|--|--|
 |[<img src="https://v-gears.inigovalentin.com/img/screenshot/debug_dialog.png" alt="Debug fields" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/debug_dialog.png "Debug Fields")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/walkmesh.png" alt="Walkmesh" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/walkmesh.png "Walkmesh")|[<img src="https://v-gears.inigovalentin.com/img/screenshot/console.png" alt="Console" width="250"/>](https://v-gears.inigovalentin.com/img/screenshot/console.png "Console")|
 
-## In the meantime...
+## Try it
+
+You need your own copy of the PC version of Final Fantasy VII, as disk images. The guides cover Linux.
+
+1. **Get V-Gears:** download a package from the [releases](https://github.com/InigoValentin/V-Gears/releases "Releases") (they only work on systems with the same library versions as the one they were built on), or [build it yourself](doc/BUILD.md "Building guide").
+2. **Add the game data** with `v-gears-installer`, following the [data installation guide](doc/INSTALL_DATA.md "Data installation guide").
+3. **Play:** start `v-gears`. The [run guide](doc/RUN.md "Run guide") lists the controls.
+
+## A bit of history
+
+V-Gears continues [Q-Gears](https://github.com/q-gears/q-gears "Q-Gears on Github"), an enormous project started in 2006 by some great people with the same purpose, which unfortunately stalled. Read the [whole story](doc/HISTORY.md "V-Gears history").
 
-If it picked your curiosity, you can check out the [history](doc/HISTORY.md "V-Gears history") behind the project. Or, if you want to try it for yourself, maybe the [build](doc/BUILD.md "Building guide") and [installaton](doc/INSTALL.md "Installation guide") guides are a good place to start.
+## Join in
 
-Or even better, if you want to see this done and want to contribute, clone the repo, read the [style guide](doc/STYLE.md "V-Gears C++ Style Guide") and have a go at it!
+If you want to see this finished, help is welcome. Clone the repo, read the [C++](doc/STYLE.md "V-Gears C++ Style Guide") and [Lua](doc/STYLE-LUA.md "V-Gears Lua Style Guide") style guides, pick something from the [to-do list](doc/TODO.md "To-do list") (or whatever breaks first when you play), and have a go at it!
 
+V-Gears is free software, released under the [GNU General Public License v3](COPYING.txt "License").

+ 13 - 14
doc/AUTHORS.md

@@ -1,16 +1,15 @@
 # Authors
 
-Halkun <[https://forums.qhimm.com/index.php?action=profile;u=109](https://forums.qhimm.com/index.php?action=profile;u=109>
-Akari <https://forums.qhimm.com/index.php?action=profile;u=1266](https://forums.qhimm.com/index.php?action=profile;u=1266>
-Bdulaney88 <draygera@gmail.com>
-Bryce Groff <bgroff@hawaii.edu>
-Gennadiy Brich <gennadiy.brich@gmail.com>
-CapsAdmin <eliashogstvedt@gmail.com>
-Paul <github@paulsapps.com>
-Mike Vidales <this@tranxien.cc>
-sithlord48 <sithlord48@gmail.com>
-Tobias Peters <tobias.peters@kreativeffekt.at>
-Tom-III <brogan.tom.iii@gmail.com>
-myst6re <myst6re@gmail.com>
-Inigo Valentin <i@inigovalentin.com>
-
+- Halkun ([Qhimm Forums profile](https://forums.qhimm.com/index.php?action=profile;u=109))
+- Akari ([Qhimm Forums profile](https://forums.qhimm.com/index.php?action=profile;u=1266))
+- Bdulaney88 <draygera@gmail.com>
+- Bryce Groff <bgroff@hawaii.edu>
+- Gennadiy Brich <gennadiy.brich@gmail.com>
+- CapsAdmin <eliashogstvedt@gmail.com>
+- Paul <github@paulsapps.com>
+- Mike Vidales <this@tranxien.cc>
+- sithlord48 <sithlord48@gmail.com>
+- Tobias Peters <tobias.peters@kreativeffekt.at>
+- Tom-III <brogan.tom.iii@gmail.com>
+- myst6re <myst6re@gmail.com>
+- Iñigo Valentin <i@inigovalentin.com>

+ 46 - 38
doc/BUILD.md

@@ -1,16 +1,28 @@
 # <img src="../v-gears.png" alt="V-Gears" width="50"/> V-Gears Building Guide
 
 ## Install dependencies
-If you are running Debian (or derivates), you can install the required dependencies by running as root
+
+If you are running Debian (or derivates), you can install the required dependencies with:
 
 ```bash
-apt install g++ cmake libqt5widgets5 qtbase5-dev zlib1g-dev libarchive-dev libogre-1.12-dev libois-dev libvorbis-dev libboost-dev libboost-program-options-dev libboost-test-dev libboost-filesystem-dev libboost-thread-dev libopenal-dev libtinyxml-dev libluajit-5.1-dev
+sudo apt install git build-essential cmake qtbase5-dev zlib1g-dev libarchive-dev libogre-1.12-dev libois-dev libvorbis-dev libboost-dev libboost-program-options-dev libboost-test-dev libboost-filesystem-dev libboost-thread-dev libopenal-dev libtinyxml-dev libluajit-5.1-dev
 ```
 
-The data installer also needs FFmpeg and TiMidity (see [Optional programs](#optional-programs)).
+This guide was checked on Debian forky/sid. Other releases and distributions may name some packages differently, especially `libogre-1.12-dev`.
+
+To convert the sound effects, the music and the videos, the data installer also uses FFmpeg and TiMidity. They are not needed to build V-Gears, only to install the game data (see the [data installation guide](INSTALL_DATA.md "Install Data")).
 
 ```bash
-apt install ffmpeg timidity
+sudo apt install ffmpeg timidity
+```
+
+## Get the code
+
+Clone the repository and enter its directory. All the commands in this guide are run from there, which is called the project directory.
+
+```bash
+git clone https://github.com/InigoValentin/V-Gears.git
+cd V-Gears
 ```
 
 ## Build using CMake
@@ -18,38 +30,38 @@ apt install ffmpeg timidity
 From the project directory, run these commands:
 
 ```bash
-mkdir build;
-cd build;
-cmake ../;
-make;
+cmake -S . -B build
+cmake --build build
 ```
 
-If you want to speed it up a bit (it can take several minutes, depending on your system), you can add the parameter `-j` to make to use multiple threads. For instance, `make -j3` will use three cores for the compilation. The build uses a lot of memory, so on machines with little RAM, use a low number (`-j2`).
+If you want to speed it up (it can take several minutes, depending on your system), add `-j` to the second command to use multiple threads. For instance, `cmake --build build -j3` will use three cores for the compilation. The build uses a lot of memory, so on machines with little RAM, use a low number (`-j2`).
 
 Once the build process finishes, you should have the following files (from the project directory):
 
 - `build/bin/v-gears`, the engine executable.
 - `build/bin/v-gears-installer`, the data installer.
 
-If you build with `-DCMAKE_BUILD_TYPE=Debug`, they are in `build/bin_debug/` instead.
+If you add `-DCMAKE_BUILD_TYPE=Debug` to the first command, they are in `build/bin_debug/` instead.
 
 The engine can be launched from anywhere: it finds its data directory (`~/.v-gears/` by default) and fills it from the `data/` folder of the repository the first time. See the [run guide](RUN.md "Run V-Gears") for details.
 
 ## Run the tests (optional)
 
-The tests are not built by default. To build and run the tests of the installer logic (the option rules, the installation layout, the verifier, the log, the tool finder and the movie camera data) and of the data directory and Ogre plugin lookup, which don't need the rest of the engine:
+The tests are not built by default: enable them with `-DBUILD_TESTS=ON`. It's best to use a separate build directory. From the project directory:
 
 ```bash
-mkdir build-tests;
-cd build-tests;
-cmake ../ -DBUILD_TESTS=ON;
-make v-gears-installer-tests;
-./bin/v-gears-installer-tests
+cmake -S . -B build-tests -DBUILD_TESTS=ON
+cmake --build build-tests --target v-gears-tests v-gears-installer-tests
+cd build-tests
+ctest --output-on-failure
 ```
 
-The engine tests (for example the movie state and camera frames) are in the `v-gears-tests` target, built the same way.
+There are two test programs:
 
-<!-- TODO(review): check that `make v-gears-tests` builds on its own and whether more build dependencies (video, audio) are required now. -->
+- `v-gears-tests`, the tests of the engine and of the script decompiler. It links the engine library, so it takes a while to build the first time, and it needs the same dependencies as V-Gears.
+- `v-gears-installer-tests`, the tests of the installer logic (the option rules, the installation layout, the verifier, the log, the tool finder and the movie camera data) and of the data directory and Ogre plugin lookup. It doesn't need the rest of the engine, so it builds quickly.
+
+To build and run only one of them, pass just its name to `--target` and run it from the build directory, for example `./bin/v-gears-installer-tests`.
 
 ## Make packages (optional)
 
@@ -60,14 +72,13 @@ V-Gears can be packaged for Linux as a `.deb` package and as a `.tar.gz` archive
 Use a separate Release build, so it doesn't interfere with your development build. From the project directory:
 
 ```bash
-mkdir build-release;
-cd build-release;
-cmake ../ -DCMAKE_BUILD_TYPE=Release;
-make -j4 v-gears v-gears-installer;
-cpack;
+cmake -S . -B build-release -DCMAKE_BUILD_TYPE=Release
+cmake --build build-release -j4 --target v-gears v-gears-installer
+cd build-release
+cpack
 ```
 
-The first build takes a while. Adjust `-j` as explained in [Build using CMake](#build-using-cmake).
+The first build takes a while. Adjust `-j` as explained in [Build using CMake](#build-using-cmake). Making the `.deb` needs `dpkg-dev`, which comes with `build-essential`.
 
 When `cpack` finishes, `build-release/` contains:
 
@@ -83,7 +94,7 @@ Both have the same files:
 
 - `bin/v-gears` and `bin/v-gears-installer`, the engine and the data installer.
 - `share/v-gears/`, the V-Gears data files (configuration, scripts, screens, fonts...). The engine copies them to the user's data directory (`~/.v-gears/`) the first time it runs, and the data installer adds the game data there.
-- `share/doc/v-gears/`, the documentation and the license.
+- `share/doc/v-gears/`, the documentation for players (not the build and style guides) and the license.
 - `share/applications/` and `share/icons/`, the desktop files and the icons.
 
 The `.deb` installs them under `/usr`, so both programs show in the applications menu. Install it with `apt`, so it installs the dependencies too:
@@ -114,10 +125,18 @@ These can be set when running `cmake` (`-D<option>=<value>`):
 
 ### Install without a package
 
-To install V-Gears directly in the system, with the same files and layout as the packages, run this from the build directory:
+To install V-Gears directly in the system, with the same files and layout as the packages, build it and then install it. From the project directory:
+
+```bash
+cmake -S . -B build-release -DCMAKE_BUILD_TYPE=Release
+cmake --build build-release -j4
+sudo cmake --install build-release --prefix /usr/local
+```
+
+CMake writes the list of installed files to `build-release/install_manifest.txt`. To uninstall, remove those files. This leaves their directories, and your data in `~/.v-gears/`.
 
 ```bash
-sudo cmake --install . --prefix /usr/local
+sudo xargs -d '\n' rm -f -- < build-release/install_manifest.txt
 ```
 
 ## Advanced build options
@@ -139,18 +158,7 @@ If you see warnings about missing Boost or OgreBites, prefer installing the
 appropriate `-dev` packages listed above, or point CMake at your OGRE/Boost
 installation with `-DOGRE_ROOT=...` and `-DBoost_DIR=...`/`-DBoost_LIBRARY_DIRS`.
 
-## Optional programs
-
-To convert the sound effects, the music and the videos, the installer uses FFmpeg and TiMidity. They are not needed to build V-Gears, only to install the data. In Debian (or derivates):
-
-```bash
-apt install ffmpeg timidity
-```
-
-See the [data installation guide](INSTALL_DATA.md "Install Data").
-
 ## Next steps
 
-- [Install V-Gears](INSTALL.md "Install V-Gears")
 - [Install data](INSTALL_DATA.md "Install Data")
 - [Run V-Gears](RUN.md "Run V-Gears")

+ 1 - 1
doc/HISTORY.md

@@ -66,7 +66,7 @@ For a while, I added no new functionalities to the engine itself. That changed a
 
 ---
 
-##The Future - Here Is Where You Keep Going.
+## The Future - Here Is Where You Keep Going.
 
 I know I won't be the one who finishes V-Gears. Hell, I know I'm not the one who will announce the version 1 of it. I honestly don't have the skills or the time to do so.
 

+ 0 - 25
doc/INSTALL.md

@@ -1,25 +0,0 @@
-# <img src="../v-gears.png" alt="V-Gears" width="50"/> V-Gears Installation Guide
-
-## Manual installation
-
-The data installer can do this for you: enable "Copy V-Gears data files" in its advanced options and it copies the `data/` folder of the repository (`share/v-gears/` in an installed package) to the installation directory. To do it by hand:
-
-1. Create a folder for V-Gears data, outside the project. In Linux-based systems, it's recommended to use `~/.v-gears/`.
-2. Copy all the contents of the `data/` folder of the repository to the newly created directory. It should end up like this:
-```
-~/.v-gears/
-  ├── data
-  ├── field_models_and_animation_metadata.xml
-  ├── plugins.cfg
-  ├── plugins_d.cfg
-  ├── resources.cfg
-  └── resources_d.cfg
-```
-3. If you used a directory other than `~/.v-gears/`, start V-Gears from it, or pass it with `--data-dir` (see [Run V-Gears](RUN.md "Run V-Gears")).
-
-If you skip these steps, V-Gears copies the files to `~/.v-gears/` itself the first time it runs.
-
-## Next steps
-
-- [Install data](INSTALL_DATA.md "Install Data")
-- [Run V-Gears](RUN.md "Run V-Gears")

+ 0 - 2
doc/INSTALL_DATA.md

@@ -35,8 +35,6 @@ To add the missing audio later, install the programs and run the installer again
 
 ## Launch the Installer
 
-If you have followed the [build](BUILD.md "Building guide") and [installaton](INSTALL.md "Installation guide") guides, you'll have the game data copied to `~/.v-gears/` (or you can let the installer copy it, see below), and the binaries compiled somewhere (we'll assume they are in `~/V-Gears/build/bin`, change the directories according to your system). Just run the installer:
-
 ```Bash
 ~/V-Gears/build/bin/v-gears-installer
 ```

+ 2 - 2
doc/RUN.md

@@ -2,7 +2,7 @@
 
 ## Run the engine
 
-If you have followed the [build](BUILD.md "Building guide") and [installation](INSTALL.md "Installation guide") guides, you'll have the game data installed to `~/.v-gears/`, and the binaries compiled somewhere (we'll assume they are in `~/V-Gears/build/bin`, change the directories according to your system).
+If you have followed the [build](BUILD.md "Building guide") and [installation](INSTALL_DATA.md "Installation guide") guides, you'll have the game data installed to `~/.v-gears/`, and the binaries compiled somewhere (we'll assume they are in `~/V-Gears/build/bin`, change the directories according to your system).
 
 Run the engine from any directory:
 
@@ -39,7 +39,7 @@ The default bindings are in `config/config.cfg` of the installation directory, i
 |Page Up / Page Down|L1 / R1|Switch tab or character in menus|
 |Left Ctrl|run|Run in the field|
 
-The settings made in the in-game config menu (controls, sound, etc.) are saved with the game settings and loaded on start.
+The control settings changes made in the in-game config menu are saved with the game settings and loaded on start.
 
 <!-- TODO(review): verify the table against the in-game config menu (control remapping), and check the gamepad status. -->
 

+ 11 - 9
test/CMakeLists.txt

@@ -1,5 +1,7 @@
-# Find packages required to compile tests.
-find_package(Boost COMPONENTS filesystem unit_test_framework REQUIRED)
+# Find packages required to compile tests. Imported targets are directory-scoped, so the Boost components that the
+# engine links (found in src/) have to be looked up here too.
+find_package(Boost REQUIRED COMPONENTS filesystem unit_test_framework program_options thread
+    OPTIONAL_COMPONENTS system chrono)
 
 
 # Compiler options.
@@ -266,17 +268,17 @@ else()
     set(_test_qt_libs -lQt5Widgets -lQt5Core)
 endif()
 
+# The tests use the same libraries as the engine (read from its target, as the variables set in src/ are not visible
+# here), plus libarchive, which the installer code needs.
+get_target_property(_engine_libs v-gears LINK_LIBRARIES)
+
 target_link_libraries(v-gears-tests
     libvgears
     ${_test_qt_libs}
-    ${OIS_LIBRARIES}
-    ${OPENAL_LIBRARY}
-    ${OGGVORBIS_LIBRARIES}
-    ${TinyXML_LIBRARIES}
-    ${Boost_LIBRARIES}
-    ${BOOST_LINK_LIBS}
-    ${OGRE_LIBRARIES}
+    ${_engine_libs}
+    archive
     ${ZLIB_LIBRARIES}
+    Boost::unit_test_framework
 )
 add_test(NAME v-gears-tests COMMAND v-gears-tests)
 

+ 1 - 1
test/installer/decompiler/world/WorldDisassembler.cpp

@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(TestWorldDisassembler){
             ),
             std::string::npos
         );
-        BOOST_CHECK_NE(generated_script.str().find("return;"), std::string::npos);
+        BOOST_CHECK_NE(generated_script.str().find("do return end"), std::string::npos);
         BOOST_CHECK_NE(generated_script.str().find("end"), std::string::npos);
         BOOST_CHECK_EQUAL(generated_script.str().find("}\n"), std::string::npos);
 }

+ 4 - 3
test/installer/decompiler/world/instruction/WorldSubStackInstruction.cpp

@@ -16,18 +16,19 @@
 #include <boost/test/unit_test.hpp>
 #include "installer/decompiler/world/instruction/WorldSubStackInstruction.h"
 
-BOOST_AUTO_TEST_CASE(TestWorldSubStackInstructionLeftShiftIsValidLua){
+BOOST_AUTO_TEST_CASE(TestWorldSubStackInstructionRightShiftIsValidLua){
     WorldSubStackInstruction instruction;
     instruction.SetOpcode(0x51);
 
     ValueStack stack;
+    // The value is pushed first, and then the number of bits.
+    stack.Push(new VarValue("(2928 - Read(912))"));
     stack.Push(new VarValue("2"));
-    stack.Push(new VarValue("2928 - Read(912)"));
     Function function;
     instruction.ProcessInst(function, stack, nullptr, nullptr);
 
     BOOST_CHECK_EQUAL(
-        stack.Pop()->GetString(), "((2928 - Read(912)) * (2 ^ 2))"
+        stack.Pop()->GetString(), "math.floor((2928 - Read(912)) / 2 ^ 2)"
     );
 }