Skip to content
Proyectos

Acerca de

Motor completo de HeartGold

Otros proyectos

Cómo se miden estas cifras

What you can do

  • Dex Expansion (through Gen 6 almost entirely implemented)
  • Ability Expansion up to 512 (through Gen 6 almost entirely implemented)
  • Move Expansion with future generation moves
  • Item Expansion with future generation items

Crecimiento de estrellas medido

in 24h
+2
in 7 days
+3
in 15 days
+6
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

hg-engine

About

hg-engine is an engine overhaul for English Pokémon HeartGold with a focus on bringing battles up to par with recent mainline Pokémon games and their mechanics.

Disclaimer

This repository and its assets are a community endeavor. By its nature, using it and subsequently profiting off of it is profiting on the backs of all of our work, all of which is intended to be used to further hobbies and for everyone to have fun. You have my blessing to use code and assets from this repository as you please as long as there is no money involved, including optional donations through whichever platform to play your hack. The creations that stem from this repository must be freely accessible and not hidden at all behind any paywall, including those that prompt the player to pay optionally (Ko-Fi's style comes to mind here). The Credits should also be replicated in your hack's repository and/or the post to your hack--we all sit on the shoulders of giants here.

Table of Contents

Features

  • Dex Expansion (through Gen 6 almost entirely implemented)
  • Ability Expansion up to 512 (through Gen 6 almost entirely implemented)
  • Move Expansion with future generation moves
  • Item Expansion with future generation items
  • Mega Evolutions + Primal Reversions
  • New Weathers
  • Dynamic Speed
  • Accurate Turn Sequence
  • Accurate End-turn Resolution Order
  • Much More Customizable Trainers
  • Fairy Type
  • Hidden Abilities
  • Updated Effects for Existing Moves and Abilities
  • 30 PC Boxes

A more comprehensive list of features + a roadmap can be found by visiting the hg-engine wiki. Please read this README and the Wiki thoroughly before asking questions.

If you are looking to contribute to hg-engine, please see the CONTRIBUTING.md.

Quick Start (Docker)

The Docker image contains the entire toolchain, so with Docker you can skip all of the Setup Instructions below, for any platform, granted you run Docker on the Linux kernel. (macOS, Linux, WSL)

  1. Install Docker Desktop (macOS, Windows) or Docker Engine (Linux).
  2. Clone a copy of hg-engine by following Further Setup Instructions including submodules.
  3. Put your US HeartGold dump in the hg-engine folder as rom.nds. Step 1 of Build Instructions shows how to check that it is a correct dump.
  4. From the hg-engine folder, run:
  • docker build --tag hg-engine . once, or whenever the Dockerfile is changed.
  • sh docker-makerom.cmd (on Windows: docker-makerom.cmd) to build test.nds.

See Build Instructions (Docker) for more. On macOS, Linux and WSL, Docker builds in its own volume and only copies test.nds back, so it can be used next to a native setup in the same checkout. From cmd on Windows it builds in the checkout itself, so don't mix it with a native setup there.

Setup Instructions (Linux with apt)

  1. In a Terminal window, run the following command:
    • sudo apt-get install libpng-dev build-essential cmake python3-pip python3-venv git gcc-arm-none-eabi pkg-config pipx
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install rustup.
  2. Continue to Further Setup Instructions

Setup Instructions (Linux with apk)

  1. In a Terminal window, run the following command:
    • apk add libpng-dev build-base cmake python3 git
    • Grab your Alpine Linux version using the command grep PRETTY_NAME /etc/os-release. I get PRETTY_NAME='Alpine Linux v3.14', so my version is v3.14. Substitute that into the next command for [version].
    • apk add --no-cache binutils-arm-none-eabi gcc-arm-none-eabi newlib-arm-none-eabi --repository http://dl-cdn.alpinelinux.org/alpine/[version]/community
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install rustup.
  2. Continue to Further Setup Instructions

Setup Instructions (Linux with dnf or yum)

  1. In a Terminal window, run the following command (replace dnf with yum if applicable):
    • sudo dnf install libpng-devel arm-none-eabi-gcc-cs arm-none-eabi-newlib.noarch cmake python3 git make
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install rustup.
  2. Continue to Further Setup Instructions

Setup Instructions (Linux with pacman)

  1. In a Terminal window, run the following command:
    • sudo pacman -S libpng cmake python-pip python git arm-none-eabi-gcc arm-none-eabi-newlib pkg-config base-devel python-pipx
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install rustup.
  2. Continue to Further Setup Instructions

Setup Instructions (macOS)

  1. Follow Further Setup Instructions to pull a local copy of hg-engine.

Manually

All actions are expected to happen from the repository root.

  • Install Homebrew if you don't have it yet. Its installer also installs the Command Line Tools.
  • Run brew bundle to install the required packages from the Brewfile. The Arm toolchain (gcc-arm-embedded) asks for your macOS password due to needing root permissions.
  • Run git submodule update --init --recursive to fetch the git submodules.
  • python3 --version must show 3.11 to 3.14. If it doesn't, run echo 'export PATH="$(brew --prefix [email protected])/libexec/bin:$PATH"' >> ~/.zprofile and open a new Terminal window.
  • echo "4fcded0e2713dc03929845de631d0932ea2b5a37 rom.nds" | shasum --algorithm 1 --check to check your rom.nds, once you have put it in place. It should print rom.nds: OK.

From script

[!WARNING]
Always inspect shell scripts before running them.

In Terminal, from the hg-engine folder, run ./scripts/setup-macos.sh. It installs everything listed in the Brewfile, fetches the git submodules and checks your rom.nds if it is already there. It can be run again, for example after pulling updates. If macOS asks to install the Command Line Tools when you first run git, accept and run the command again afterwards.

After installing manually or via script, continue to Build Instructions

Setup Instructions (Windows on WSL)

  1. Open the Windows Command Prompt as Administrator (look up "Command Prompt" on your Start Menu, Right Click -> Run as Administrator). Once you have done that, execute the following command: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all

    • Once this process finishes, you will have to restart your PC by entering "Y"
    • If Windows is not cooperating and has issues logging in when your PC reboots, do not worry! You likely just need to enable virtualization in your BIOS. For instructions on that, look at Microsoft Support: Enable Virtualization on Windows.
  2. Go to the Microsoft Store and search "Ubuntu". Go to any one of the version's pages in the store and click the blue "Get" button. It shouldn't matter which you choose.

    • Once Ubuntu finishes installing, launch it from its page in the Microsoft Store so it can finish setting itself up.
    • Once Ubuntu finishes setting itself up, it will ask you to enter a username (in lowercase letters only) and password. After doing so, you can close Ubuntu.
  3. Open the "Run" window by pressing the Windows key and R at the same time, then type in wsl and press Enter. This is how you should open WSL from now on.

    • Note that you can also delete the folder path at the top of the File Explorer and just type in wsl to open WSL at the file explorer.
  4. In WSL, type in sudo apt update, and after it finishes processing, type in sudo apt upgrade. This will take quite a while, so find something else to do in the meantime. These two commands together will update all of the packages that came pre-installed with Ubuntu.

    • At some point during the process, you'll be asked to confirm whether you want WSL to restart automatically during package updates. We'll select "Yes" and press Enter. The process will then proceed.
  5. In WSL, run the following commands:

    • sudo apt-get install build-essential git libpng-dev cmake python3 python3-pip python3-venv gcc-arm-none-eabi pkg-config pipx
      • You will be asked to confirm the installation, so press "y" followed by Enter to do so.
    • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install rustup.
  6. Once the last process has finished, continue to Further Setup Instructions

Setup Instructions (Windows on MSYS2)

  1. Install MSYS2 from the website.
  2. Open up the base MSYS2 with the light purple background.
  3. Execute the commands:
    • pacman -Syu
    • pacman -S gcc base-devel cmake python git mingw-w64-x86_64-arm-none-eabi-gcc p7zip zlib-devel mingw-w64-x86_64-rust pipx
    • export PATH=$PATH:/mingw64/bin
    • echo export PATH='$'PATH:/mingw64/bin >> ~/.bashrc
    • python3 -m ensurepip --upgrade
  4. Download libpng and install it. Decompress it to a folder, and then open MSYS2 in that source folder and run:
    • ./configure --prefix=/usr
    • make check
    • make install
  5. Once that process has finished, continue to Further Setup Instructions

Further Setup Instructions (All Platforms) (Continued from Individual Sections)

You now need to get a local copy of the hg-engine source code. Choose one of the options below.

Option A: Continue with a fork (RECOMMENDED)

This approach provides a smoother long-term experience. It allows you to store your code changes on GitHub in case of computer issues as well as providing a way for you to get the latest development changes from upstream. This approach requires a little bit more reading but is

  1. Create a GitHub account.

  2. Read the short GitHub docs for setting up authentication if you're unfamiliar (docs).

  3. Fork BluRosie/hg-engine via GitHub (docs).

  4. Run the following commands in Terminal/WSL, replacing [YOUR-USERNAME] with your GitHub username:

    mkdir -p ~/git && cd ~/git
    git clone --recursive https://github.com/[YOUR-USERNAME]/hg-engine.git
    cd hg-engine
    
  5. Add BluRosie/hg-engine as an upstream source so you can pull changes

    git remote add upstream https://github.com/BluRosie/hg-engine.git
    
  6. Continue to Build Instructions

Option B: Continue without a fork (NOT recommended)

This approach is the fastest way to get working with hg-engine and does not require a GitHub account. This is generally not recommended because you can easily lose your progress if WSL has issues, and you will have a harder time keeping up with repository changes.

  1. Run the following commands in Terminal/WSL:
mkdir -p ~/git && cd ~/git
git clone --recursive https://github.com/BluRosie/hg-engine.git
cd hg-engine
  1. Continue to Build Instructions

Build Instructions (All Platforms) (Continued from Further Setup Instructions)

  1. Get your ROM, rename it to rom.nds and place it in ~/git/hg-engine.
    • [Windows] You can easily find where this is on MSYS2 or WSL by running the command explorer.exe . from the WSL terminal. This will open the File Explorer to the folder where hg-engine is located.
      • For WSL this will likely be in the Linux drive that has newly been appended to the bottom of your files. From there, it will likely be at Linux\Ubuntu\home\[USERNAME]\git\hg-engine.
      • For MSYS2 this will likely be in the C:\msys64\home\[USERNAME]\git\hg-engine directory.
    • Check that your ROM is a clean, untrimmed US HeartGold ROM. Its SHA-1 should be 4fcded0e2713dc03929845de631d0932ea2b5a37. From the hg-engine folder, run the command for your platform; it should print rom.nds: OK.
      • Linux/WSL/MSYS2: echo "4fcded0e2713dc03929845de631d0932ea2b5a37 rom.nds" | sha1sum --check
      • macOS: echo "4fcded0e2713dc03929845de631d0932ea2b5a37 rom.nds" | shasum --algorithm 1 --check
  2. In Terminal/WSL, type make. It will start with building all the tools necessary, then move to the code, then the rest of the files in the folders.
    • make is initially very slow. It can be sped up by specifying a certain amount of threads through the -j# flag, where # is a number. The ideal amount of threads is typically the number that is given from nproc--so my make command, with nproc giving me 8, is typically make -j8.
    • If you are a macOS user who is on arm64 (an Apple M Processor), you may have issues running this command due to libpng linker issues caused by an expected architecture mismatch. You can get around this issue by going to Applications/Utilities/, right clicking on Terminal, Clicking "Get Info", and clicking the "Open using Rosetta" checkbox so it becomes blue. Close Terminal if you had it open, then open it again and run the following:
      • cd ~/git/hg-engine
      • make tools/nitrogfx
      • make tools/ENCODE_IMG
      • make tools/btx
    • Make sure to undo your changes to Terminal after you are done so it will run as a native arm64 application again (uncheck the checkbox from before).
  3. After the process completes, a new file will appear in the hg-engine folder named test.nds.
    • It is important to note that this alone will not add new Pokémon to the wild, trainers, etc...; it simply makes them available in your game. It is up to you to place them.
    • You can edit various game data such as trainers, dex entries, Pokémon stats, and more in the files in data/ (for example data/Trainers.c, data/Species.c, data/Moves.c and data/Encounters.c).

Build Instructions (Docker)

Docker handles the setup for you with relative replicability across platforms. This abstracts a bit of it away from the user and is slightly slower, but such is the price of simplicity.

To set up for the first time, all that needs to be run is: docker build --tag hg-engine .

To build, you can then run a simple shell script to build the test.nds: sh docker-makerom.cmd (on Windows: docker-makerom.cmd)

This script is written in such a way that it works on every platform (including from cmd on Windows).

You will still have to make clean and make clean_code manually when changing code or other things that won't build for some reason. But this makes setup really convenient.

Updating Your Repository

Normal Clone

If you cloned the repository without forking, follow these steps:

  1. Change to your local repository:
    • cd ~/git/hg-engine
  2. Fetch the latest changes
    • git fetch origin
  3. Pull the latest changes from the main repository. Note: without a fork, your pull may fail due to uncommitted changes.
    • git pull origin main

Fork

If you cloned your own fork and added an upstream remote, follow these steps:

  1. Change to your local repository:
    • cd ~/git/hg-engine
  2. Fetch the latest changes from the main repository:
    • git fetch upstream
  3. Merge upstream/main into your current branch:
    • git merge upstream/main

If the CLI indicates merge conflicts, check this article for how to navigate them.

Credits

Explorar proyectos relacionados

Cargando…