Psych Engine Documentation

repository·main·Indexed 20 days ago

https://github.com/shadowmario/fnf-psychengine

A highly customizable engine for Friday Night Funkin' featuring robust mod support through Lua and HScript softcoding. This documentation covers installation and build processes for Windows, Linux, and Mac, as well as guides for mod development, asset organization for songs and weeks, and the use of the Chart Editor for custom notes.

Tokens
2.8K
Snippets
7
Records
26
Agent score
80%

What's inside Psych Engine

  1. Implement Achievements

    main

    The engine includes an achievement system. To learn how to implement or modify achievements, you can examine the example implementation in the source code:

    • Check Achievements.hx for the achievement definitions.
    • Search for checkForAchievement in PlayState.hx to see how they are triggered during gameplay.
  2. How mod file overriding works

    main

    Psych Engine uses a priority system for assets. If you want to change a base game asset (for example, an image located in assets/shared/images or assets/base_game/images), you must place your edited version in the corresponding path within your mod folder.

    Specifically, to override images, place them in mods/images. The engine will automatically handle the redirection from the base game path to your mod path.

  3. Getting started with mod development

    main

    To begin developing a mod for Psych Engine, it is recommended to extract modTemplate.zip to provide a baseline structure.

    If you prefer not to use the template, you can add or edit specific files manually by re-creating the original file path within your mod folder. The engine will prioritize files found in the mods/ directory over the base game files.

  4. Install Visual Studio components on Windows

    main

    To install the specific Microsoft Visual Studio components required for compiling on Windows, you can use curl in a command prompt, or run the provided setup script.

    Option 1: Command Line Run the following commands to download and install the VC tools and Windows 10 SDK:

    curl -# -O https://download.visualstudio.microsoft.com/download/pr/3105fcfe-e771-41d6-9a1c-fc971e7d03a7/8eb13958dc429a6e6f7e0d6704d43a55f18d02a253608351b6bf6723ffdaf24e/vs_Community.exe
    vs_Community.exe --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041 -p

    Option 2: Setup Script Run msvc-windows.bat located in the setup folder in the repository root.

  5. Build Psych Engine

    main

    Follow these steps to configure the environment and build the game from the repository root:

    1. Configure Haxelib:

      • Run haxelib setup. When prompted for the repository name, enter .haxelib.
      • Mac/Linux users: You must first create a directory for your libraries: mkdir ~/haxelib && haxelib setup ~/haxelib.
    2. Run Setup Script: Navigate to the setup folder and execute the appropriate script for your OS:

      • Windows: windows.bat
      • Mac/Linux: unix.sh Wait until you see the message "Finished!".
    3. Compile the Game: Run the following command in the root directory: lime test cpp.

    Note: The first compilation typically takes 5 to 10 minutes depending on your hardware.

    lime test cpp
  6. Organize shared and week-specific assets

    main

    You can organize images, characters, weeks, stages, sounds, and other JSON files using one of two patterns depending on your preference:

    1. Shared approach: Place all assets in assets/shared/.
    2. Week-specific approach: Place assets in assets/week_assets/your-week-folder/.
  7. Install dependencies for Psych Engine

    main

    Before building, ensure you have the following dependencies installed based on your operating system:

    • All Platforms: git and Haxe (version 4.3.4 or greater).
    • Windows: Microsoft Visual Studio Community 2022.
    • Linux: VLC.
    • Mac: (No additional specific dependencies listed beyond git and Haxe).