---
title: GPC: An Introduction
slug: gpc
description: GPC is a C-based language designed to enhance your gaming experience through personalized MACROs on DEMAND (aka M.O.D.s). 
image: https://archbee-image-uploads.s3.amazonaws.com/IwUlH55FdaPsVELSqm1Fc/zbs4gphmpHyg9lwonPs3i_gpcscriptsseo.png
icon: 👋
docTags: 
createdAt: 2023-11-07T01:09:08.684Z
---

# What is GPC?

GPC is a C-based language designed to enhance your gaming experience through personalized MACROs on DEMAND *(aka M.O.D.s)*.&#x20;

Used to program the Cronus Zen & CronusMAX devices, it works by enabling the use of third-party controllers and input devices on consoles for which they were not originally designed. It also allows to automate actions in games, such as rapid fire or combo moves.

# How it Works

***

GPC scripts are loaded onto the Cronus device using the [Zen Studio Compiler](docId\:BFfwKt0CB1pkIqz-xJPFe), and when the script is running, it interprets gamepad input, then modifies it according to the script's instructions, and then sends the modified output to the console using your favorite controller or mouse. This can include simulating button presses, analog stick movements, and other controller-based actions.

# Core Features

- <font color="#fcb900">**Intuitive Commands**:</font> The command structure is intuitive, allowing those new to programming to understand and use the language with relative ease.
- <font color="#fcb900">**C Language Syntax**:</font> Borrowing its basic syntax from C, GPC provides a familiar environment for those with experience in C programming, such as operators, variables, and control structures such as `if`, `while`, and `for`.
- <font color="#fcb900">**Functions:**</font> Core functions such as `init{}` and `main{}` are necessary, with `init{}` running once when the script starts, and `main{}`, the core of the script, looping continuously as long as the script is running.
- <font color="#fcb900">**Event Handlers:**</font> These respond to specific events, like `event_press{}` and `event_release{}` for button presses and releases.

:::CodeblockTabs
GPC EXAMPLE - RAPID FIRE

```apex
main {
    if (get_ival(XB1_RT)) {    // Check if RT/R2 is held
        combo_run(RAPID_FIRE); // Run Rapid Fire combo while RT/R2 is held
    }
}
combo RAPID_FIRE {
    set_val(XB1_RT, 100); // Output RT/R2 at 100%
    wait(40);
    set_val(XB1_RT, 0);   // Output RT/R2 at 0% (Released)
    wait(30);
    set_val(XB1_RT, 0);   // Output RT/R2 at 0% (Released) for the last step
}
```
:::

# 32-bit Support

- <font color="#fcb900">**Enhanced Memory and Precision**:</font> The introduction of 32-bit support means scripts can handle more memory and perform more precise calculations. This is particularly advantageous for M.O.D.s that require accurate input adjustments like [Anti-Recoil](docId\:u97dbplaGfd7mvoWWFFj7) or [Aim Assist](docId\:pS0o4l2-GXdkx75rjb8w0).
- <font color="#fcb900">**Value Representation**:</font> A 16-bit system allows for 2^16 different values, while a 32-bit system greatly expands this to 2^32 possible values. This capacity allows for a more extensive range of data to be processed and manipulated.
- <font color="#fcb900">**Compiler Settings**:</font> [Zen Studio](docId\:BFfwKt0CB1pkIqz-xJPFe), the integrated software environment for Cronus Zen, defaults to 32-bit compilation for enhanced capabilities, though it retains the ability to compile 16-bit scripts for compatibility with older scripts.

# Bytecode and the Virtual Machine

- <font color="#fcb900">**Bytecode Compilation:**</font> GPC is compiled into bytecode, which is the low-level code that the Cronus devices execute. This compilation is done by the built-in compiler within the [Zen Studio](docId\:BFfwKt0CB1pkIqz-xJPFe) software.
- <font color="#fcb900">**Virtual Machine (VM)**:</font> Cronus devices run a VM that interprets bytecode. This VM is tailored for processing and modifying game controller signals before they reach the console.
- <font color="#fcb900">**Optimized Architecture**:</font> The VM operates as a stack machine, meaning it works with a data structure called a stack. It is fine-tuned to handle controller inputs and outputs efficiently, ensuring real-time response without lag.
- <font color="#fcb900">**CPU Load Management**:</font> Keeping the CPU load below 80% is crucial to prevent output delays to the console, which is a significant consideration for script developers.

# Optimization and Error Handling

- <font color="#fcb900">**Streamlined Error Checking**:</font> The error checks performed by the Cronus VM are minimal and limited to essential ones, contributing to its speed and efficiency.
- <font color="#fcb900">**Developer Awareness**:</font> It's crucial for programmers to understand the GPC's limitations and fundamentals to develop efficient scripts that do not overload the system and cause performance issues.

# New to Scripting?

The GPC language is designed with simplicity in mind, borrowing elements from the C programming language to offer you an intuitive and straightforward scripting journey.

With a little practice and exploration, you'll soon be able to craft your own scripts that will redefine your gaming capabilities.

- <font color="#fcb900">**Free Downloads:**</font> Download free scripts from the [GPC Library](https://forums.cronusmax.com/gpclib/) and modify them to learn how they work. You should also visit [The M.O.D. Library](docId\:HbY9E_kpNotm9XAH7FnHm) for source code examples of the most popular M.O.Ds.
- <font color="#fcb900">**Step-by-Step Learning:**</font> Begin with simple button remapping to get the hang of scripting basics.
- <font color="#fcb900">**Resources at Your Fingertips**:</font> Leverage extensive documentation, tutorials, and a library of scripts from to guide your learning process.
- <font color="#fcb900">**Community Engagement**:</font> Join discussions in the Cronus Community [Forums](https://cronus.support/forums) & [Discord](https://cronus.support/discord) to exchange ideas, get help, and find inspiration.
- <font color="#fcb900">**Gradual Progression**:</font> As you grow more comfortable, move on to scripts that involve conditional logic and handle more complex sequences.

:::Iframe{code="<video width=&#x22;760&#x22; height=&#x22;428&#x22; autoplay loop muted>&#xA;    <source src=&#x22;https://archbee-doc-uploads.s3.amazonaws.com/IwUlH55FdaPsVELSqm1Fc/Fn1ReUoSTiFSUl93clRlY_gpclib.mp4&#x22; />&#xA;</video>" iframeHeight="0"}

:::

:::hint{type="danger"}
We have no control over GPC scripts that are shared by members of the community to the GPC Library, Forums, Discord, and other places. Therefore, we strongly recommend that you read any release notes provided with any script to make sure it is safe to use with the latest online multi-player games. If there are no release notes, use with extreme caution.
:::

# For Advanced Developers

Developers with an understanding of stack machines and performance optimization can create sophisticated scripts that can handle complex in-game scenarios, leveraging GPC's advanced features to push the boundaries of what's possible with gaming M.O.D.s.

- <font color="#fcb900">**Complex Logic Handling:**</font> Craft scripts that react dynamically to various in-game situations, providing a competitive edge.
- <font color="#fcb900">**Timing and Precision:**</font> Fine-tune the timing of actions, ensuring that your combos and moves execute flawlessly.
- <font color="#fcb900">**Detailed Input Manipulation:**</font> Control the game at the most granular level, customizing how every press and movement is registered.
- <font color="#fcb900">**Memory Management:**</font> Utilize the device’s memory for sophisticated state management, keeping track of game progress or player status.
- <font color="#fcb900">**Leveraging 32-bit Power:**</font> Embrace the vast capabilities of 32-bit scripting for larger, more complex, and more accurate scripts that make gaming more immersive.

:::hint{type="success"}
# Conclusion

GPC scripting by Cronus is a versatile and powerful tool in the realm of game controller customization, offering both broad usability for beginners and robust, detailed control for veteran programmers. With its C-like syntax, advanced 32-bit support, and efficient bytecode execution on a specialized VM, GPC stands as a critical component for anyone looking to enhance their gaming experience through the Cronus devices.&#x20;
:::

