Skip to content
Projekte

Über uns

MetaHook (https://github.com/nagist/metahook) porting for SvEngine (GoldSrc engine modified by Sven-Coop), as a client-side modding framework.

Spiele und Emulation

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

MetaHookSv

This is a porting of MetaHook for SvEngine (GoldSrc engine modified by Sven Co-op Team), as a client-side modding framework,

Mainly to keep you a good game experience in Sven Co-op or any other GoldSrc based games.

Most of plugins are still compatible with vanilla GoldSrc engine. please check each plugin's doc for plugin compatibility.

中文README

Compatibility (metahook loader only)

Engine
GoldSrc_blob (3248~4554) √
GoldSrc_legacy (< 6153) √
GoldSrc_new (8684 ~) √
SvEngine (8832 ~) √
GoldSrc_HL25 (>= 9884) √

Download

GitHub Release

Download MetaHookSv-windows-x86.7z. It contains both normal and blob launchers.

Risk of VAC ?

There is no VAC ban reported yet.

The binaries or executables of Sven Co-op are not signed with digital signatures thus no integrity check from VAC would be applied for them.

FAQ

Q. Why the game process hangs up / freeze occasionally for few seconds when playing on legacy / pirated version of GoldSrc game ?

A: This is because Valve uses gethostbyname with an non-existing hostname to query master servers. which is known to block the whole game loop for few seconds if the hostname is not available.

A: You can either add -nomaster to launch paramaters to prevent engine from querying invalid hostname or add -steam launch paramaters to force engine to use a valid master server source (which probably not gonna work on pirated game).

Q. Why the game process hangs up for tens of seconds on exiting / on restarting ?

A: This is because ThreadGuard.dll is waiting for Valve's network threads or similiar things to exit before actually exiting the game. See ThreadGuard for more details.

Q. Why I got black-screen in the main menu?

A: The SDL3-over-SDL2 compatibility layer is not working well with software-rendering mode. please switch to OpenGL mode by adding -gl in the launch parameter.

Q. What if game crashes due to out of memory ?

A: try launch parameter: -metahook_early_unload_mirrored_dll (This saves ~120MB system memory)

A: try ConVars: r_studio_lazy_load 1, r_leaf_lazy_load 1

Q. Why the terrain become all black when sv_cheats 1 ?

A: try r_lightmap 1.

One Click Installation (GUI Installer)

  1. Download the MetaHookSv-windows-x86.7z and extract the complete archive.
  2. Keep MetahookInstaller.exe and install/output/ together. Run the installer, select the game, then click Install.
  3. Launch Sven Co-op from Steam or the generated shortcut. Other games use the generated MetaHook for [GameName].lnk.

For scripted installation, MetahookInstallerCLI.exe from the same archive performs the same steps:

.\MetahookInstallerCLI.exe -appid 225840                                         # Install to Sven Co-op (Steam edition)
.\MetahookInstallerCLI.exe -appid 70 -gamedir "D:\SteamLibrary\steamapps\common\Half-Life" -moddir gearbox  # Install to Half-Life : Opposing Force (Steam edition)
.\MetahookInstallerCLI.exe -appid 225840 -uninstall

See MetahookInstaller for all arguments.

Manual Installation

  1. Download the MetaHookSv-windows-x86.7z and extract the complete archive.

  2. For Sven Co-op, merge svencoop/, its sibling resource directories and platform/ into the game root. For other mods, merge the common svencoop/ resources into the selected mod directory and add its matching resource directories.

Copy the MetaHook.exe / MetaHook_blob.dll (depending on your engine type) into the game root. Rename the normal launcher to svencoop.exe for Sven Co-op; other games use MetaHook.exe -insecure -game <mod-directory>. Legacy blob engines use MetaHook_blob.exe.

In the mod's metahook/configs/, copy plugins_svencoop.lst for Sven Co-op or plugins_goldsrc.lst for other games to plugins.lst, unless a user list already exists. BetterSpray is enabled by default for Sven Co-op.

SvenSoundcacheControl is included as an optional Sven Co-op plugin. Add SvenSoundcacheControl.dll to plugins.lst to refresh sound lists on every join, including same-map reconnects (cl_soundcache_alwaysflush 1, or 0 for original behavior). Keep its gamedata/svensoundcachecontrol directory with the DLL. See SvenSoundcacheControl.

For a non-blob engine that imports SDL2, copy both SDL2.dll and SDL3.dll into the game toot, to enable IME candidate support. The GUI installer checks this condition automatically.

Build Requirements

  1. Visual Studio 2022, with vc143 toolset

  2. CMake

  3. Git for Windows

  4. Python 3.8+ for gamedata synchronization, and the .NET 10 SDK for MetahookInstaller.

Build Instruction

Clone recursively, then run from the repository root in PowerShell:

git clone --recursive https://github.com/MetaHookSv/MetaHookSv
cd MetaHookSv
cmake -S . -B build/x86/Release -G "Visual Studio 17 2022" -A Win32
cmake --build build/x86/Release --config Release
cmake --install build/x86/Release --config Release

The aggregator builds MetaHook, MetaHook_blob, all enabled plugins (including BetterSpray), shared plugin libraries and CMake tools. Plugin list templates are owned by assets/svencoop/metahook/configs/ and installed with the output. The .NET tools build separately; see MetahookInstaller.

Debugging

Enable the optional Visual Studio startup project (building InstallerCLI from source requires a compatible .NET SDK and .NET 10 runtime):

sctipts/debug-<GameName>.bat

or

cmake -S . -B build/x86/Debug -G "Visual Studio 17 2022" -A Win32 -DMETAHOOKSV_ENABLE_LAUNCH_GAME=ON -DMETAHOOKSV_GAME_APPID=225840
# For a custom installation/mod, also pass:
# "-DMETAHOOKSV_GAME_DIRECTORY=D:/Games/Half-Life" -DMETAHOOKSV_GAME_APPID=70 -DMETAHOOKSV_GAME_MOD=gearbox

Open build/x86/Debug/MetaHookSv.sln, select Debug/Win32, set Launch-debugging / LaunchGame as the startup project if necessary, and press F5. This incrementally builds all enabled components and InstallerCLI, installs into a private staging directory, deploys through InstallerCLI, and starts the actual game launcher with the native C++ debugger. The dummy executable is never launched or installed. Release/Win32 also works.

METAHOOKSV_GAME_DIRECTORY defaults to empty (InstallerCLI discovers the Steam game by AppID); an explicit directory takes precedence. METAHOOKSV_GAME_MOD defaults to the app's base mod. METAHOOKSV_GAME_ARGUMENTS appends arguments after -insecure -game <mod>. Configuration builds the CLI and queries the game without deploying anything; invalid/missing games fail configuration. Reconfigure after changing the game/engine or moving its installation.

Each startup build redeploys, including when no source changed. The payload is the normal install directory install/<x86/x64>/<Debug|Release> for the build tree's configuration: it is cleared and re-staged with debug symbols, so it matches cmake --install for that prefix (the last one run wins). The aggregator uses the normal module names for Debug plugins/shared plugin libraries as well, matching the game's plugin list and dynamic library lookups. InstallerCLI preserves existing plugin selections, maps resources and selects svencoop.exe, MetaHook.exe or MetaHook_blob.exe; root PDBs are also deployed with their original names. DeployGame passes the payload path with -source, so the CLI does not search for the release-package install/output layout next to itself. Existing game files are overwritten according to the normal installer rules. Disabled components disappear from the staged payload, but previously deployed files are not uninstalled from the game.

In Tools / Options / Projects and Solutions / Build and Run, enable building out-of-date projects before running and set On Run, when build or deployment errors occur to Do not launch. Stop the game before redeploying; locked files fail the build and no process is terminated automatically. Use the debugger's Modules window to check symbol loading if a breakpoint remains unbound. The workflow is opt-in and does not change normal builds or CI when disabled.

Standalone plugin debugging

All repositories under Plugins/ support the same options when configured independently, including outside this checkout:

cmake -S Plugins/HeapPatch -B build/heappatch -G "Visual Studio 17 2022" -A Win32 -DMETAHOOKSV_ENABLE_LAUNCH_GAME=ON
cmake --build build/heappatch --config Debug --target LaunchGame

Install MetaHook and enable the plugin in the game's plugins.lst first. Standalone DeployGame builds the current plugin and its dependencies, stages its install, and updates only plugin files/resources, including plugin PDBs and mod-local dependency libraries. It does not update root launchers/runtime DLLs, create shortcuts, edit plugin lists or remove previously installed files. F5 uses the existing launcher; missing installations fail configuration. The aggregate DeployGame continues to deploy the complete enabled install.

Plugins share this repository's CMake module: METAHOOKSV_LAUNCH_GAME_MODULE_DIR overrides its directory; otherwise they use the surrounding aggregator checkout, or fetch a pinned source archive into the build tree without its submodules. They never configure the downloaded aggregate project. Disabled LaunchGame performs no module/CLI downloads.

METAHOOKSV_INSTALLER_CLI_EXECUTABLE can point to a self-contained CLI for offline use. Otherwise an available toolsrc/MetahookInstaller/src is built; when absent, CMake downloads MetahookInstaller-windows-x64.7z from the Installer release selected by METAHOOKSV_INSTALLER_RELEASE (default latest, or a fixed tag). The downloaded CLI needs no .NET installation. Plugin deployment requires a release supporting -plugins-only (v20261004c or later); a downloaded CLI must also support -source (see below).

Downloads use the release's SHA-256 when provided and cache the executable and resolved tag under build/<arch>/<config>/launch-game/installer/<release>. A valid cache is reused offline, without checking for newer releases. Select another tag or remove only that private cache directory to update; corrupt or incompatible caches report an error, and a release predating -source fails the deploy with a clear unknown-argument error. GitHub API rate limits can be avoided with GH_TOKEN or GITHUB_TOKEN in the environment; tokens are not cached. Each build tree receives its own CLI and deploys a fresh payload into install/<arch>/<config>. Keep Visual Studio's build-before-run enabled and its build-error behavior set to Do not launch.

MetaHook

The GoldSrc game launcher, mirroring hl.exe with capability of client-side modding.

Link

Plugins

VGUI2Extension

VGUI2Extension acts as a VGUI2 modding framework, providing capability for other plugins to install hooks / patches on VGUI2 components.

Link

CaptionMod

A plugin that adds closing-captioning, HUD text translatation, HiDpi support and Source2007-style chat dialog to game.

Link

BulletPhysics

A plugin that transform player model into ragdoll when player is dead or being caught by barnacle.

Link

Renderer

A graphic enhancement plugin that modifiy the original render engine.

You can even play with 200k epolys models and still keep a high framerate.

Link

HL25 startup video uses Mile.FFmpeg 6.1.0.0, downloaded once from its fixed release with SHA-256 verification. MILE_FFMPEG_ROOT (CMake or environment) can supply an extracted SDK instead. Its x86 DLL and license install under svencoop/metahook/dlls/Mile.FFmpeg/; only HL25 playback loads the DLL explicitly. See startup video and distribution requirements.

StudioEvents

This plugin can block studio-event sound spamming with controllable cvars.

Link

SteamScreenshots

This plugin intercepts snapshot command and replace it with ISteamScreenshots interface which will upload the snapshot to Steam Screenshot Manager.

Link

SCModelDownloader (Sven Co-op only)

This plugin downloads missing player models from https://wootguy.github.io/scmodels/ automatically and reload them once mdl files are ready.

Cvar : scmodel_autodownload 0 / 1 Automatically download missing model from scmodel database.

Cvar : scmodel_downloadlatest 0 / 1 Download latest version of this model if there are multiple ones with different version.

Link

PrecacheManager

This plugin provides a console command fs_dump_precaches to dump precache resource list into [ModDirectory]\maps\[mapname].dump.res.

  • The SoundSystem from Sven Co-op uses soundcache.txt instead of engine's precache system to precache sound files.

Link

ThreadGuard

This plugin intercepts Valve's Win32Thread creation and wait for all threads to exit before unloading the backed module, in case Valve's thread code gets running when the backed module is unloaded.

Managed modules that may create new threads and quit without waiting for thread termination :

hw.dll, GameUI.dll, ServerBrowser.dll

Link

ResourceReplacer

This plugin replaces in-game resources (mainly model and sound files) at runtime with customizable replace list files without actually manipulating the files, just like what Sven Co-op does with gmr and gsr files.

Link

InterpFix

This plugin keeps packet entities and their associated effects visible when high snapshot rates exhaust the position history required by ex_interp. It uses the oldest valid pose when the requested interpolation time is outside the history window.

Link

SCCameraFix (Sven Co-op only)

This plugin fixes camera glitching in spectator-view for Sven Co-op.

The updated spectator-view code credits to halflife-updated

Link

BetterSpray

BetterSpray is a plugin for MetaHookSV that enhances Sven Co-op and GoldSrc’s spray system with support for high-res images, dynamic reloading and cloud sharing.

Link

StandaloneView

This plugin lets other plugins render additional 3D views, such as a model preview in a menu, through the engine's own V_RenderView, with or without the Renderer plugin and without depending on it.

Link

CDAudioFix

This plugin fixes MP3 music that plays too quietly after an interrupted fade-out, for example when the next Career round starts while the MatchWin music is still fading. If a track ends during cd fadeout, the engine keeps the faded volume for the next mp3 play. The plugin restores MP3Volume on each new MP3 stream before playback starts.

Link

HUDColor

Changing HUD colors in game.

Also as a good template for you to build your own plugin.

Link

ABCEnchance (third-party) (Sven Co-op only)

ABCEnchance is a metahook plugin that provides experience improvement for Sven co-op.

  1. CSGO style health and ammo HUD
  2. Annular weapon menu
  3. Dynamic damage indicator
  4. Dynamic crosshair
  5. Minimap which is rendered at real time
  6. Teammate health, armor and name display with floattext.
  7. Some useless blood efx

Link

halflife-cli (third-party)

halflife-cli turns Half-Life / Sven Co-op into a CLI-driven program for automated testing or agent operation: it keeps the game window hidden but alive so screenshots still work, accepts console commands over stdin, and serves Source RCON on a random localhost port for discovery and remote control. A bundled Python MCP server exposes the game as callable tools (launch_game, run_command, send_key, snapshot, ...).

Link

MetaAudio (third-party) (GoldSrc only)

This is a plugin for GoldSrc that adds OpenAL support to its sound system. This fork fixes some bugs and uses Alure instead of OpenAL directly for easier source management.

Since SvEngine uses FMOD as it's sound system, you really shouldn't use this plugin in Sven Co-op.

Link

  • MetaAudio blocks goldsrc engine's sound system and replaces with it's own sound engine. You should always put MetaAudio.dll on top of any other plugins that rely on goldsrc engine's sound system (i.e CaptionMod) in the plugins.lst to prevent those plugins from being blocked by MetaAudio.

Trinity-EngineSv (third-party) (GoldSrc only)

This is a Trinity Engine porting for Counter Strike 1.6

Client-Side part of the mod it´s introduced as a metahook plugin.

Server-Side part of the mod it´s done with a modifidied reGame dll.

Link

BetterSpray (third-party)

BetterSpray is a plugin for MetaHookSV that enhances Sven Co-op’s spray system with support for multiple images, true aspect ratios, and dynamic reloading.

Link

Ähnliche Projekte entdecken

Wird geladen…