gcsim Documentation

website·Indexed 32 days ago

https://docs.gcsim.app

Reference documentation for gcsim, featuring a comprehensive weapon database including known issues and AoE data for various weapons.

Tokens
208.1K
Snippets
1.5K
Records
2.1K
Agent score
53%

What's inside gcsim

  1. Overview of the gcsim Substat Optimizer

    The Substat Optimizer is an experimental CLI-only feature that attempts to optimize artifact substats given an action list and key inputs. It is primarily used for theorycrafting to align calculations with standards or to generate reasonable artifact presets when specific artifacts are unavailable. By default, it assigns substats adhering to the KQM Standard.
  2. Overview of gcsim combat simulation

    gcsim is a team DPS calculation and combat simulation tool for Genshin Impact. It simulates combat based on user-defined team inputs to calculate overall damage and provide detailed statistics, including:

    • Overall damage distribution per character
    • Detailed damage distribution per character skill
    • Energy regeneration metrics
    • Reaction counts
    • Field damage

    Because the tool is under active development, users are encouraged to verify results and report issues via GitHub or Discord.

  3. Overview of new gcsl language features

    The revamped gcsl language introduces several scripting capabilities. While these are optional and not required for basic sims, they are available for advanced logic:

    • Variables, arithmetic, and logic operations.
    • Loops (e.g., while) and control statements (if/else).
    • Custom functions.
    • Implementation of Hitlag.
    • Reworked animation system (fixing a 2-frame delay bug) and updated character frame data including dash, jump, and cancels.
  4. Understand gcsim's 2D coordinate system and units

    gcsim uses a 2D Cartesian coordinate system where every point is identified by x and y coordinates. The unit of length is meters (m). For context, some Abyss floor tiles (e.g., Floors 7 and 8) are 2.55m x 2.55m.
  5. Organize and upload frame data for review

    To maintain a clear overview and share data for verification:

    1. Rename Videos: Use the scheme <item count>_<item recording count>_<name-with-hyphens>.mp4 (e.g., 02_01_NA-String.mp4).
    2. Timestamp TODO List: Watch in_frames.mp4 and add timestamps to the nahida_todo.txt list (e.g., 0:00 NA String - hitmark).
    3. Upload to YouTube: Upload out_frames.mp4 as an 'Unlisted' video. Paste the timestamped TODO list into the video description.
    4. Create Google Sheet: Base the frame sheet on existing character templates in the reference section, using similar weapon-type characters as guides.
  6. Evaluate player state and stamina

    The following fields provide information about the player's current state:

    • .stam: Evaluates to the player's remaining stamina.
    • .state: Evaluates to the current state of the player.
    • .previous-char: Evaluates to the character that executed the previous action. This should be compared against keys from .keys.char.<char_name>.
  7. Determine release and travel frames

    To calculate travel frames for an ability:

    1. Release Frame: Identify the frame where a bright circle appears.
    2. Travel Frames: Count the frames starting from the release frame and ending at the hitmark frame (using the hitmark logic defined in the hitmark section).
  8. Fine-tune macro timings for shortest duration

    Finding the shortest possible button press/delay is a brute-force process. Follow these guidelines:

    • Adjust durations in multiples of 25ms.
    • A timing is considered the shortest possible if increasing the speed (decreasing duration) breaks the macro.
    • Build longer chains on previously determined timings (e.g., N4 ➔ CA builds on N3 ➔ CA).
    • If a macro is inconsistent or breaks specifically during recording, increase the duration (make it slower).
    • For cancels close to hitmark timings, verify by attempting to hit an enemy without triggering hitlag.
  9. Implement conditional logic with if statements

    Use the if statement to execute blocks of code based on a condition.
    if <condition> {
        // code to execute if true
    } else {
        // code to execute if false
    }
  10. Write combat rotations using gcsim script (gcsl)

    The gcsim script (gcsl) defines the sequence of actions. Commands are executed sequentially. If an ability is not ready (due to cooldown, energy, or stamina), the simulator will stall on that line and wait until the action can be successfully executed before proceeding.

    Key Syntax:

    • Short-form repetition: Use :n to repeat an action (e.g., attack:5 instead of writing attack five times).
    • Automatic Swaps: The simulator automatically swaps characters if the next action requires a different character than the one currently active.
    • Manual Swaps: Use <char> swap; to force a character change.
    active raiden;
    
    raiden skill;
    xingqiu skill, burst;
    bennett skill, burst;
    xiangling burst, skill;
    raiden burst;
    raiden attack:5, jump;
  11. Create a character rotation

    To define a rotation, first set the starting character using the active command. Then, list the actions (skill, burst, attack) for each character. You can specify the number of attacks using the attack:N syntax.
    active raiden;
    
    raiden skill;
    xingqiu skill, burst;
    bennett skill, burst;
    xiangling burst, skill;
    raiden burst;
    raiden attack:15;
  12. Import characters from Enka.Network

    Import character data into gcsim using your in-game UID via Enka.Network.

    Prerequisites:

    1. Open the Paimon Menu in-game.
    2. Click the pencil icon on your namecard -> Edit Profile.
    3. Ensure the desired characters are in the Character Showcase.
    4. Ensure Show Character Details is enabled.

    Steps to import:

    1. Navigate to the gcsim Simulator page.
    2. Click Tools at the bottom of the screen.
    3. Select Import from Enka to open the dialog.
    4. Paste your in-game UID into the text box.
    5. Click the Fetch button.

    Note: This process will overwrite any existing imports for your characters. To update characters after in-game changes, repeat the import process.