Radfordhound / HedgeLib

A C++ library and collection of tools that aims to make modding games in the Sonic the Hedgehog franchise easier.
MIT License
90 stars 29 forks source link
game gui havok modding modding-games sonic sonic-colors sonic-forces sonic-frontiers sonic-generations sonic-lost-world sonic-the-hedgehog sonic-unleashed tools

HedgeLib Logo

(Thanks to Gotta Play Fast for the wonderful project logo!)

IMPORTANT: All code committed to this repository, preferably, should follow these style guidelines.

Download

This repository uses AppVeyor to automatically build every commit! As such, you don't have to manually build any of the tools/libraries in this repository if you simply want to try out the latest versions.

HedgeLib

HedgeLib is C++17 library under the MIT license that aims to make modding games in the Sonic the Hedgehog franchise easier, similar to Dario's excellent "LibGens".

Right now, HedgeLib supports the following:

Hedgehog Engine 1/2

Ninja Next ("Sega NN")

Other

HedgeRender

A "simple" C++17 graphics/rendering engine designed around Vulkan. Some of the features include:

HedgeTools

A collection of miscellaneous tools that utilize HedgeLib.

Manually Building

Building HedgeLib is supposed to be easy. If you're having trouble building with the following instructions, please create an issue.

Windows (Visual Studio)

1: Install the following prerequisites (if you haven't already)

IMPORTANT: Be sure to select "Add CMake to the system PATH for all users" during the CMake installation, or you'll encounter an error while following these steps!

2: Open a PowerShell window and clone the HedgeLib repository

git clone https://github.com/Radfordhound/HedgeLib.git
cd HedgeLib

3: Download dependencies using the included Powershell script

.\Get-Dependencies.ps1

4: Generate a Visual Studio Solution (.sln file) with CMake

cmake -S . -B build

OPTIONAL: Use the -A flag to specify a specific architecture to target:

Value Architecture
Win32 32-bit x86 Architecture
x64 64-bit x86 Architecture
ARM 32-bit ARM Architecture
ARM64 64-bit ARM Architecture

OPTIONAL: Use the -G flag to specify a specific Visual Studio version to target:

Value Visual Studio Version
Visual Studio 17 2022 Visual Studio 2022
Visual Studio 16 2019 Visual Studio 2019
Visual Studio 15 2017 Visual Studio 2017
Visual Studio 14 2015 Visual Studio 2015

5: Open the resulting HedgeLib.sln file (contained within the "build" directory) in Visual Studio and build

Done!

macOS

1: Install the following prerequisites (if you haven't already)

2: Open a terminal window and install the required dependencies

Install all pre-packaged dependencies:

brew install cmake git rapidjson glm lz4 zlib glfw

Build/install robin-hood-hashing:

git clone https://github.com/martinus/robin-hood-hashing.git
cd robin-hood-hashing
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRH_STANDALONE_PROJECT=OFF
cmake --build build --config Release
sudo cmake --install build --config Release
cd ../

3: Clone the HedgeLib repository

git clone https://github.com/Radfordhound/HedgeLib.git
cd HedgeLib

4: Generate Makefiles or Xcode project files with CMake

You can build using Makefiles, or using an Xcode project.

Pick whichever one you prefer.

To generate Makefiles

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug

OPTIONAL: Replace Debug in the above command with Release to generate Release build Makefiles.

To generate an Xcode project

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -G "Xcode"

NOTE: If you get this weird error:

CMake Error: Xcode 1.5 not supported.

It means CMake isn't finding the correct Xcode installation. To fix it, run the following commands, but with "/Applications/Xcode_10.1.app" replaced with the path to your machine's Xcode.app file:

sudo /usr/bin/xcode-select --switch /Applications/Xcode_10.1.app
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -G "Xcode"

5: Build the code

If you generated Makefiles, execute the following command to build:

cmake --build build

If you generated an Xcode project, just open the resulting project (contained within the "build" directory) in Xcode and build

Done!

Linux

1: Install the required dependencies (or equivalents)

Ubuntu/Debian

Install Vulkan SDK Repository:

wget -qO - https://gist.githubusercontent.com/Radfordhound/6e6ce00535d14ae87d606ece93f1e336/raw/9796f644bdedaa174ed580a8aa6874ab82853170/install-lunarg-ubuntu-repo.sh | sh

Install all pre-packaged dependencies:

sudo apt install git build-essential cmake libuuid1 rapidjson-dev libglm-dev liblz4-dev zlib1g-dev libglfw3-dev vulkan-sdk

Build/install robin-hood-hashing:

git clone https://github.com/martinus/robin-hood-hashing.git
cd robin-hood-hashing
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRH_STANDALONE_PROJECT=OFF
cmake --build build --config Release
sudo cmake --install build --config Release
cd ../

Arch

sudo pacman -S git gcc make cmake util-linux-libs rapidjson glm lz4 zlib glfw-wayland vulkan-headers vulkan-validation-layers shaderc
yay -S robin-hood-hashing

Void

sudo xbps-install -S git gcc make cmake libuuid-devel rapidjson robin-hood-hashing glm liblz4-devel zlib-devel glfw-devel Vulkan-Headers Vulkan-ValidationLayers shaderc

2: Clone the HedgeLib repository

git clone https://github.com/Radfordhound/HedgeLib.git
cd HedgeLib

3: Generate Makefiles with CMake

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug

OPTIONAL: Replace Debug in the above command with Release to generate Release build Makefiles.

4: Build the code with CMake

cmake --build build

Done!