Skip to content

Developer Guide

Quantumrunner edited this page Apr 5, 2024 · 10 revisions

Developer Guide

This contains key information to work on Valkyrie, but may not be complete and/or up to date. If in doubt, just ask. Before making changes it is a good idea to get in contact, to avoid duplicated work or conflicting design direction.

Translations

See the specific Translations page.

Source Control

Valkyrie is stored on github, you are here! The official page is a personal page of NPBruce, but anyone can fork it, make changes and submit pull requests. Issues are also open for bug reports and feature requests.

master

The master branch contains the stable version of Valkyrie. When a development version is ready for release it is merged to this branch. When a bug fix is applied to the stable release it is branched from and merged to here, and merged to the development branch.

development

This branch is where all non critical bugs and features are done. As a general rule all work is branched from and merged to this branch. It is recommended that you use NPBruce/development and /feature branches without multiple origins in git.

tags

All releases are tagged when built and uploaded. Once an upload is made the version must be changed and a new tag created if any changes are required.

Versions

Major Versions

Tthis will update on significant milestones worthy of external note, such as Android support.

Minor Versions

This is incremented for all features and non-critical bug fix releases. It may have a quest format increment as part of the release. As far as possible existing save games are to be supported.

Patch Versions

This is incremented for critical bug fixes that cannot wait for the next minor release. It is not allowed to increment the quest format.

Prerelease Versions

All builds ending in a letter are prerelease builds for testing.

Quest Format

Incremented whenever non back compatible changes are made to the quest data. See QuestFormat.

Development Environment

Git

You will need Git to work on the project. A GUI like Sourcetree may also be helpful.

Text Editor

You will need one for various things, as a general rule all files are unicode, so any unicode editor will be fine. Please do not use notepad, it is very good at breaking file formatting.

Unity

There are some things you can do without Unity, but most things will require you do build/run with Unity. The free version of Unity is required. It is recommended to install it to the default dir %ProgramFiles%\Unity.

Don't use Unity Hub (or some paths to build won't work), use the default Unity installation.

⚠️ If you still want to use Unity Hub make sure to copy or remap the UnityEngine.dll file that gets installed by Unity Hub (e.g. from C:\Program Files\Unity\Hub\Editor\2018.4.29f1\Editor\Data\Managed\UnityEngine\UnityEngine.dll). Otherwise the projects will not find the unity dll because the dll is currently has a fixed mapping (see this file for mapping) to the following folder: C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll.

Visual Studio

Visual Studio (e.g. VS 2022) is used to edit code within Unity, however there are other options here if you want to set something else up, or just use a text editor. The free Visual Studio Community version is fine.

Please be sure to follow this manual to set up Visual Studio correctly and to enable debugging.

There are two solution files. The primary is unity\unity.sln and additionally there is a solution libraries\libraries.sln, which is a Visual Studio product, but this can be edited without VS or build using the build.bat, if required.

ℹ️ If you want to build the main solution (unity.sln) manually from within Visual Studio you will first need to build the library project (libraries\libraries.sln) in Release mode.

Open JDK

java-1.8.0-openjdk-1.8.0.212-3 is used to sign the Android release. By default, it points to %ProgramFiles%\RedHat\java-1.8.0-openjdk-1.8.0.212-3\bin. You can change it by adding a %JDK_HOME% environment variable. You can get it from RedHat.

Android Studio

Android Studio is used to keep the Android SDK up to date, sinced Google deprecated other GUI Updater. The Android SDK location can be changed via the %ANDROID_SDK_ROOT% environment variable. The default dir points to %LOCALAPPDATA%\Android\Sdk.

The current build tools used are %ANDROID_SDK_ROOT%\build-tools\28.0.3, you can changed the path to your own location via the environment variable %ANDROID_BUILD_TOOLS%.

Nullsoft Scriptable Install System (NSIS)

Is used to build the Windows installer

Building

All

On windows the entire project can be built for all supported platforms using the provided build.bat provided:

  1. .NET framework 4.0.30319 is installed
  2. Unity 2018.4.29f1 is installed
  3. Android Studio is installed
  4. Android build tools 28.0.3 are installed (29.0.0-rc3 must be deleted if present or Unity won't build)
  5. Open JDK 1.8.0 212-3 is installed
  6. Android SDK 29 target or higher is installed.

For packaging 7-zip (64 bit) must be installed in %ProgramFiles%\7-Zip and NSIS must be installed in %ProgramFiles(x86)%\NSIS.

Libraries

The libraries solution can be built in Visual Studio, or using msbuild. Note that the output of this build is no longer under version control, so you have to use the build.bat or the libraries.sln (build the whole solution as a Release) once, in order to create the assemblies.

ℹ️ If you want to build the main solution (unity.sln) manually from within Visual Studio you will first need to build the library project (libraries\libraries.sln) in Release mode. Otherwise the Unity project might have problems locating dlls FFGAppImport and ValkyrieTools

Unity

The unity project can be built in unity manually. To debug click on Project/Assets/Scenes/Game. Press the "Open" button in the "Inspector". You can then open up any source file (for example Project/Assets/Scripts/Game). Visual Studio will start. Set a beakpoint anywhere and press the play button in Unity.

Logs

  • Debug build: %LOCALAPPDATA%\Unity\Editor\Editor.log
  • Release build: %LOCALAPPDATA%Low\NA\Valkyrie\output_log.txt

Release

PreRelease

  1. Update version number
  2. Update questdata version (if required)
  3. build.bat
  4. Test
  5. Tag
  6. Write changelog against tag
  7. Upload build against tag
  8. Release

Minor Release

  1. Merge to master from development
  2. Update version number
  3. build.bat
  4. Test
  5. Tag
  6. Write changelog against tag
  7. Upload build against tag
  8. Release

Patch Release

  1. Merge to master from fix branch
  2. Update version number
  3. build.bat
  4. Test
  5. Tag
  6. Write changelog against tag
  7. Upload build against tag
  8. Release

Android

See: Developer-Guide-Android

Repository Mirrors

https://gitlab.com/redwolf2/valkyrie

Clone this wiki locally