Skip to content

A faithful recreation of the Undertale combat system in C++ and SFML. Features a custom bullet hell engine, State Machine architecture, and data-driven enemy design using JSON.

Notifications You must be signed in to change notification settings

Oreo80/undertale-ribbit-edition

Repository files navigation

Undertale: Ribbit Edition

A faithful recreation of the Undertale combat system, developed in C++ using the SFML graphics library. This project reproduces the original engine architecture, implementing turn-based combat mechanics, a "Bullet Hell" system for dodging attacks, and State Machine-based interaction.

The project demonstrates the use of Object-Oriented Programming concepts, resource management, and real-time entity manipulation.

Gameplay Demo

Features

  • Complete Combat System: Implementation of the Fight / Act / Item / Mercy gameplay loop.
  • Bullet Hell Mechanics: Projectile generation system featuring various mathematical patterns (sine waves, geometric shapes, tracking).
  • Custom Graphics Engine:
    • Text rendering using Bitmap Fonts (CSV analysis + textures) to maintain a pixel-perfect look, strictly avoiding standard anti-aliasing to preserve the retro aesthetic.
    • Support for Stateful Sprites for dynamic animations.
  • Data-Driven Design: Enemy attributes (HP, attack, dialogue, behavior) are loaded from external JSON files, allowing parameter modification without recompilation.
  • Audio System: Management of background music and sound effects.
  • State System: Fluid transitions between Splash Screen, Menu, Gameplay, and Game Over states.

How to Play

The objective is to survive the encounter with the enemy "Froggit". The game alternates between the player's turn (selecting actions) and the enemy's turn (dodging projectiles).

Controls

Action Primary Key Secondary Key
Move Up W Arrow Up
Move Down S Arrow Down
Move Left A Arrow Left
Move Right D Arrow Right
Confirm / Select Z Enter
Cancel / Back X Shift
Fullscreen F4 -
Quit ESC -

Gameplay Strategies

There are three methods to end the battle:

  1. Pacifist Path:

    • Select ACT from the menu.
    • Choose Compliment or Threaten to interact with Froggit.
    • Once the enemy's name turns yellow, go to the MERCY menu and select Spare.
  2. Neutral Path:

    • Select FIGHT.
    • Attack the enemy until their HP reaches 0.
  3. Low HP Mercy:

    • Attack the enemy until their HP drops below 10.
    • The enemy will become reluctant to fight, at which point you can use the Spare command.

Download

If you don't want to compile the game from source, you can download the latest pre-built version from the Releases page:

Download Latest Release

Note: Download the .zip file, extract it, and run the executable.

Prerequisites

To compile and run this project, you need the following:

  • C++ Compiler: Compatible with C++20 or newer (GCC, Clang, MSVC).
  • CMake: Version 3.10 or newer.
  • SFML: Version 3.0.0.
  • External Libraries:
    • nlohmann/json (for JSON parsing).
    • OpenAL (included with SFML).

Build Instructions

The project is configured using CMake. You can use the terminal commands below or the provided helper scripts.

1. Configuration Step

Standard configuration:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
# or ./scripts/cmake.sh configure

For Windows with GCC (using Git Bash):

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -G Ninja
# or ./scripts/cmake.sh configure -g Ninja

To configure with ASan enabled (Note: does not work on Windows with GCC), use -DUSE_ASAN=ON:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DUSE_ASAN=ON
# or ./scripts/cmake.sh configure -e "-DUSE_ASAN=ON"

At this step, you can also request project file generation for various IDEs.

2. Build Step

cmake --build build --config Debug --parallel 6
# or ./scripts/cmake.sh build

The parallel option specifies the number of files compiled simultaneously.

3. Installation Step (Optional)

cmake --install build --config Debug --prefix install_dir
# or ./scripts/cmake.sh install

For more details, see scripts/cmake.sh.

Note: The build/ and install_dir/ folders are added to .gitignore as they contain generated files and should not be versioned.

Project Structure

  • Headers/: Header files (.h) defining class interfaces.
  • Source/: Actual implementation (.cpp) of game logic.
  • json/: Configuration files for enemies (e.g., froggit.json).
  • img/, fonts/, sounds/: Media resources required to run the game.

License and Credits

  • This project is a fan work made for educational purposes.
  • Sprites, fonts, and sounds are the intellectual property of the Undertale creator (Toby Fox).
  • The source code uses the SFML library (Zlib License) and nlohmann/json (MIT License).

About

A faithful recreation of the Undertale combat system in C++ and SFML. Features a custom bullet hell engine, State Machine architecture, and data-driven enemy design using JSON.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors