Coder Social home page Coder Social logo

vannybuns / hedgelib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radfordhound/hedgelib

0.0 0.0 0.0 4.58 MB

A C# library and collection of tools that aims to make modding games in the Sonic the Hedgehog franchise easier.

License: MIT License

C++ 91.52% C 3.83% PowerShell 0.40% CMake 4.12% HLSL 0.12%

hedgelib's Introduction

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

  • "PACx" Packfiles (.pac; v403/v402/v3/v2)
  • Terrain instance infos (.terrain-instanceinfo; v0/v5)
  • Skeletal Models (.model; v2/v4/v5)
  • Terrain Models (.terrain-model; v5)
  • Materials (.material; v1/v3)
  • Texsets (.texset; v0)
  • Texture entries (.texture; v1)
  • "Mirage" headers (used in models/materials from Lost World and beyond)
  • "Needle" archives (used in models from Frontiers and beyond)

Ninja Next ("Sega NN")

  • Node Motions (Skeletal Animations) [.xnm, .snm, .gnm, .cnm, .inm, .enm, .ynm, .znm]
  • Camera Motions [.xnc, .snc, .gnc, .cnc, .inc, .enc, .ync, .znc]
  • Light Motions [.xnl, .snl, .gnl, .cnl, .inl, .enl, .ynl, .znl]
  • Morph Motions [.xnf, .snf, .gnf, .cnf, .inf, .enf, .ynf, .znf]
  • Material Motions [.xnv, .snv, .gnv, .cnv, .inv, .env, .ynv, .znv]

Other

  • "BINA" binary container format (v1/v2)
  • "AR" Archives (.ar/.pfd)
  • Packed File Indexes (.pfi)

HedgeRender

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

  • A simple render graph system that allows for specifying render passes/subpasses in a simple yet powerful manner.
  • An "upload batch" system that allows for fast and easy batching of resource uploads to the GPU.

HedgeTools

A collection of miscellaneous tools that utilize HedgeLib.

  • HedgeEdit
    • A C++17 all-in-one ("AIO") editor built on top of HedgeLib and HedgeRender that aims to support quick and powerful editing of levels/resources from all games HedgeLib supports.
  • HedgeArcPack
    • A C++17 Command-Line tool that allows quick and powerful extraction and generation of archiving formats from all games HedgeLib supports.
  • HedgeNeedle
    • A C++17 Command-Line tool that allows extraction and generation of Hedgehog Engine 2 Needle "archives".
  • HedgeOffsets
    • A C++17 Command-Line tool that reads the offset table in BINA/Hedgehog Engine formats and prints each offset. Useful for debugging and reverse-engineering of undocumented formats which contain an offset table.

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 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.

  • Makefiles are simple and don't require Xcode to be installed.
  • Xcode is Xcode.

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 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 glm lz4 zlib glfw-wayland vulkan-headers vulkan-validation-layers shaderc
yay -S robin-hood-hashing

Void

Install all pre-packaged dependencies:

sudo xbps-install -S git gcc make cmake glm liblz4-devel zlib-devel glfw-devel Vulkan-Headers Vulkan-ValidationLayers shaderc

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 ../

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!

hedgelib's People

Contributors

radfordhound avatar thesupersonic16 avatar skmaric avatar sajidur78 avatar blueskythlikesclouds avatar actualmandm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.