Skip to content
Drake edited this page Jul 25, 2021 · 6 revisions

This page serves as an overview for the MClientTemplate and the systems it contains.

I will not be including any in-depth documentation here, as that is included within a set of "Demo" classes in the code, which you should look at for full explanations of how each system functions and should be used.

What is the MClientTemplate?

The MClientTemplate is a template project for the creation of Duck Game "mods". Specifically, the type of mods known as "Client Mods", which, as the name would suggest, affect only the user experience and do not add or alter any in-game content, making them usable in public games without all players needing to have them installed.

"Client Mods" are typically difficult to create compared to normal mods, as they require more advanced systems and dynamic code modification to create any kind of useful functionality. That functionality may be purely cosmetic changes, such as Shadersmod (which allows applying full-screen Shaders), or it may include fixes and quality-of-life options, such as QOLMod does, or yes, it may include "hacks" or "cheats".

All of these various uses for client mods generally require a number of similar core systems that have to be implemented from scratch every time. That is a lot of work, and makes creating complex things very slow and difficult to do, especially as there is no documentation for the internal code of Duck Game, meaning people often have to struggle to figure out what functions and systems they need to use and implement.

The MClientTemplate aims to simplify this, by providing a number of those systems that are often needed or useful to have, along with systems to make the general process of developing these Client Mods easier. These "systems" are, in majority, all independent of each other, and, although the template comes with all of them by default, you can remove any that you are not using (aside from the core systems that the template depends on).

Installation/Usage Guide

To start, you will want to download the latest release (NOT the source code as zip! Duck Game requires a specific folder structure, which you need to get from the Releases page!), and unzip the entire folder into Documents/Duck Game/Mods. You should then be able to open the .sln (Solution) file in your IDE of choice (I use Jetbrains Rider, but Visual Studio or Visual Studio Code should also work), and immediately get started coding. (You CANNOT use a simple text editor, as Duck Game cannot compile this mod for you, and you must compile it yourself inside an IDE)

To change the name of your mod, you should exit your IDE, rename both the folder and .sln files to the new name you want, then re-open your IDE, and rename the project itself there. All names need to match correctly otherwise Duck Game won't be able to load the mod. (In Rider, you right click on the project in the Explorer tab, and go to Edit -> Rename. In Visual Studio, right click on the project in the Solution Explorer tab, and go to Rename). In order to make sure the new info shows up correctly in-game as well, you should go to the AssemblyInfo class (in src/Properties), and change the Title, Company, and Description there.

All systems in src/MClient/Core are required for the template to function, however, you can freely delete the other systems from src/MClient without causing any errors or issues, if you do not need them. Note that some systems are dependent on each other - for a full list of currently included systems and their dependencies, see the Systems Overview page.

Full documentation for using the systems is included in src/MTemplate. It's recommended that you look through all of it, but the core one you need to understand to get started writing code is the Event System. (src/MTemplate/EventSystemDemo/MEventSystemDemo)

Clone this wiki locally