DEV Community

Arefin
Arefin

Posted on

Blockchain Native-Game Engines

Traditional game engines are amazing tools which are used by game developers, artists, designers, storytellers and programmers to create beautiful, fun interactive worlds where you can spend hours entertaining yourselves. Most of us have spent so much of our childhood immersed into this worlds and created memories and experiences which will last for a lifetime. But things are about to change. As with everything else that crypto touches, it's going to revolutionize the way we build and play games and completely disrupt this industry. Let me show you how.
In the early days of video game development, games were created by programming the hardware. We had arcade machines which were constructed to run one and only one game at a time. Then personal computing and general computing hardware seperated software and hardware. Many softwares can now run on same hardware. Game studios started building softwares games that would run on specific hardwares. Then as game studios started being commercially successful and had plans to make a lot of games, it became obvious that building a game engine was a necessity. Game engine allows for developers to quickly prototype and collaborate with artists and designers to create levels and worlds which can be easily modified before deploying a final build for anyone to play. Many game studios eventually created really sophisticated game engines, which gave their games a distinct look and feel. Fans also anticipated games from a particular game engine, because they knew what will be coming out of this engines will be nothing short of extraordinary. So this game engines made this studios lots of money, gave them a moat over competitors which incentivized them to be closed-sourced. After that it was pretty much given, that if you are building your own gaming studio, you must first build the game engine. Studios would put millions and years building out this game engines, before they even started working on any game. Soon after, this companies started licensing out their built-out game engines to other smaller gaming studios, so they don't have to worry about building it out themselves, and just focus on building games.
Then in 2005, Unity was launched. Unity was released as an open-source game engine meant to democratize access and disrupt the license raj of previous incumbents. It was also the first game engine I used to learn making video games along with so many others like me. This new indie and student developer focussed engines, made game development much much easier for better or worse. It also made indie game development a pathway for many aspiring game developers who wanted to pave their own way instead of just joining another AAA game studio. For the past decade, there are so many game engines, graphics creation tools, animation tools, marketplaces of game assets, etc. All of this umbrella of options for game developers has made the gaming industry the biggest industry out there in entertainment.
So now we had closed-sourced game engines, to open/licensed game engines to open source game engines. But now we have a unique opportunity to create the 4th paradigm in the gaming industry. A crypto-native game engine.
What will be different about a crypto-native game engine?
Crypto-native game engines are the critical infrastructure that will build different metaverses. Every major tech company and gaming studio like Facebook, Epic, Microsoft have announced they are venturing into metaverse. A metaverse is a difficult term to define, but eventually it will encompass everything, from play to work to leisure to travel. And every aspect of it will be hand-built by builders from all over the world. But ofcourse you cannot expect the traditional companies venturing into this space to get or build what the cypherpunks have been dreaming of. It's a gold rush and everyone wants a piece of the metaverse, but if we want to build this correctly it has to be built from the ground up. This is where game engines which abide by and facilitate the tenets of crypto will win over everything else. And it is inevitable that crypto-native game engines will win, because they are just superior for every rational actor getting into this space. It's not a zero-sum game. That is why DeFi (Decentralized Finance) is winning over traditional finance, Bitcoin is winning over nation states. It'e because this game engines will be open-source, they will be owned by game developers across the world, forked and expanded upon by them. This game engines will have the crypto economic layer as their base, and builders across different domains will collaborate and pay each other using this base layer, which will be Ethereum or some other blockchain. It will allow for interoperability amongst different fields and domains, tools for efficient collaboration and coordination, permissionless, ownership-first mentality, persistence using a decentralized ledger with very strong sybil resistance built-in and the most critical feature about them will be modular composability. Due to all of this features, even big players in the space have to follow this principles, otherwise it's hard for them to participate in the crypto market and make any profits. Anyone trying to create walled gardens will lose out. This is not to say that walled gardens won't have any place in the metaverse, there will be lots of them, but they will be community first with an easy exit option to anyone playing in this gardens, which is really difficult thing to do in today's tech and gaming ecosystem.
There are 3 important entities in this blockchain-based system that makes the system whole: Builder, Player and Speculator. Builders are programmers, designers and artists who will build game worlds and components, Players will play the games built by them and Speculators are the investors and gamblers who will stake their wealth on builders based on players who are the ultimate judge/signals of which builders are successful and good. In the old way, the builders worked for investors/speculators, building them worlds which were designed in a way to exploit players out of their dollars. In the new way, the role of speculators although important will be to just observe and not try to control the narrative to gain advantage.
Here's a tiny example of a game that explains the stark differences between the old and new system clearly. I am a game developer who wants to build a game where a knight fights a dragon with a sword. There are 3 main components in this scene, the knight, dragon and sword. The game devs and artist will create the assets, program the behaviour and the designer and author of game will integrate them in the game world and make the game playable and fun. In the old way, I will hire artists to create the assets which will be my game's IP. The code of the game will be closed and for allowing modding for external devs will require additional effort. I will have to follow the rules set by the centralized marketplaces like Steam. I will not be able to use code/assets since there's no standardized way of accessing other assets to make the game development process faster and simpler. So basically creating a game today breaks all the important principles that crypto follows. But if I choose to follow the cyperpunk principles, it will not only make my building process more efficient, it will set my game up for future expansion, give players and artists proper ownership into my IP but also give everyone involved a way to participate in my journey of game development from the beginning if they desire so. But to set all of this up currently would take lots of engineering effort. To make this process easier for every new builder, there's an opportunity and need to create a game engine which facilitates all the process and bakes in the principles in everything we build. This kind of game engine is the new paradigm, the most critical infrastructure for the future of a good metaverse and an important public good which should be made available for all.
Composability - Crypto game engines allow devs to create blockchain-based smart contracts which represent independant parts of a game composed together just like lego pieces. This pieces will be of various forms and will be interoperable to fit with other pieces to form a whole game. Currently the way games are developed, they are siloed worlds that are confined within themselves. Players have to go in the world, play and learn skills, but there isn't a way to transfer the elements/skills inside the game to another game. This gives open world games like GTA strong moats, as gamers need to dedicate their entire time, undivided attention and money inside a single game. There's no doubt the absolutely massive world build by Rockstar is really entertaining. But imagine if this world was built using independant components by different builders all over the world instead of the few hundred that work at the studio. Composable smart contracts allow all of this game components needed in a game to be extracted out and remain an independent entity on the blockchain. This components can then be utilized by a particular game contract.
One important thing to consider when creating this separable, independant components is how interoperable they are with each other. By default I think every component should have some dimensions about it that can communicate with the others because they are on blockchain. But in order for every feature of the component to be operated, they should abide by some standards set by the community so game devs have easier time integrating them and don't confuse the players owning or interacting with this components. In-game components should feel consistent with each other no matter which game they belong to.
In our game example, the "knight" will use the player contract which has a global state owned by the player itself. This means, that the player can use it's global state which is independant of the game and also the game itself will modify the player state. The player can use his personal wallet in which he owns certain components which are useful in the game. In our example, the game accepts swords as weapon to fight the dragon, so the player can either use a sword he already owns (maybe won from another game) or he can use the sword provided by the game itself. What makes this interesting for the builders is that, if the builder wants he can skip the step of building sword assets, and only allow players who already own swords to fight this dragon. This brings so many possibilities for the game, and also makes the process of game development really modular and composable. Another aspect to this is an artist who is really well-known for making amazing sword assets can now make his work available to lots of different game developers and his work could be valued according to how much those assets are in demand in the world. This makes the valuation of in game assets completely detached from the game itself, and the games narrative, character and gameplay only enhance the asset. Actually all the aspects of a game can be detached and modularized in a similar way in theory, but the implementation might make things a little complicated especially when it comes to storytelling, as it is usually very tightly coupled with a game. But it might be possible to fork game play mechanics create by certain devs, and tell different stories in different worlds using those. This opens up a really different way of coordination and collaboration in game development and designers will have to shed their old ways of thinking how to go about designing a game.
Persistence - Blockchain records every transaction made by users of a smart contract. That means that if a player plays a game using a smart contract, all the interactions player does on the chain is recorded and so a player state is maintained for that particular game. This state can then be used by the player and other game developers in really interesting ways. For example, our game contract in the example above mints a loot item, when the player finally defeats the dragon. The author of this particular game contract has made this particular loot item as an NFT, an independant component which the player now owns, and can do what he wants with it. He can keep this treasure as a display in his collections box. He can sell it on the open markets for real money. Or he can just use this NFT in another game contract in the metaverse. The player now goes to a warriors battleground, which is a PVP arena, and he can choose to use the sword he just won defeating the dragon to fight his friends in a battle arena. This is just one scenario of so many things which will be made possible because of the state of the object which has a whole another life outside of it's game level it was generated. This layer of persistence will also be used on the player itself. The skills he learned in this game, can be used by other games, to give him special access to their games. We can create a reputation layer for the player, which can be monetized by the player in various ways. There's even a persistance layer in the gaming world itself, and a talented game developer can use this to make the experience of living in their gaming world a really memorable and unique experience, where players past action affect their community, their own state and also state of NPCs residing in the game. Imagine using AI for NPCs to have dynamically changing reactions to player actions based on how they behave in the game or other games. Or changing a whole city in an open world game based on actions performed and decisions made by a faction of players.
Saving all the previous state on a blockchain also means, a player can come back and replay a particular state of a particular game again and again without ever needing to store it somewhere seperately, or the game server not maintained by the original game company. Anyone can fork this game and run it on their own and carry over all the previous state. They can keep the game exactly the same or make their own modifications either cosmetic or in game. All of this is only possible if there's a single chain storing all the state data.
Permisionless - One of the main tenets of crypto is that it is permissionless. You don't need permission to sell something you build from the central marketplaces and platforms. The same thing will apply to game engine components too. Any smart contract developer can create a new game, by forking the original game contract, transferring over all the capabilities of the original game. Any frontend developer can create new UI and 3d asset to mod the game to their liking, selling this mods to players and other devs. Even the assets used in a game can simply be picked up by game devs from artists who will mint it as NFTs (attaching rules and royalty fee for usage). This makes working on games a really individualistic and asynchronous process if one likes to work that way. But a squad with diverse backgrounds can collaborate to fork a game, and make improvements of their own to it too. In the above example, I as a dev will opensource my design for the dragon fight. Then another dev can extend my work, by adding a different dragon with different capabilities but reusing the players actions that I have already programmed in. An environment artist can create a different level for the game to be played. And a curator can pick and choose between all this different composable components to create a very specific experience. And all of this will be done permisionlessly while all the revenue collected during this process will be distributed by a distribution contract set by the individual component creators. Gone will be the days when Nintendo sues a fan for remaking an old level, or Bethesda only allowing certain mods for their games to be monetizable. This kind of selfish tactics to benefit the parent company will be seen as undesirable and foolish.
Ownership - game developers can create certain assets which the player can own. Some of this assets are something they sell, which maybe vital to what they are building in order to raise funds. Once you own an asset, you can sell it on open markets. Use it in other games made by the same or other developers. The engine allows game contracts to make exclusive contracts with the player owned assets, which means that when the player uses the game assets in a game it will permanently change some aspects of the owned assets. You may even lose the asset you own. Some changes will be permanent, some only when you play the game. Some will be purely cosmetic, others will enhance/deflate the abilities of the asset you own.
Eg. Let's say you win a rare sword in a battle game by defeating another player in combat. Now that sword is permanently yours to own. Now you can go and play a game which allows you to upgrade that sword. It's a fantasy magical game, so your sword now has magical abilities. Then you go and play a game with dragons. But this game has known risk that the sword maybe permanently damaged, losing all the magical abilities you gain playing the other game. Is that risk worth the rewards this game is offering? Game developers will be making all sorts of risk/rewards balance for different assets, in order to attract players, and the game engine will be there all along to make this process easier.
Tokenomics - crypto allows for a open and transparent financial system which acts as the base layer of the metaverse. Tokenomics or token economics lets you create a playground for experimenting with your own economics which can still interoperate with the global economic marketplace. A thriving metaverse needs well compensated builders who are paid fairly for the value they bring to the ecosystem. As we saw above in a composable system, every individual can build permisionless and plug in to the verse. Everyone is the owner in this economy and there are minimum rent seekers. A trustless base economic layer with a smart contract game engine where every artist and builder can assign royalty fees for the assets they build, used by game devs and compensated by players/investors means everyone can build without worrying about business. Builders can seperate art from business and just build. Players can participate to make sure the right builders are compensated fairly by signalling their happiness and also earn from this. Players can themselves earn from playing the game in certain play2earn game models. While the speculators and investors can stake their tokens to keep the ecosystem growing and healthy. The artist who is good at developing swords in the above example can be commissioned by a game dev for his particular game or he can make his asset available for anyone to use, which are then bought by either a player or a game world, because they think the utility or signalling of owning this sword is beneficial for them for particular games or in general in the external world. I have seen certain critics say that if you insert money making in a game, it removes enjoyment from actually playing the game and it becomes a grind. People don't play game to earn, but just to relax and have fun. I get this criticism, but I think there will always be games built where you can just use your NFTs to play fun games without worrying about the earning potential or grinding to earn more money. But the critics are failing to understand that this system is giving economic freedom to the builders themselves, allowing players to own and earn from the games they enjoy playing and providing some real benefits in exchange for their time and experience. This may not be for everyone, but I predict that most artists and game devs will eventually find that this model works much better for them than what they have been doing in the old way, and so the best games will be built in this new system. This is the way.
Basic Game Engine in Development
We have started work on a game engine that will be build with all the features I talked above in mind. This will be a bottoms-up approach, with the game engine being built specifically for a game we are developing called Spaceborn. Spaceborn is a Loot Project inspired game, where players get to own unique and randomly-generated sci-fi gears NFT by defeating Aliens in combat. Players can only earn this NFTs by playing the game. The players can equip some of the gears which they have won previously or bought from the secondary market in order to get better odds in battle. The twist is that if you loose in combat, the player may lose the equipped NFTs. The plan is to open source all the contracts created for this game so that other game developers can fork them, use the sci-fi gears won by players in this game in their own games and also let the games use the player and it's global state in other games.
Every important component of the game which might benefit from having crypto-native features described above will be a ERC-721 NFT component type and the Game Manager will be the central contract that interacts with all the components registered with it. Every component has it's own attributes, which can be either global (changed by the owner) or game-specific, changes when owner of the component interacts with the game.
Following are the important components for the first game:
Player Contract: Player has a configurable global state. A player accepts to attach itself to a game contract, and agrees to getting the global state modified as it interacts with the game. Currently the only global state a game can change is the experience points. This experience points will give the player reputation in the metaverse. A player can also modify certain global attributes which are then made use by the game. One attribute is attaching a NFT PFP the player owns as it's profile picture. Now based on which NFT the player attaches, the game can give special boost to them inside the game.
Game Contract: Game contract is the main game manager that maintains state for the game world and all the players interacting with the game. This game manager has several mappings which are upgradable by both players playing the game and the game owners (game masters). In the Spaceborn game, this game contract accepts players gated by specific PFP NFTs they own.
Gears NFT: Gears NFT are minted by the game contract and are transferred to the wallet of the player upon completion of some objective in the game (Defeating alien enemy). This NFT are dropped by the alien contract upon defeat. This NFTs can also be equipped by the player during combat, which reduces the probability of alien winning in the battle, depending on the attributes of the gear and the attributes of aliens. The attributes and the calculation is also something that can be upgraded by the game contract owner once it's deployed.
Alien Contract: Aliens are enemies generated by the game contract which have a base probability of winning in a battle. This probability is increased or decreased depending on the player it's facing and the gears the player has equipped.
The contracts and web3 framework uses scaffold-eth which is a great tool for quick prototyping web3 concepts. The future roadmap for the game engine is as follows:
Create a UI for anyone to generate game contracts or fork someone else's deployed game.
Easy deployment of games to different L2 networks or sidechains like Arbitrum and Matic.
Create a standard for in game items so that interoperability between different games is like a breeze.
Create a token which will compensate builders, incentivize game developers to allow the players to play their games.
Create a DAO for making this game engine a public good and properly decentralized.
Create a 2D combat game which will reuse the NFTs already minted from the text-based version.
Integration with existing game engines such as unity and unreal.
Library for artists and developers to publish their assets, different ways for them to get compensated for the work and a marketplace for players and games.

There's a lot more that will be needed, but this are what I think the core features for an alpha game engine. If any of this interests you please do get in touch with us on telegram. We are a group of devs from Moonshot Collective (GitcoinDAO) and OPGames. All of us are really excited for the future of crypto & web 3 and passionate about video games. What lies ahead of us is monumental and mind-blowing and we want to be at the cutting edge of it and leading the way. So be there with us as we go all in on this new adventure together.
Here's the Spaceborn website: spaceborn.gg
Join this telegram group for updates and connecting with us:

Discussion (0)