Skip to main content

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:

  1. 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.
  2. Copy the plugin into the project. Close the editor. In the engine's Engine/Plugins/Marketplace folder, find the plugin's folder, the one that holds PioneerMOBA.uplugin, and copy it into your project's Plugins folder (make the folder if there is none), so that you have <YourProject>/Plugins/PioneerMOBA/PioneerMOBA.uplugin.
  3. Delete the copy's Binaries and Intermediate folders, so it is built for your project.
  4. Build. Right-click your .uproject and 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.

ModuleWhat it holds
PioneerMobaCoreGame mode and state, player state, champions, attributes, match rules, orders, input, camera, unit animation
PioneerMobaAbilitiesAbility Definitions, the cast type classes, effects, damage, Gameplay Cues
PioneerMobaNetIris filters, hidden stats, Find match and the matchmaking providers
PioneerMobaLanesLanes, waves, minions, towers, inhibitors and the core, aggro
PioneerMobaJungleCamps, buffs, epic objectives, Jungle Strike
PioneerMobaEconomyGold, bounties, items, recipes, the inventory, the fountain and recall
PioneerMobaVisionServer-side vision, brush, wards, the fog texture
PioneerMobaBotsThe bots' brain, difficulties, bot fill, the StateTree nodes
PioneerMobaUIEvery screen in CommonUI: the front end, the HUD, the shop, the theme
PioneerMobaEditorData 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​

  1. 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.bat and GenerateProjectFiles.bat, and build the engine.
  2. 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 Plugins folder as in Change the framework's code.
  3. Add a server target. Next to your project's <YourProject>.Target.cs in Source, add <YourProject>Server.Target.cs with Type = 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.
  4. 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_Lobby with ?MobaKind=Quick makes 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=Custom hosts 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:7777 in 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.