VVVVVV Source Code Documentation

repository·master·Indexed 27 days ago

https://github.com/terrycavanagh/vvvvvv

Open-source code for the indie game VVVVVV by Terry Cavanagh. Includes instructions for building the C++ desktop version on Windows (Visual Studio 2010), macOS, and GNU/Linux using CMake and SDL2, as well as guides for the Android port and an archival Adobe AIR mobile version. Documentation covers localization workflows, font format specifications (.png and .fontmeta), and the use of legacy level editing tools.

Tokens
15.7K
Snippets
16
Records
99
Agent score
93%

What's inside VVVVVV

  1. Overview of the VVVVVV Adobe AIR mobile version

    master

    This repository contains the source code for the Adobe AIR mobile version of VVVVVV, which is a fork of the original Flash source code.

    Important Notes:

    • Unmaintained: This version is not actively maintained and is provided for archival/curiosity purposes only.
    • Desktop Version: For the current, maintained C++ version of VVVVVV, refer to the desktop_version directory in the repository.
    • Requirements: This version requires Adobe AIR and targets SWF version 36.
  2. Overview of VVVVVV source code

    master
    VVVVVV is the source code for the 2010 indie game by Terry Cavanagh. This repository contains the source code for the desktop version of the game. While the game is commercially available, you are free to compile the source code for personal use. For information regarding the distribution of compiled versions, refer to LICENSE.md.
  3. Understand the VVVVVV font format

    master

    Fonts in VVVVVV consist of two files sharing the same base name: a .png image containing all glyphs and a .fontmeta XML document containing character metadata.

    Example naming convention: font_ja.png and font_ja.fontmeta.

    If you need to convert a standard font (like a TTF) into this format, you currently need to use external tools provided by the developer (Dav).

  4. Build VVVVVV on Windows using Visual Studio 2010

    master

    To build the Windows version, you need Visual Studio 2010 and SDL2 (version 2.24.0+).

    1. Download the SDL2 development libraries for Windows from the SDL website.
    2. Create a build directory and run CMake, specifying the paths to your SDL2 include and library directories using -DSDL2_INCLUDE_DIRS and -DSDL2_LIBRARIES.
    3. Open the generated solution in Visual Studio and click Build.

    Note: To build the 'Make and Play' edition, uncomment #define MAKEANDPLAY in MakeAndPlay.h before building.

    mkdir build
    cd build
    cmake -A Win32 -G "Visual Studio 10 2010" .. -DSDL2_INCLUDE_DIRS="C:\SDL2-2.24.0\include" -DSDL2_LIBRARIES="C:\SDL2-2.24.0\lib\x86\SDL2;C:\SDL2-2.24.0\lib\x86\SDL2main"
  5. Handle numbers and plural forms

    master

    VVVVVV supports complex pluralization and 'wordy' numbers (e.g., 'twenty' vs '20').

    Numbers (numbers.xml)

    Contains numbers 0-100. You can define plural forms by setting the form attribute on a number. Form IDs can be any integer between 0 and 254.

    <numbers>
        <number value="0"  form="0"  ... />
        <number value="1"  form="1"  ... />
        <number value="2"  form="2"  ... />
        <number value="3"  form="2"  ... />
        <number value="4"  form="2"  ... />
        <number value="5"  form="0"  ... />
    </numbers>

    Plural Strings (strings_plural.xml)

    Map your defined forms to specific translations:

    <string english_plural="You rescued {n_crew} crewmates" english_singular="You rescued {n_crew} crewmate">
        <translation form="0" translation="You saved {n_crew} crewmates"/>
        <translation form="1" translation="You saved {n_crew} crewmate"/>
        <translation form="2" translation="You saved {n_crew} crewmateys"/>
    </string>

    Note: For numbers 100+, the system repeats forms from 0-119. You do not need to provide translations for numbers above 100 as they are not written out as words.

  6. Add a new language to VVVVVV

    master

    To create a new language translation, you can use one of two methods:

    1. Template Method: Copy the existing en folder and begin filling out the meta.xml file.
    2. Sync Method: Create an empty language folder and use the in-game sync tool: translator > maintenance > sync language files to populate it with the necessary files.

    Note: Official translations require approval from Terry. Fan translations are permitted for personal use but may not be officially distributed.

  7. Access the Translator Menu

    master

    The translator menu allows for testing menus, translating room names, syncing language files, and viewing translation progress. It appears in the main menu if:

    1. The lang folder is not next to data.zip and the game is running in a desktop_version folder (common when compiling from source).
    2. The -translator command line argument is passed.
    3. ALWAYS_SHOW_TRANSLATOR_MENU is defined during compilation in Localization.h.

    Syncing Language Files: To add new strings, add them to the English files (strings.xml or strings_plural.xml) and use the sync option in the menu.

    Supported for Full Sync (EN $\rightarrow$ All):

    • meta.xml
    • strings.xml
    • strings_plural.xml
    • cutscenes.xml
    • roomnames.xml
    • roomnames_special.xml

    Not supported for syncing:

    • numbers.xml
  8. Add new translatable strings to VVVVVV

    master

    To make a raw string translatable in the code, wrap it with loc::gettext(). You may need to #include "Localization.h". After updating the code, add the corresponding entry to the English language file (e.g., strings.xml).

    New strings can be automatically synced from English to all other language files using the translator menu.

    English language file format: <string english="Your text" translation="" explanation="context" max="limit"/>

    • max: Indicates character space. Use an integer (e.g., 40) for single-line text, or a pattern like 38*5 for multi-line text. This attribute is optional if a hard limit is misleading.
  9. Install and play the VVVVVV Android port

    master

    Once the build is complete, follow these steps to install the game on your device:

    1. Navigate to desktop_version/VVVVVV-android/app/build/outputs/apk/.
    2. Copy the APK corresponding to your device's architecture to your Android device.
    3. Install the APK.

    Note: Touchscreen support is not implemented. You must connect a physical keyboard or a controller to your device to play.

  10. Compile the VVVVVV level editing tools

    master

    The tools in this directory are custom level editors used during the original development of VVVVVV. They export levels as source code. Note that these tools were not intended for public use and may require significant trial and error to operate.

    To compile these tools, you must have Allegro v4.3 installed.