January was a strong start to the year. We’ve worked for 20+ weeks on getting to our first milestone for the Emergence SDK on Unity and Unreal.
Internal Release
Since our internal release back on December 10th 2021, we’ve reached out to our network of AAA game companies and web3-native gamespaces being built so they can test this initial version of Emergence - still very much an MVP but the process so far has been a lot of fun thinking out loud with some brilliant people. Might make this a podcast.
This first version is packaged as an Unreal engine plugin, which enables game developers to easily integrate Emergence with their Unreal game environment.
Gamers will subsequently be able to pause the game, pull up the Emergence overlay, and log in with their wallet of choice. The feature set currently includes:
Open / close overlay
Login with walletconnect
View wallet account balance and network
Create and manage Personas
This represents a solid base to work from. The next release will include:
Hardening of the current code base
A new front end
A new set of Emergence features to allow gamers to find and connect with each other
Video Demo
Unity POC
Proof of concept
Our first task was to develop a Proof-of-Concept version of the Emergence SDK for the Unity game engine, creating a flow to and from the local EVM server.
The idea was to make a rough version to demonstrate feasibility, but it became clear that it would be easier to build it out properly with cleaner architecture. Code readability matters, no matter the task.
One internal goal was to simplify the amount of prep work required by our SDK users. To reduce the effort required to integrate with their game, Emergence provides a single template scene object, which can be inserted to the first scene of any game, and a single scene to add to the game's build list. We thought of automating this for builds, but we couldn’t get it to work for testing in the editor, so we left it as a manual process.
After setting a couple of parameters, the SDK code loads the rest of the assets, meaning the developer doesn’t have to do anything else.
Another goal we had was to support Unity 2019+ so we could reach the broadest possible audience.
We didn’t have any major issues while creating the SDK code, although we did replace the JSON library (JsonUtility) with NewtonSoft JSON.
On the UI side, we replicated the look and feel of the Unreal version as closely as possible. The only exception to this was the scroll areas, where we used Unity's own UI control.
The Demo
Once we got the basic SDK package working, the next task was to integrate a more aesthetically pleasing demo than the three rotating cubes in the background. To do this, we wanted to put the SDK into a “.unitypackage” file. This made sense as it has always been the standard, and everybody is more or less familiar with them.
We found Unity's own demos needed a newer version than 2019, so we picked version 2021.
Once we had imported the demo and got it running, we started to encounter a few user issues.
We were using the older Input System, which is present in all versions of Unity, but the demo used the newer one and disabled the other. That meant we had to manually choose to use both at the same time.
NewtonSoft JSON is included as a package by default, so having it would cause a conflict while importing (duplicated dll), while not having it would create compilation errors in the console. This is something we need to look at in the future, principally to decide which option is the lesser of the two evils.
Having a unitypackage file doesn’t allow us to include the local EVM server .exe file. This is something that we will have to solve, most likely by integrating its code directly into unity (it is also made in .NET).
Having an animated, controllable character made us realize that we weren't providing any events for when the SDK overlay UI opened and closed. The main reason to do this is so devs can choose to pause their game (or not) using their own way. One thing we don’t want to do is force any specific methods, like changing the time rate to 0.
Adding a smart contract meant we could get NFTs, then show them in the scene.
All in all, the development was relatively smooth and the end result was far less rudimentary than we had originally intended. We can certainly use what we created as a basis for adding future features, rather than as a one-off toy.
Test World
Since the internal release, we have been experimenting with our own showcase of the features of Emergence, in an interactive experience called “The Lab.” Initially, we built The Lab with Unreal Engine 4 as a place for us to experiment and showcase how Emergence can be used by game developers.
But we also wanted a learning experience building with our own platform. This gave us another avenue to figure out what features are important to game developers while getting feedback from our closed alpha testing partners.
One example of a way that The Lab will show off Emergence smart contract features is the “Read, Write, Own” exhibit which takes players from Web1 (read), Web2 (write), and Web3 (own). This means you can read, then write to, then mint and own the Open Meta Manifesto in the form of an NFT via Emergence.
We have big plans for The Lab going forward, but for the time being, it will be another place for us to hang out and share. We’ve added text and voice chat to help with interaction, so we will begin to do some of our testing there and grow this into more of an open world as time goes on.
Hardening
Multi-Environments
In order to improve our CI/CD process, we’ve been working on building new environments like Staging and Production. Now, our developers can test their code in the Development environment and once we have a stable version, we can push it to Staging for testing, or to Production. Thanks to these changes, we can code, test, and deploy features faster and more securely.
API Documentation (Swagger)
We implemented the popular API documentation tool, Swagger, to make our documentation more reader-friendly. We’ve set it up so the documentation is automatically updated in every new version of the code that we release. So, to everyone who needs to consume our off-chain APIs: you’re welcome!
Developer environment improvements
After identifying some possible improvements we could make to our development environment, we implemented fixes that meant we could do our daily work more quickly.
First off, we removed the need to rebuild our code every time we needed to test a change in our local environment. Also, we added some new scripts so we could run our code locally on Windows machines.
Now, we can run our service on both MacOS and Windows.
Best Practices
Another efficiency we achieved was by implementing some linters to help identify and report coding patterns. This automatically helps us code consistently and with the same conventions, resulting in cleaner code.
We also wanted to improve our code’s quality, so we configured unit tests that will validate our business rules every time we want to add code to our repositories. This means for future features, we'll know if any code breaks before we deploy it to one of our environments.
Smart Contract Integration
Smart contract integration is front and center of our development right now, especially since safe EVM smart contract interaction has arrived for Unreal Engine 4. We have made a few advances here:
Emergence SDK now supports reading and writing from and into any EVM compatible network.
NFTs and on-chain data can serve as an authentication layer for games and we are providing examples that show how to mint an NFT and read from NFT smart contracts.
For end users, our WalletConnect solution provides the ability to accept or decline transactions through their preferred wallets. Any game server instances can read or write directly to smart contracts by storing the credentials in a Keystore.
Meanwhile, game developers can load their contract addresses and ABIs, then interact with them.
Game servers are usually an instance of the game itself, and for that reason, we’re also working on examples for the initialization of Web3 instances for Game Servers. This means you can now offer access to your game and its skins, items, avatars, or in-game currencies through on-chain data.
Next month’s episode I’ll have some pretty exciting new things to announce & we will start diving into more of our testing and show who we’re playing in the sandbox with.
Ryan Gill
Founder & CEO
Syntax // Error: Emergence
lots of exciting stuff. looks like the team has made a lot of progress already.