Skip to content

Developer Setup

wootguy edited this page Dec 15, 2025 · 5 revisions

This wiki will set you up to develop/debug the mod and native plugins.

Setting up Visual Studio for development

  1. Set up the server as described here
  2. Open SevenKewp/build/sevenkewp.sln
  3. Right click the server project and select Properties.
  4. Set General -> Output Directory to the dlls path on your dedicated server (Half-Life/valve/dlls)
  5. Set up the Debugging section:
    • Set Command to hlds.exe
    • Set Command Arguments to whatever you want to launch with.
      Example: +map sc_test -dll dlls/server.dll -num_edicts 2047 -heapsize 65536 +maxplayers 32 +developer 1 +sv_cheats 1 +log on
    • Set the Working Directory to your server path (Half-Life/). The path must end with a slash.
  6. Repeat step 4-5 for any other configurations you want to use (Debug/Release/...)
  7. Right click the server project and select Set as Startup Project.
  8. Press F5. The server should start with the debugger attached.
Visual aids

image
image

Creating a new plugin

You can make a new plugin by duplicating an existing one and renaming the project inside CMakeLists.txt. A simple one to copy is plugins/HLCoopMapPlugins/restriction/. You may want to change the hlcoop_setup_plugin() line too depending on which type of plugin you're making. Map plugins use "plugins/maps/" and server plugins use "plugins/server/". Map plugins function the same as server plugins except that they're loaded/unloaded by specific maps via .cfg files. Server plugins are always loaded.

Adding the plugin to the solution

New plugins don't show up in Visual Studio until you reconfigure CMake. To do that:

  1. Open the CMake GUI
  2. Set the source code and binaries directories to SevenKewp and SevenKewp/build respectively.
  3. Click Configure, and then Generate
  4. If all goes well, Visual Studio should ask you to reload the projects and you'll see the new project. You may need to update your CMakeLists.txt file if there was an error.
Visual aid

image

Troubleshooting

Problem Solution
Unable to load engine, image is corrupt                                                                                                                                                                                     Check that the server.dll file is in the right place. Be sure you installed the steam_legacy version of hlds from SteamCMD.
Crash on startup or when loading plugins Right click the Solution and choose Rebuild Solution. This is necessary when changing build modes or updating APIs. Make sure the .dll files are in the right place, too. Each mode (Debug/Release/...) has a separate configuration you need to configure.
Dead on join and can't respawn Make sure sevenkewp/server.cfg was copied to the valve/ folder on your dedicated server. CFG files must be in valve/

Tips

  • Don't use the build_server_and_plugins script while developing. It discards all local changes not pushed to git.
  • Change the startup project to the one you're actively working on. This way, building with F5 will pick up changes and build only what's needed to test that project.
  • ASAN is great for debugging memory corruption (crashes that make no sense or have corrupted stacks pointing to nowhere). Enable it by switching to the "Asan" solution configuration (also do this for ReHLDS). The server will run much slower so it's not something you want to have on normally.
  • Visual Studio can't debug the server and client at the same time. Create a new build folder and solution via CMake if you want to do that.
  • Use Clumsy to simulate bad network connections. This is essential for client prediction testing. Dropped packets can help troubleshoot bad client HUD initialization as well.

Clone this wiki locally