Skip to content
 
 

Repository files navigation

HAC2

Halo Custom Edition client enhancement fork, modernized for a Visual Studio Code and CMake workflow in 2026.

If you only want to install HAC2 and do not want to build it yourself, use the GitHub Releases page. Download the latest Release ZIP and follow the install guide in that release.

This fork is currently focused on building and testing HAC2 for:

Halo Custom Edition Patch 1.0.10
C:\Program Files (x86)\Microsoft Games\Halo Custom Edition

Halo Custom Edition is a 32-bit game, so HAC2 must also be built as 32-bit Win32/x86. This remains true on modern 64-bit Windows 11 systems. A 64-bit DLL cannot be loaded into the 32-bit Halo CE process.

Purpose Of This Fork

The original HAC2 codebase was a Visual Studio 2010-era project with hard-coded developer paths, legacy SDK assumptions, and optional integrations that no longer exist in a clean modern setup. This fork keeps the client enhancement work intact while making the project practical to compile from Visual Studio Code with Visual Studio 2022 Build Tools and CMake presets.

The goal is not to rewrite HAC2 into a new project. The goal is to preserve the useful Halo CE client improvements and make them buildable, inspectable, and testable on a current Windows development machine.

Current Build Target

The maintained target is Halo Custom Edition 1.0.10. The default CMake preset assumes the game is installed here:

C:\Program Files (x86)\Microsoft Games\Halo Custom Edition

The deploy target copies:

hac.dll -> Halo CE install root
loader.dll -> controls\loader.dll

It does not replace the stock controls\Controls.dll.

The loader is local-only. It loads hac.dll from the Halo CE install root and does not download or update DLLs at runtime.

Feature Areas

HAC2 historically provides a set of client-side improvements for Halo CE/Halo PC, including:

  • widescreen HUD support
  • field-of-view control
  • draw distance improvements
  • map checksum caching
  • custom chat
  • server bookmarks
  • server queueing
  • map downloading support
  • sightjacker
  • scope blur removal
  • HUD color customization
  • object and particle/rendering limit adjustments
  • Optic medals, images, animations, Lua-driven event handling, and custom pack audio

This fork is presently concerned with compiling and validating those client enhancement paths against Halo CE 1.0.10.

Installing A Release Build

If you download prebuilt DLLs from a GitHub release, install them into the Halo Custom Edition folder like this:

hac.dll    -> C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\hac.dll
loader.dll -> C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\controls\loader.dll

If the release includes D3DX9_43.dll, or if Halo reports that D3DX9_43.dll is missing, place the x86 DLL here:

C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\D3DX9_43.dll

Halo CE's stock multiplayer chat UI is loaded from .ksml files in the content directory and depends on the legacy 32-bit MSXML 4 runtime. If in-game chat text or the chat input box does not render, install the bundled redist:

C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\redist\msxmlenu.msi

Do not replace controls\Controls.dll.

Administrator rights are usually required only for copying files into Program Files (x86). Halo CE itself does not need to be run as administrator for HAC2 to load.

Running And Verifying

No special shortcut arguments are required for HAC2 to load. Halo CE loads DLLs from its controls directory; controls\loader.dll is loaded by the game and then loads hac.dll from the Halo CE install root.

Use the normal game executable:

C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\haloce.exe

For verification, use a shortcut with -console so you can type a HAC test command:

"C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\haloce.exe" -console

After the game reaches the main menu, open the Halo console and run:

hac_verify
seanaero

Expected output includes:

HAC2 verify: version 2.0.0, config Release, git <sha>
HAC2 verify: target Halo CE 1.0.10 Win32, Optic audio miniaudio
v011 "Wake me, when you need me."

This command also plays audio/untouchable.mp3 from the installed Optic medal packs when available. It is a short runtime check for the miniaudio Optic audio backend.

Use hac_verify audio when you want the official verification command to also run the Optic audio smoke test.

seanaero is built by default in this fork through HAC_ENABLE_TEST_COMMANDS so manual deployed builds can be identified quickly. Public release builds can disable that option while keeping hac_verify available.

The -console argument is only for entering console commands. It is not part of the HAC2 loader mechanism. Do not use -devmode for this basic load test.

Avoid using Halo CE's -window launch flag for routine HAC2 testing. Runtime testing showed that haloce.exe -console -window can remain as a background process after the game window closes even when HAC2 is disabled. This is documented as a base Halo CE/windowed-mode behavior rather than a HAC2 shutdown bug.

Timer commands are present and command execution has been smoke-tested, but full timer behavior should be validated on a known supported map/scenario before treating timer behavior as fully certified.

Example Optic Medal Packs

HAC2 includes the Lua-scriptable Optic medal system. These historical/example packs are compatible with Optic, but their Halo-themed assets are not owned by this fork:

Place the ZIP files in the HAC packs folder and do not extract them:

Documents\My Games\Halo CE\hac\packs\

For Halo PC, the equivalent historical profile path is:

Documents\My Games\Halo\hac\packs\

Use these console commands in-game:

optic
optic load halo3
optic load haloreach
optic load halo4
optic unload

optic lists available packs, optic load <pack> loads a pack by ZIP filename without the .zip extension, and optic unload disables the active pack.

Runtime Stability Changes

This fork disables two legacy console-related hooks by default after runtime testing on Halo Custom Edition 1.0.10:

  • the console text fade-speed hook
  • the terminal password-mask hook for the old login <username> <password> command

The console fade hook was originally a cosmetic fix for Halo's frame-rate-bound console text fade behavior. On a modern Windows 11 system running Halo CE at 120 Hz, it caused the game to crash after console output was printed and the console was closed. Removing this hook preserves command execution and avoids a runtime crash. The tradeoff is that console text uses Halo's original fade behavior.

The password-mask hook only supported the old HAC account login command path. That path is not active in this build, so keeping the hook installed would add risk without restoring a working login feature.

HAC-rendered server/query text is sanitized before display. This strips leading blank, control, non-breaking-space, and common zero-width characters from saved bookmark names and helper text so servers that pad names to influence list ordering do not leak those characters into HAC UI. Halo CE's stock server browser is still engine-owned; changing its actual sort key should be handled as a separate runtime hook after the server-list data path is verified.

Map download input is also validated before filesystem or mirror requests are made. Invalid map names, path traversal, malformed mirror hostnames/URIs, oversized mirror metadata, missing Content-Length, and write failures are handled as download errors instead of unchecked legacy behavior.

The seanaero command includes a small vXXX marker so deployed builds can be verified in-game. Increment this marker when producing a new manual runtime test build.

Building

See BUILDING.md for the full build guide.

See CHANGELOG.md for the running list of modernization changes made from the recovered/original fork state.

See THIRD_PARTY.md for the maintained dependency and vendored legacy-code inventory.

See THIRD_PARTY.yml, NOTICE.md, and LICENSES/ for release-oriented license metadata.

Typical command-line build:

cmake --preset vs2022-win32
cmake --build --preset release -- /m

Build output is written under:

out/build/vs2022-win32/bin/<configuration>

To create a copy-ready release folder:

cmake --build --preset stage-release -- /m

The staged files are written under:

out/build/vs2022-win32/package/HAC2-2.0.0-Release

The same target also creates:

out/build/vs2022-win32/package/HAC2-2.0.0-Release.zip
out/build/vs2022-win32/package/HAC2-2.0.0-Release.zip.sha256

The staged folder includes checksums.txt for all packaged files.

The release package also includes scripts/Install-HAC2.ps1. Run it from an elevated PowerShell session after closing Halo CE:

powershell -ExecutionPolicy Bypass -File .\scripts\Install-HAC2.ps1

The installer refuses to run while haloce.exe is active, backs up existing DLLs by default, copies hac.dll, controls\loader.dll, and D3DX9_43.dll when present, then verifies SHA-256 hashes after copying.

Runtime Logging

HAC2 always writes important diagnostic messages to OutputDebugStringA. Optional file logging can be enabled before launching Halo:

$env:HAC_ENABLE_FILE_LOGGING = "1"
$env:HAC_LOG_FILE = "C:\Ai\HAC2\hac2.log"

If HAC_LOG_FILE is not set, file logging writes to %TEMP%\hac2.log.

Visual Studio Code Workflow

This repo includes VS Code configuration for CMake Tools:

.vscode/extensions.json
.vscode/settings.json
.vscode/tasks.json
.vscode/launch.json
CMakePresets.json

Use the Visual Studio 2022 Win32 preset. The important detail is Win32, not x64, because the target game process is 32-bit.

Modernized Dependencies

Several old assumptions were replaced with reproducible 2026-friendly defaults.

DirectX / D3DX9

The original project expected the legacy DirectX SDK June 2010 to be installed globally. This fork defaults to fetching Microsoft's Microsoft.DXSDK.D3DX NuGet package, which provides the old D3DX headers, import libraries, and runtime DLLs needed by this code without requiring a machine-wide DirectX SDK install. The fetched NuGet package is SHA-256 verified by CMake.

You can still point CMake at a local legacy DirectX SDK if needed.

Lua

The old project expected a local Lua project/library. This fork defaults to fetching and building Lua 5.1.5 through CMake so Optic Lua scripting can build without a manually prepared Lua SDK. The downloaded Lua archive is SHA-256 verified by CMake.

miniaudio

Optic custom MP3 playback now uses miniaudio by default. CMake downloads the pinned miniaudio.h 0.11.25 single-header release into .deps and verifies its SHA-256 hash before compiling it into hac.dll.

This replaces the old default dependency on libZPlay for Optic pack audio while keeping the same pack format and Lua call:

queue_audio("audio/double_kill.mp3")

The Optic pack still owns the MP3 bytes, OpticPlayback decodes them from memory, and playback follows Halo's master volume value.

Boost

The old source used Boost for small conveniences such as string trimming, lexical conversion, and typedef helpers. Those uses have been replaced with standard C++ or small local helpers. Pulling in Boost for those cases made the build heavier without materially helping the Halo CE client feature set.

Legacy Pieces Left Out By Default

Some historical pieces are intentionally disabled or excluded from the default build.

Anticheat

The anticheat path was an idea from the older project history, but it was not incorporated into the released client in a complete form. The old project files refer to Anticheat.cpp/.h and Antidebug.cpp/.h, but those files are not present in the recovered source trees. There are also old No-AC build configurations, which confirms that building without anticheat was already a known path.

This fork therefore does not define ANTICHEAT and does not attempt to recreate that missing system. The target here is the HAC2 client enhancement DLL, not an unreleased anticheat product.

libZPlay

libZPlay is removed from the maintained build path. Optic audio now uses the default miniaudio backend.

In this project, libZPlay was used only for Optic pack custom audio playback. For example, an Optic pack could contain:

audio/double_kill.mp3
images/double_kill.png
script.lua

The Lua script could call:

queue_audio("audio/double_kill.mp3")

That flows through Optic's Lua API, loads the MP3 from the pack, and plays it from memory. In the 2026 build, miniaudio handles that playback. Halo's normal multiplayer announcer sounds still use the game engine's own sound path and do not require miniaudio or libZPlay.

libZPlay was removed because it added a GPL legacy dependency for a narrow feature that now has a small permissive replacement. This is not a problem for the targeted function of HAC2 because Optic visuals, Lua scripting, map downloading, HUD/FOV work, custom chat, bookmarks, and the loader path do not depend on libZPlay.

Discord RPC

Discord Rich Presence is optional and disabled by default. The old Discord RPC library is deprecated, and rich presence is not required for the Halo CE client enhancement path. The code is guarded so it can be revisited later without blocking the default build.

HAC Account Login / Legacy Networking

The old login <username> <password> command is not functional in this fork's default build. In the recovered source, the command handler's MD5 generation and LoginEvent dispatch are commented out, and the networking startup that would connect to master.haloanticheat.com is also disabled.

Because that account-service path is incomplete and depends on historical HAC infrastructure, this fork removes the password-masker hook and regex dependency. Typing login now prints a removal notice. The client enhancement features, local console commands, loader, and Halo CE runtime patches remain the focus.

Private Font Support

The old project references private font assets through encfont.h, but that file is not present in the recovered sources. The private font path is disabled by default. Custom chat can still build without it.

hacencrypt

The old Visual Studio project ran a post-build hacencrypt.exe step. That binary/project is not present in the recovered source tree, and it is not needed to compile a local development build for Halo CE 1.0.10. It remains excluded from the modern build path.

librsync

One old source tree includes a bundled librsync-0.9.7 directory, but the HAC client source does not use it in the current build path. It is not part of the modern CMake build.

License

This project is licensed under the MIT License. See LICENSE.

About

Halo: Combat Evolved & Custom Edition mod

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages