Digital Physics in On-Chain Games

David Amor
4 min readFeb 24, 2023

--

One of the most popular ideas in on-chain game development is digital physics, thanks to some very interesting ideas. But I’ll be honest, as a game developer, when I first heard of the idea of digital physics, I assumed it was something like the PhysX or Havok engines that recreate realistic movements and collisions. That’s… not what we’re talking about here.

It’s the immutable rules that dictate how the game works.

We have physics in our human world; gravity, thermodynamics, quantum mechanics. The immutable building blocks of our universe. The set of rules that can’t be altered.

When you’re creating an on-chain game world you want a set of digital physics that allows maximum versatility for players to build items and create experiences, but also doesn’t allow them to do things that would break the game.

Our terminology might evolve over time but for now we talk about the Base Layer and the Builder Layer. In the Base Layer are the digital physics that live forever and can never change. In the Builder Layer is the game functionality that evolves over time, built by us and the community. In the Builder Layer there’s no hierarchical difference between what we, as developers, create and what the community creates.

For now, let’s call the constituent parts of this Base Layer ‘atoms’.

Atoms are found in the resources of the world such as diamond, wood and stone.

If the wood I’ve sourced in the game has atoms of 100 DEFENCE then it will probably make a good shield. Turning wood into a shield is the job of a smart contract, which can be attached to a building on the map, thereby creating buildings that serve as factories for turning wood into shields.

It’s a pretty simple smart contract: wood in, shield out. We provide smart contracts to do this but builders are free to modify them, perhaps by choosing to name the resulting shield as a Shield of Solomon. Now some players have Shields of Solomon having visited the factory on the map.

The smart contracts aren’t limited to crafting items. As a player in the game I could create a building that serves as a wall, using materials that contain a lot of BULK atoms ensuring it can’t be easily destroyed. Perhaps I attach a smart contract to the wall that only lets past players who are carrying a shield called Shield of Solomon. Now the Shield of Solomon has utility beyond being useful in a fight.

So items crafted in the game inherit attributes according to the resources they’re made from, and then those items can be named in a way such that other parts of the game can respond to them. Additionally, those items themselves can be used to craft new items, so that 10 Shields of Solomon and a Dragon Tooth can be used to make a Ring of the Elders, giving holders access to a road network on the map with inherited SPEED atoms. The contract is written in a way such that the road network is only available to players with Ring of the Elders equipped.

Now factories that create the Ring of the Elders serve an important function in the game and become a target for attackers. Perhaps a good strategy would be to build that factory using the most ATTACK and DEFENCE atoms available.

These are just a few examples of how we create a system that allows builders to facilitate emergent gameplay. In the examples above I’ve focussed on crafting, but the buildings can run any smart contract, allowing AMM trading posts, casinos, dungeons or gateways to whole new adventures. Or it could just contain memes.

It’s an extendable idea. The forest that you harvest to obtain wood? As far as the game’s concerned it’s just an object with some LIFE atoms that doesn’t fight back. That dragon? It’s another object that has a formidable amount of ATTACK atoms, which will require a lot of players with ATTACK and DEFEND atoms to beat it.

We’re currently putting these digital physics into our on-chain game, DawnSeekers. It’s as close as we’ve ever got to playing God. Like most Gods, we’ll likely make a misstep or two along the way, but our goal is to create sustainable digital physics in a world that can live forever.

--

--

David Amor

Thirty two years of game production. Scars to prove it. CEO of Playmint — making blockchain games.