How is mod support handled
From release alpha 1.0, a breaking change is introduced into the library in order to enable fast updates, mod support and more security benefits, we have decided to separate all modules into distinct groups. Here is a showcase:
As you can see in the image, we use a mediator library to combine multiple mods together in a single package. This library is supposed to be compiled by the user with linking to all the needed mods. There are 4 main motivations behind this approach
- Enabling C++ mods and plugins(and all related benefits of them over a scripting language system)
- The ability to use mods even in a secure multiplayer game(mentioned below)
- Any clashes or event timing problems can be resolved within the mediator library
- The shell executable provides new security features
Enabling mod support
Mods are enabled by default. 3 binaries will be compiled, your engine and game's code will be compiled into the
UntitledVulkanGameEngine library, then 2 executables will be produced. One will be called by the name specified in the
uvproj.yaml file, while the other will be the same but with
Modded appended to the end of the filename.
This is needed because when packaging your game, there needs to be more work done to add the mod functionality. For security reasons, we have decided to implement a system where one executable is compiled with linking to the mediator and one isn't. This is because some games, might have multiplayer connectivity and having a modding system like this can enable hackers to more easily inject cheats. By doing it this way we have a safe game, that doesn't load mods and a modded version that does.
And because our shell executable can also be modified, we have enabled a macro called
UVK_COMPILING_WITH_MODS, and when checking up with the state of the macro you can disable or enable specific features. For example, you can force the unmodded client to connect to the game's servers and fetch a public key to validate the engine libraries, enable/disable anticheat, make it so that the matchmaking finds only servers without anticheat and much more.
Using the mediator library
The mediator library defines the 3 basic events(begin, end, tick), once linked with the shell executable, they will be added into a list of generic events, then called on their specific points in the code execution.
A point about cross-platform mod support
Because we have this mediator library, we don't recommend that any modder distribute binaries. This can make certain mods unplayable on some configurations and operating systems. Instead, you should notify your community to distribute source code versions of the mods that users can compile themselves and discourage users from blindly downloading binaries, as this is also a security hazard!
If you want to read up on the new scripting and library layout, and implement the features mentioned here, you can navigate to this entry in the docs
- Beginner concepts
- Advanced concepts
- Engine developer and contributor resources