Inject custom C++ code into GameMaker Studio 2 YYC builds

Overview

YYC Boost

Inject custom C++ code into GameMaker Studio 2 YYC builds!

License

WARNING: This tool is currently in an early stage of development and it is not guaranteed to work in all projects/cases! Use at your own risk! Currently only the Windows YYC target is supported!

Table of Contents

Features

Multithreading

Run functions in a separate thread!

yyc_run_in_thread(function () {
    while (true)
    {
        show_debug_message("This does not block the main thread!");
    }
});

Task system

Utilize multithreading for parallel tasks! Includes fallback for VM.

var _sleepTask = function (_arg) {
    var _ms = _arg[0];
    var _message = _arg[1];
    var _t = current_time;
    while (current_time - _t < _ms) {}
    show_debug_message(_message);
};

// Create standalone tasks:
new YYC_Task(_sleepTask, [1000, "Standalone task done!"]).Run();

// Or groups of tasks:
new YYC_GroupTask([
    new YYC_Task(_sleepTask, [1000, "Task 1 done!"]),
    new YYC_Task(_sleepTask, [2000, "Task 2 done!"]),
    new YYC_Task(_sleepTask, [3000, "Task 3 done!"]),
], _sleepTask, [1000, "Group 1 done!"]).Run();

C++ types of local variables

Define C++ type of a var to save memory and increase performance!

#macro COUNT 10000
var _t;

_t = get_timer();
for (var i = 0; i < COUNT; ++i) {}
show_debug_message(get_timer() - _t);

// This loop runs faster compared to when a regular var is used
_t = get_timer();
for (var j/*:int*/= 0; j < COUNT; ++j) {}
show_debug_message(get_timer() - _t);

C++ code injection

Replace function with a custom C++ code!

/// @desc Returns 1 when YYC Boost is used, otherwise 0.
function is_cpp()
{
    /*cpp
    _result = 1;
    return _result;
    */
    return 0;
}

Documentation

Online documentation for the latest release of YYC Boost is available here.

Building from source code

Requires Python 3!

git clone https://github.com/kraifpatrik/YYCBoost
cd .\YYCBoost\YYCBoost_CLI\
python.exe -m venv env
.\env\Scripts\activate
pip.exe install -r requirements.txt
python.exe setup.py

This will create a directory YYCBoost\YYCBoost_CLI\dist with yycboost.exe.

Support the project

If you like YYC Boost and you would like to support its further development, you can donate to paypal.me/kraifpatrik or purchase the asset from the Marketplace.

Links

You might also like...
Game code for Evennia servers designed for use with ALPACASclient.
Game code for Evennia servers designed for use with ALPACASclient.

ALPACASgame Game code for Evennia servers designed for use with ALPACASclient. This code is meant to be a type of "compatability layer" between the AL

Simple implementation of the classic Snake Game in under 100 lines of code
Simple implementation of the classic Snake Game in under 100 lines of code

Snake_Game Simple python implementation of the classic Snake Game in under 100 lines of code. Printscreen of the game: Imported Libraries: random; pyg

Game of life, with python code.

Game of Life The Game of Life, also known simply as Life, is a cellular automaton. It is a zero-player game, meaning that its evolution is determined

Découvrez CubeCraft Launcher, une application uniquement codé en Python et en Batch
Découvrez CubeCraft Launcher, une application uniquement codé en Python et en Batch

Découvrez CubeCraft Launcher, une application uniquement codé en Python et en Batch. Grâce à son interface graphique facile et intuitive, vous pouvez vous retrouver facilement.

A hangman game that I created. Thanks to Data Flair for giving me the code!

Hangman A hangman game that I created. Thanks to Data Flair for giving me the code! Run python3 hangman.py in a terminal if you have Python 3. Please

The repository that hosts the code that teaches a reinforcement learning - based bot to play 2048

The repository that hosts the code that teaches a reinforcement learning - based bot (based on policy gradients method) to play 2048

General Crossy Road Game using Python code

Python-Game General Crossy Road Game using Python code Using code such as function and while using turtle, I was able to recreate a beginner version o

Python code that gives the fastest path from point a to point b of a chess horse

PERSONAL-PROJECTS CARLOS MAGALLANES-ARANDA'S PERSONAL PROJECTS kchess.py is the code. its input is the start and the end. EXMPLE - a1 d5 its output is

Code for an arcade pop-a-shot style basketball game on Raspberry Pi

Basketball-Game Code for an arcade pop-a-shot style basketball game on Raspberry Pi, made over the course of winter break 2022. How To Run: Running th

Comments
  • Options to support improved automation

    Options to support improved automation

    As commissioned by Johnathan Fowler, I have added several features to the command-line tool to support usage of YYCBoost in a completely automatic fashion via GameMaker build hook scripts. I present the results of my work so far, so that you may incorporate it into the main project if you see fit to do so.

    These changes are motivated by the fact that, as YYCBoost worked before these changes, it was occasionally necessary to manually clean and recompile the project and restart YYCBoost. I have not fixed the root cause of these errors, but instead implemented support for a workaround wherein, upon each build of a project:

    1. The project build cache is cleared,
    2. The project is built once without any YYCBoost extension, and
    3. The project is built a second time with YYCBoost running in the background to produce the final result.

    We found step 2 to be necessary because, on some machines it was tested on, there was a race between the compiler and YYCBoost in modifying the project files that regularly resulted in build errors or the project being built without extensions.

    The exact changes introduced in this pull request are:

    • Added new command-line arguments /help, /background, /close, /auto, -buildpath, -pidfile, -timeout, -logfile, and -threads, as described in the new /help output:
      Usage: yycboost.exe [/?] [/b] [/c] [/a] [-bp=PATH] [-pf[=PATH]] [-t=SECONDS] [-j=COUNT] [-l=PATH] [CPP_DIR]
      
      Options:
        /?, /help             Show information about command-line arguments.
        /b, /background       Create a background process that is detached from the current terminal (if any) and allows the
                              calling process to continue immediately instead of blocking until finished. Implies "/auto".
        /c, /close            Signal an existing instance of YYCBoost to exit, by deleting the file given by the "-pidfile"
                              option, or, if that option is absent, the default PID file location. Do not perform any code
                              injection and immediately exit after this.
        /a, /auto             Use default values rather than prompting the user for any input.
        -bp, -buildpath=PATH
                              The path of the "build.bff" file corresponding to the target. If not specified, the user is
                              prompted to enter a path on the terminal, unless "/auto" is set, in which case the default
                              value of "%LocalAppData%\GameMakerStudio2\GMS2TEMP\build.bff" is used.
        -pf, -pidfile[=PATH]
                              Creates a text file at "PATH" containing the main process ID of YYCBoost and watches it for
                              changes: if the file is deleted, moved, or its contents changed, this acts as a termination
                              signal and causes the present instance to exit; otherwise, YYCboost deletes the PID file when
                              exiting normally. If "PATH" exists, YYCBoost overwrites it. If "-pidfile" is given without a
                              "PATH" argument, then it defaults to "yycboost.pid" in the current user's home directory (on
                              Windows: %UserProfile%).
        -t, -timeout=SECONDS
                              Close after this many seconds, or stay open until explicitly closed if SECONDS is 0. If not
                              specified, defaults to 300 if "/background" is set, or otherwise to 0.
        -j, -threads=COUNT
                              The number of CPU cores to use. If not specified, defaults to the total number of cores on the
                              system.
        -l, -logfile=PATH
                              Print status messages to PATH rather than to stdout/err. This is useful for debugging while
                              the "/background" option is active.
      
      Positional arguments:
        CPP_DIR               Load cache directory from command line (no injection, only cleanup, handy for GMS1.4) [Note:
                              this option doesn't appear to do anything useful; it has been kept for backward compatibility,
                              but may be removed in the future. The "cache directory" referred to here is the project-
                              specific directory for .gml.cpp files, for example "%LocalAppData%\GameMakerStudio2\Cache\GMS2
                              CACHE\YYCBoost_2083F10D\YYCBoost\Default\Scripts\llvm-win"; if this argument is present, then
                              the "build.bff" file is not loaded and its path need not be given.]
      
    • Added build hook scripts pre_run_step.bat, post_run_step.bat, and pre_package_step.bat under the example Game Maker project that automatically run YYCBoost when the project is built, using the workflow described above.

    All changes are backward compatible, so any previous usage of the command-line tool should continue to work as it did before. I have not updated the documentation under docs_src to reflect any of these changes, so, if these changes are accepted, that might be called for in the future.

    While modifying the Python code for the YYCBoost utility, I found some parts of the code that didn't make sense to me and appeared to possibly be dead code, but I left them as they were so as to avoid making unnecessary changes, and only annotated them with # TODO: lines to suggest reviewing them in the future.

    opened by joodicator 0
Releases(0.1.1)
Multiple hacks that breaks the game

Blooket-Hack All of the cheats are based on a game mode.

glizzz_y 484 Feb 25, 2022
Game Boy emulator written in Python

If you have any questions, or just want to chat, join us on Discord. It is highly recommended to read the report to get a light introduction to Game B

Mads Ynddal 3.7k Dec 30, 2022
A sprite ripper and converter for Com2uS' 2007 game Music World.

Music World Sprite Dumper This repository contains a python script reads an UNCOMPRESSED Music World pxo file and attempts to dump sprites from it. Th

Buu342 1 Mar 16, 2022
Simple darts game using Tkinter and sqlite3. Also associated with Python.

Ever wanted to play a simple and fun game before, and it even keeps a database of your score? Well here it is!! Introducing; Darts! A simple and fun g

an aspirin 2 Dec 19, 2021
中文版本的ai地牢,一个使用GPT-2的文字冒险游戏,使用清源CPM预训练模型finetune而成。

中文版本的ai地牢,一个使用GPT-2的文字冒险游戏,使用清源CPM预训练模型finetune而成。

icybee 178 Jan 03, 2023
The Sinclair ZX Spectrum BASIC compiler!

ZX BASIC Copyleft (K) 2008, Jose Rodriguez-Rosa (a.k.a. Boriel) http://www.boriel.com All files in this project are covered under the GPLv3 LICENSE ex

Jose Rodriguez 143 Dec 13, 2022
Super Mario Kart November 1991 Prototype Repair by MrL314

Super Mario Kart November 1991 Prototype Repair by MrL314

MrL314 51 Dec 26, 2022
Simple wordle clone + solver + backtesting

Wordle clone + solver + backtesting I created something. Or rather, I found about this game last week and decided that one challenge a day wasn't goin

1 Feb 08, 2022
Mandaw 2 Mar 01, 2022
This is a Python solver for the game Wordle, which recently received its PT-BR version

PT_BR_Wordle_Solver Este é um solver feito em Python do jogo Wordle, que recebeu sua versão PT-BR recentemente. Onde jogar Os sites para se jogar mais

Vinicius Jameli 1 Jan 24, 2022
AutoPilot is a game where the player controls a car and tries to get the highest score he can while not dying under falling cement blocks.

AutoPilot AutoPilot is a game where the player controls a car and tries to get the highest score he can while not dying under falling cement blocks. C

Enoc Mena 1 Nov 17, 2021
A minecraft bedrock server software written in python (3.X)

Podrum README also available in: English 🇺🇸 Français 🇫🇷 Deutsch 🇩🇪 Español 🇪🇸 Tiếng Việt 🇻🇳 Italiana 🇮🇹 Русский 🇷🇺 中文 🇨🇳 Is a Minecraf

Podrum 53 Nov 11, 2022
Sukoku-solver Python About Sudoku is one of the most popular puzzle games of all time

Sukoku-solver Python About Sudoku is one of the most popular puzzle games of all time. As a logic puzzle, Sudoku is also an excellent brain game. Bein

Harshith VH 1 Nov 20, 2021
Flappy Bird hack using Deep Reinforcement Learning (Deep Q-learning).

Using Deep Q-Network to Learn How To Play Flappy Bird 7 mins version: DQN for flappy bird Overview This project follows the description of the Deep Q

Yen-Chen Lin 6.4k Dec 30, 2022
Rudimentary CMD based implementation of the Tic Tac Toe game

Packages used: questionary random os (Requires Python 3.8 as walrus operators are used in the script) Contains the .py file (tictactoe.py) and an exe

Ashwin 1 Oct 15, 2021
Racing Fire - A simple game made with pygame.

Racing Fire A simple game in the making. Using pygame, this game is made to feel like an old arcade game. I developed a simple controller for it with

Builder212 1 Nov 09, 2021
A converter for the .BMR / .RLE bitmap files used in some Neversoft PS1 games.

Requirements python3 pyqt5 - can be installed with pip install PyQt5 pypng - Included Usage Instructions This program can be running py main.py in the

4 Jul 30, 2022
Pong is one of the first computer games that ever created, this simple

Pong-Game Pong is one of the first computer games that ever created, this simple "tennis like" game features two paddles and a ball, the goal is to de

Lateefah Ajadi 0 Jan 15, 2022
🐥Flappy Birds🐤 Video game. With your help I can go through🚀 the pipes. All UI is made with 🐍Pygame🐍

🐠 Flappy Fish 🐢 I am Flappy Fish 🐟 . With your help I can jump through the pipes and experience an interesting and exciting flight deep into the fi

MohammadReza 2 Jan 14, 2022
This is game 2048 created with moudle of python tkinter and OOP.

Game 2048 This is game 2048 created with moudle of python tkinter and OOP. This game build on classes. For start this game run: If you have python ver

0 Nov 02, 2021