Cyber Engine Tweaks Documentation

repository·master·Indexed 24 days ago

https://github.com/maximegmd/cyberenginetweaks

A Lua-based scripting framework for Cyberpunk 2077 that provides modders with access to internal engine features, a TweakDB editor, and a GUI via Dear ImGui. It includes quality-of-life patches for performance and game behavior, a lightweight JSON library for Lua, and sol2_ImGui_Bindings for managing windows, widgets, and layout within the game's interface.

Tokens
6.4K
Snippets
13
Records
58
Agent score
89%

What's inside Cyber Engine Tweaks

  1. Overview of Cyber Engine Tweaks

    master
    Cyber Engine Tweaks (CET) is a framework for Cyberpunk 2077 that allows modders to script mods using Lua with access to internal scripting features. It provides a Dear ImGui interface for mod GUIs, a console, and a TweakDB editor. Additionally, it includes various quality-of-life patches and development tools that can be toggled via a settings menu or configuration files (a game restart is required to apply changes).
  2. Set up the ASI Loader for plugin loading

    master

    To enable plugin loading via an ASI loader, follow these steps:

    1. Download Ultimate-ASI-Loader_x64.zip from the ASI Loader releases.
    2. Place dinput8.dll into <cyberpunk install path>\bin\x64\.
    3. Rename dinput8.dll to version.dll.
    4. Create a global.ini file in <cyberpunk install path>\bin\x64\.
    5. Add the following configuration to global.ini:
    [GlobalSets]
    LoadPlugins=1
    LoadFromScriptsOnly=1
    DontLoadFromDllMain=0
    FindModule=0
    UseD3D8to9=0
    DisableCrashDumps=0
    Direct3D8DisableMaximizedWindowedModeShim=0
  3. Apply general coding practices and formatting

    master

    When writing code for this project, adhere to these generalities:

    • Self-Explanatory Names: Avoid single-letter names. Use descriptive names like incomingPacketCount instead of a.
    • Use of auto: You may use auto for long, complex names, but do not use it for primitive types to avoid implicit signed/unsigned conversion issues.
    • Brace Style: Do not use Java-style blocks. The opening brace { must be placed on a new line.
  4. Install Cyber Engine Tweaks to Cyberpunk 2077

    master

    To install the built plugin, you must first configure the specific plugin directory within your Cyberpunk installation path (do not use the base directory), then run the install command.

    Target path format: <cyberpunk install path>\bin\x64\plugins

    xmake f --installpath=<cyberpunk install path>\bin\x64\plugins
    xmake install
  5. Build Cyber Engine Tweaks from source

    master

    To build the plugin, ensure you have the following requirements installed:

    • Visual Studio 2019 (or VS2022 with MSVC 14.34+)
    • xmake
    • git

    Follow these steps:

    1. Open a command prompt and navigate to the repository.
    2. Check out the desired branch or tag.
    3. Initialize dependencies: git submodule update --init.
    4. Build the project: xmake -y (use xmake -y -v for verbose output).
    git submodule update --init
    xmake -y
  6. Follow C++20 coding standards for Cyber Engine Tweaks

    master

    When developing for Cyber Engine Tweaks, use C++20 features supported by vs2019.

    To maintain performance and binary size, follow these guidelines:

    • Use templates responsibly to avoid excessive compilation times and binary bloat.
    • Adhere to the Single Responsibility Principle (SRP) by creating small, reusable components instead of large, monolithic classes.
    • Avoid using exceptions. Do not use STL code that can throw; instead, use nothrow versions or unsafe versions where available.
  7. Choose between lsqlite3 and lsqlite3complete

    master

    LuaSQLite3 provides two modules for manipulating SQLite3 databases directly from Lua 5. Choose based on how you want to link the SQLite3 library:

    • lsqlite3: Links SQLite3 dynamically. You must have the SQLite3 library installed on your system (available from http://www.sqlite.org/).
    • lsqlite3complete: Links SQLite3 statically. This version includes the SQLite3 amalgamation source code, so no external SQLite3 library is required.