Skip to main content

WukongMP SDK 0.4.0 released

· 4 min read
ReadyM Team
Creators of WukongMP and OblivionMP

Most of the work in this release went into the server-side API. Server-side mods can create entities in any scope, subscribe to server events, kick players, and read their own config files. We used all of it to rewrite PvP.

Mod packages have a new layout too. The co-op fixes clear the three 0.3.1 known issues and the bugs people hit most.

Mod authors: this release has real breaking changes. Read Upgrading before you rebuild.

Packaging

A mod is now one folder with both halves in it:

WukongMp.Coop/
manifest.json
client/
server/

The server serves client/ to players and loads server/ itself, so a server-side mod is a normal mod now instead of a loose DLL in server_mods/. Anything you would not hand a player belongs in server/.

The mod template is updated to produce this layout, and its build script is the easiest way to get it right. See Mod management for how the server reads it.

Mods can also ship one or more JSON config files and map them to config classes. Server-only config files stay on the server.

Server API

Server-side mods arrived in 0.3.0 able to register components, tick systems and answer RPC. 0.4.0 fills in most of what was missing:

  • Server events. Covering players, areas, and world-scoped components over the session's lifetime.
  • Entity creation. EcsApi creates and owns entities in any scope, global through to server-only, rather than only reading the ones the server made. Entities can be parented as well.
  • Players. Kick a player, or look up the ReadyM account behind a session.
  • Registration in one call. The RegisterArchetypes method replaces the registration class you used to write on both sides.
  • Server RPC on the game thread, so systems and RPC handlers do not access memory concurrently.

Server-side mods in the docs covers all of it, and the API reference has the full surface.

Co-op fixes

All three 0.3.1 known issues are fixed, along with the things people reported most:

  • Bosses died instantly before the fight started.
  • Enemies were invisible until you got close, then popped in.
  • Enemy movement stuttered constantly. Monsters interpolate properly now.
  • HP scaling could appear to heal a boss, and broke on reconnect and on repeated fights, like with the Yin Tiger.
  • Enemies died after rebirth, and died for everyone else when the owning player left the area.
  • Monsters that drifted out of sync now get corrected, and ownership follows the nearest player.
  • Reconnecting no longer makes hidden plant enemies fight in their plant form.

PvP rewrite

PvP was mostly client logic with the server relaying. Whoever joined the arena first ran all matchmaking logic.

It is a server-side mod now. Round flow, spawns, and team assignment run on the server and clients render the result, which fixed a long list of round and lobby bugs along the way. The temporary IWukongPvpApi and IWukongCheatsApi from 0.2.0 are gone, as promised in 0.3.0.

Known issues

Yin Tiger can soft-lock. If one player dies and the other finishes the boss, the fight can end up in a cutscene softlock. Several other Yin Tiger problems are fixed in this release; this one we'll tackle later.

Upgrading

  • Bump the SDK packages to 0.4.0. Still on DLL references from an old template? Move to the packages first, as described in the open source announcement.
  • Repackage your mod into the layout above. The loose server_mods/ directory is no longer read.
  • Archetype registration changed. IArchetypeRegistration is internal; call RegisterArchetypes from your mod's Initialize instead.
  • WukongArchetypes is static. Reference the members directly rather than resolving it from DI.
  • The PvP and Cheats APIs are gone. The PvP mod is the worked example of doing the same thing server-side.
  • EntityBuilderBase is removed.
  • UpdateTick members are PascalCase. tick.deltaTime is now tick.DeltaTime.
  • Chat is off by default and can be enabled on your server by editing the client-side SDK config file.

Coming from 0.2.4 or 0.3.0? Work through the 0.3.0 migration guide and the 0.3.1 note on NativeString256 first.