Changing the plugin and dedicated servers
Most of a MOBA built on the framework is content: champions, abilities, items, waves, camps and maps are Data Assets and levels, and none of them needs the plugin's code to change. This page is for the two cases that do touch the code: changing the framework itself, and packaging a dedicated server.
Change the framework's code
The plugin Fab installs into the engine is built for the editor and is shared by every project of that engine. To change its C++ code, give your project its own copy:
- Make your project a C++ project. A Blueprint project becomes one when you add a C++ class: Tools > New C++ Class, any parent. You need Visual Studio with the C++ game development workload, as Epic's documentation for Unreal Engine 5.8 lists.
- Copy the plugin into the project. Close the editor. In the engine's
Engine/Plugins/Marketplacefolder, find the plugin's folder, the one that holdsPioneerMOBA.uplugin, and copy it into your project'sPluginsfolder (make the folder if there is none), so that you have<YourProject>/Plugins/PioneerMOBA/PioneerMOBA.uplugin. - Delete the copy's
BinariesandIntermediatefolders, so it is built for your project. - Build. Right-click your
.uprojectand choose Generate Visual Studio project files, open the solution, and build the Development Editor configuration. Then open the project.
A plugin in the project takes the place of the engine's plugin of the same name, so the project now runs your copy. Fab's updates still install into the engine and do not touch your copy: to take an update, compare the new version with your copy and carry your changes over.
Change the plugin's config
The plugin's Config/Engine.ini, Game.ini and Input.ini are applied after your project's config, so the engine
settings they make win over your project's DefaultEngine.ini, DefaultGame.ini and DefaultInput.ini, and their
lists only add to yours (see
What the plugin's config always sets). To change one of
those settings, such as a World Settings class or a game viewport client of your own (derived from MobaWorldSettings
or CommonGameViewportClient), or to stop cooking the sample's folders, edit the files in your copy's Config folder.
Each line there says what it is for. Keep FilterPlugin.ini, which lists the config files a package of the plugin
includes.
How the code is laid out
The plugin has ten modules. Each depends only on the layers below it, lowest first: Core; Abilities and Net; Lanes, Jungle, Economy and Vision; Bots; UI; Editor.
| Module | What it holds |
|---|---|
PioneerMobaCore | Game mode and state, player state, champions, attributes, match rules, orders, input, camera, unit animation |
PioneerMobaAbilities | Ability Definitions, the cast type classes, effects, damage, Gameplay Cues |
PioneerMobaNet | Iris filters, hidden stats, Find match and the matchmaking providers |
PioneerMobaLanes | Lanes, waves, minions, towers, inhibitors and the core, aggro |
PioneerMobaJungle | Camps, buffs, epic objectives, Jungle Strike |
PioneerMobaEconomy | Gold, bounties, items, recipes, the inventory, the fountain and recall |
PioneerMobaVision | Server-side vision, brush, wards, the fog texture |
PioneerMobaBots | The bots' brain, difficulties, bot fill, the StateTree nodes |
PioneerMobaUI | Every screen in CommonUI: the front end, the HUD, the shop, the theme |
PioneerMobaEditor | Data validation and editor helpers. Editor only |
The runtime modules build for Windows and Linux; the editor module for Windows.
Extend without changing the plugin
Much can be changed from your own module without touching the plugin's code, by subclassing and naming your class in Project Settings:
- the targeting priorities of minions and towers (
UMobaTargetingPolicy, Lanes settings); - kill bounties (
UMobaBountyPolicy, Economy settings); - the matchmaking service (
UMobaMatchmakingProvider, Matchmaking settings); - the HUD (
UMobaHUDScreen, UI settings) and each front-end screen (Front End settings); - the bots' brain (Bot Controller Class in the Match settings, or your own StateTree in the Bots settings);
- a new kind of ability (
UMobaGameplayAbility), in C++ or Blueprint.
Dedicated servers
A dedicated server runs the match without a player of its own: it simulates, decides and replicates, and draws nothing. Online matches need one, hosted by you. The framework runs the same rules on a dedicated server as on a listen server, and Play In Editor already starts one for testing.
Why packaging one needs a source-built engine
The Epic Games Launcher's Unreal Engine cannot build Server targets, so packaging a dedicated server needs Unreal
Engine 5.8 built from source. The plugin, the sample, Play In Editor and listen servers all work in the launcher build.
To try a dedicated server on the launcher build, run the editor binary with -server; see
As separate processes.
Package a server
- Build Unreal Engine 5.8 from source, as Epic's documentation describes: link your GitHub account to your Epic
account, clone the 5.8 release, run
Setup.batandGenerateProjectFiles.bat, and build the engine. - Give the project the plugin. A source-built engine does not have the plugins Fab installed into your launcher
engine, so copy the plugin into your project's
Pluginsfolder as in Change the framework's code. - Add a server target. Next to your project's
<YourProject>.Target.csinSource, add<YourProject>Server.Target.cswithType = TargetType.Server, then switch the project to the source-built engine (right-click the.uproject> Switch Unreal Engine version) and generate the project files again. - Package. In the editor of the source-built engine, choose Platforms > Windows (or Linux), pick the server target under Build Target, and Package Project. A Linux server built on Windows needs the Linux cross compile toolchain for 5.8 that Epic's documentation names.
Start a server
Give the server the map to open on its command line:
<YourProject>Server.exe /PioneerMOBA/Maps/L_Lobby?MobaKind=Quick -log -port=7777
L_Lobbywith?MobaKind=Quickmakes the server a Find match host: it advertises a quick match lobby, and advertises again each time it opens the lobby after a match.?MobaKind=Customhosts a custom lobby instead. See Match flow and front end.- A match map, such as
/PioneerMOBA/Sample/Riftwood/L_Riftwood, starts a match at once. Players join it by address (open 203.0.113.7:7777in the console, or Custom game > Join with the address), and bots fill the empty seats a second after the first player arrives.
The server ticks 30 times a second, the engine's default, and the framework is built and tested at that rate. To change
it, set NetServerMaxTickRate under [/Script/OnlineSubsystemUtils.IpNetDriver] in your project's
DefaultEngine.ini.