跳到主要内容

OblivionMP SDK 0.2.0 released

· 阅读需 4 分钟
ReadyM 团队
WukongMP 和 OblivionMP 的开发者

We shipped 2 major things in 0.2.0: the mod syncs a lot more of the game (see below) than it did in 0.1.0, and the server-side API is now a true API.

OblivionMP and WukongMP share the relay server and the core SDK, so everything that shipped in WukongMP 0.4.0 ships here too, against Oblivion's own components.

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

What syncs now

0.1.0 synced where players were and what they looked like: position, appearance, vitals, equipment, skills, time and weather. That is enough to see each other. 0.2.0 adds the parts that make Cyrodiil actually shared:

  • Quests. Initial support for a replicated quest journal: quest entries with their stage and text, whether each is active, completed or failed, and the compass targets that go with them. Progress can be scoped to one player or to everyone.
  • Dialogue. Experimental support for custom dialogue. The topics and responses a player is offered, and which topics they have already exhausted with a given speaker. The server decides what an NPC can say.
  • World flags. Named values on the world entity, which is where quest and world progression that is true for everybody belongs.
  • Difficulty. The server sets the tier every client runs at, separately for damage dealt and damage taken.
  • Furniture. Beds, chairs and alchemy tables are a synced entity now, identified by reference id.

The full component list per entity is in Archetypes and components.

Server API

0.1.0 server mods could register components, tick systems and answer RPC. 0.2.0 fills in the rest:

  • Server events. Players connecting and disconnecting, areas and cells being created and destroyed, players entering and leaving both.
  • Entity creation. EcsApi creates and owns entities in any scope, from global down to cell and server-only, rather than only reading the ones the server made.
  • Players. Kick a player, or look up the ReadyM account behind a session so you can key persistent data on something that survives a reconnect.
  • Registration in one call. RegisterArchetypes replaces the registration class you used to write on both sides.
  • Config files. A mod can ship JSON config and read it into your own class with one call. Server-side config never leaves the server.
  • RPC on the game thread, so handlers and systems no longer touch the entity store at the same time.

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

Client API

Three new additions here, all local to the client that calls them: SDK.Chat writes to the in-game chat log, SDK.GameMessage drives the game's own on-screen widgets, and SDK.Markers puts floating labels over other players for nameplates and callouts. See Messages and markers.

Packaging

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

ExampleMod/
manifest.json
client/
server/

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

That also fixes the load-order problem from 0.1.0. The server resolves dependencies and works out the order, so no more renaming assemblies to get them to load first.

The mod template is updated to produce this layout. See Mod management for how the server reads it.

Upgrading

  • Repackage your mod into the layout above, with a manifest.json. The loose server_mods/ directory is no longer read.
  • Archetype registration changed. IArchetypeRegistration is internal; call RegisterArchetypes from your mod instead, on either side.
  • UpdateTick members are PascalCase. tick.deltaTime is now tick.DeltaTime.
  • EntityBuilderBase is removed.
  • Server RPC handlers run on the game thread. If you were marshalling out of a handler by hand, you can stop.

Still missing

We said in 0.1.0 that we would be upfront about what is not built, so:

  • Save file API. Sync works under the hood, still no public API.
  • Dropped item positions do not replicate, and level items are not synced at all.

The rest is in Known issues.

The 0.1.1 documentation stays available in the version dropdown. If you find something breaking, come find us on the OblivionMP Discord.