What?
A suite of tools for Unreal Engine 5 creators to build their own Metasites, which were 3D experiences running in the browser, supported by Xsolla Cloud Gaming. It included common game mechanics and additional functionality to seamlessly integrate with 80 Level’s Metabrowser ecosystem.
Breakdown
The suite consisted of:
- A simple template with a character, interactables and camera-switching.
- An advanced template with the above, plus objectives system, power system, health and ammo pickups, projectiles, and boss.
- Plugins for inventory management, cross-Metasite DLCs and frontend communication.
Templates
Since the target audience included creators without programming experience, the templates were built in blueprints, with a focus on ease of use and extensibility. The simple template was designed to be a starting point for creators to build interactive experiences, with a detailed wiki about its features.
The advanced template was built for 80 Level Community Metasites Challenge 2023, where creators had to use this template to build unique and fun experiences. Included were:
- Simple objectives system: Create objectives with different conditions and display them on-screen.
- Power supply system: Create puzzles using power sources, pipes and power consumers. They could use interfaces to implement your own actors. Even daisy-chain power sources for more complex puzzles.
- Pickups system: While the template included health and ammo pickups, they could create their own pickups with different effects by inheriting from a base class. Additionally included was spawn volume actor to randomly spawn pickups inside.
- Simple projectiles: Three types of projectiles that can be used for weapons. In the template, they were used for player’s canon.
- Boss: A simple boss with a health bar, that had its own attacks and could be damaged by player’s projectiles.
Plugins
The Metabrowser initiative consisted of individual Metasites connected together through a common foundation. Features included objectives that could be tracked across unconnected experiences, and items unlocked in one experience could be used in another. To support this, I built three C++ plugins that creators could use to integrate their Metasites with the ecosystem:
- Centrifugo plugin for real-time communication between a Metasites and the browser frontend.
- DLC plugin to inject dynamic content into a Metasite at runtime.
- Inventory plugin to manage player’s inventory.
These plugins were written in C++, but provided blueprint-accessible functions. All three plugins could be used independently of each other, but also could be used together to create rich experiences, which was showcased in a demo template project.
-
A creator could add a hammer item to their Metasite. When the player picks it up, it gets added to their game inventory, and also to the their inventory on the backend via Centrifugo communication.
-
Then, when the player visits another Metasite, Centrifugo tells the DLC plugin to download the hammer and add in their inventory. Now they can use the hammer in the new Metasite, even though it wasn’t originally part of it.
Centrifugo plugin
This plugin provided an interface to communicate with the browser frontend in real-time. It supported sending and receiving messages from the Centrifugo endpoint, which could be used to trigger events in the Metasite or update the frontend UI. This was crucial for features like cross-Metasite inventory and objectives tracking.
DLC plugin
This plugin provided classes and interfaces to create and export DLCs, and load DLCs at runtime. At its core, it relies on Unreal’s PAK filesystem. PAK files are archive files that contain game assets. These files can be mounted (and unmounted) at runtime, allowing for dynamic content injection. The core classes that form the plugin were:
PakManagerSubsystem: A subsystem that provided functions to download (usingPakDownloader), mount and unmount PAK files at runtime.PakData: Each PAK downloaded was managed with this class, containing things like its ID, mount point, content path, and entry class.DLCEntry: Arguably, the most important part of the PAK pipeline, this was an interface that had to be added to the “main” class or blueprint of the DLC; the entry point for the DLC’s functionality.DLCManager: A manager that exists per-DLC.
Creators could make any kind of DLC with this, since the DLC’s functionality was contained entirely inside the DLC’s PAK.
- A cosmetic DLC that adds a fountain.
- A cosmetic DLC that adds new trees to the environment.
- A functionality DLC that adds a lamp that can be turned on and off.
- A functionality DLC that adds a new weapon, with its own projectiles and effects.
- A functionality DLC that updates the floor in the base game to a new texture.
- DLCs that modify the base game content would be helped by some kind of a bridge between the two. This could take the form of actor tags, a collection of common interfaces etc. maintained by the Metabrowser team.
Inventory plugin
This plugin provided a simple inventory system that creators could use to manage player’s in-game inventory. It supported both consumable and non-consumable items.
- Consumable items: These items could be used directly from our inventory, without needing to spawn a physical actor out in the world. Example: Potions, medkits etc.
- Non-consumable items: These items had to be spawned in the world before use. Example: Flashlight, hammer, key etc.
Items were created as data assets, which contained all the relevant information about the item, such as its name, description, icon etc. Furthermore, they also had instance-specific data, like the battery level of a flashlight. Classes, interfaces (and even actor components) were provided to make item creation as extensible as possible, so that creators could make items with unique functionality.