Author: opnpc@Downstream; Compiler: MetaCat
Atomic object system is a design pattern that allows the creation of novel and composable objects while maintaining the overall balance of the world. Each object in the world is composed of a small set of elementary particles, and its properties or statistics are inherited from these constituent atoms. Unlike traditional game worlds where objects are specified by designers, the inhabitants of these worlds can create entirely new objects with new properties.
Motivation
There is usually a set of prescribed items in the game world because designers need to prioritize player fun over player autonomy. Providing players with a reliably fun experience requires balancing various systems to ensure that they can get the right items at the right time. Powerful or valuable items often cost a lot of money to obtain, or are restricted by skill trees and upgrade paths to prevent unbalanced gameplay. Game designers carefully adjust these systems to optimize the player experience and maintain a sense of challenge and reward.
This is especially difficult in multiplayer games. Single-player games can quietly change the rules of the game world based on the individual progress and skills of the players, but multiplayer games can’t easily change one player’s reality without frustrating another. A shared space where players can interact across ability levels requires something closer to a functioning economy, which has historically been difficult to achieve. Giving players the ability to create new items without appropriate restrictions can result in a flood of items that “break” the game experience for other players, or even their own.
Part of the appeal of autonomous worlds is that inhabitants are free to collectively design, build, and engineer entirely new things. To achieve this, we can’t rely on game designers to carefully refine mechanics as new objects are added to the world. Manually balancing systems is costly, and the cost of testing interactions between objects increases exponentially as new objects are added to the world. Instead, autonomous worlds rely on explicit narrative rules or laws of digital physics that constrain what can happen physically in the world and define the conditions under which it can scale. Good laws of digital physics should provide a wide variety of possible objects without requiring game designers to manually balance each one.
The Atomic Object System is a form of digital physics that provides an easy-to-understand and self-balancing composability mechanism. Players are free to invent new objects of any power level they want, but they must first acquire the required atoms by destroying existing objects. By treating basic atoms as building blocks, players can invent objects beyond the limits of hard-coded crafting trees. At the same time, the effort required to acquire these atoms in the game world is kept balanced by imposing a cost proportional to the complexity of the object being created.
Mechanics
We conceived of the Atomic Object System while developing Downstream. The game consists of player-controlled units that live on a hexagonal tiled map, where every state change is an on-chain transaction. Units use buildings to craft items, each of which is composed of a specific set of elementary particles, represented by different colored goo. Players first collect goo, use buildings to craft new items from that goo, and then use those items to strengthen their units, trade with others, and devise new game modes.
The basic crafting process consists of:
Collect goo from extractors.
Use buildings to craft items.
Add items to the player's inventory.
Extractors function like taps for goo. They dispense basic items: droplets composed entirely of pure red, blue, or green goo.
Buildings allow crafting, taking multiple items as input in order to output new items composed of goo. Different types of buildings are associated with different crafting recipes and output items. Some goo is burned during the crafting process as an absorbent.
The most common use of items is to improve a unit's attributes, and the number of goo atoms in the item determines the type and amount of attribute improvement. Red goo increases strength, blue goo increases defense, and green goo increases health. For example, a good weapon will have a lot of red atoms. A good shield needs a lot of blue atoms. A balanced item can have all three attributes, as long as the unit has the required resources.
Players can also use the "Building Maker" to construct new buildings, which in turn produce new items:
Design a buildingKind using a new crafting recipe.
buildingKind is deployed as a smart contract.
buildingKind Builds this instance on the map.
Use their new buildings to craft entirely new items.
Items don't need to have a unique atomic makeup. Maybe your friend already has a building that creates a Thor from 100 units of red goo. There's nothing stopping you from building a new building that outputs a new item, the Holy Sword, also made from 100 units of red goo, and these items function the same way in combat.
Crafting recipes can also take any player-made item as an ingredient. This allows for the development of an extensive tech tree. If you have 10 Thors and 10 Holy Swords, you can create a new one that takes buildingKind as their input and spits out a super-powerful hammer sword.
Contracts
Downstream uses a node graph architecture, representing all entities (players, buildings, etc.) as contracts with their own addresses, and items as ERC-1155s with names and balances that can be assigned to these entity addresses. The basic atomic composition of each object is encoded as metadata, allowing crafting contracts to inspect the required constituent materials.
When a new building buildingKind is created, along with its accompanying crafting recipe and output items, the building manufacturer generates three files:
NewBuilding.yaml: The manifest, containing the parameters for the building and items.
NewBuilding.js: The building UI, called when a building instance is clicked in the game, controls the html and buttons that are displayed.
NewBuilding.sol: On-chain logic, a Solidity contract that implements the BuildingKind interface and can represent building dispatch operations.
Basic Factory and Cocktail Hut are probably the most readable examples in Downstream.
Applications
Currently, the most widespread application of virtual world composability systems is crafting mechanisms in games. Autonomous worlds vary in the degree of gamification, and we can imagine a world without fixed game goals, where residents can still benefit from a system that allows the creation of new types of objects. However, it is worth noting that many games with crafting mechanisms already distinguish between games and living worlds.
Notable examples of game genres that offer similar functionality include:
Survival sandbox games like Minecraft and Terraria
Farming-themed life simulations such as Animal Crossing and Stardew Valley
Factory or colony management simulations like Factorio and RimWorld
MMORPGs such as World of Warcraft and EVE Online
Many other games feature crafting as part of a specific subsystem, such as weapon crafting in Fallout or Dragon Age, and cooking mechanics in The Legend of Zelda: Breath of the Wild or Eastward Journey.
Alternatives
There are many alternatives to this design pattern, differing primarily in how they treat the laws of digital physics. World designers must consider what level of complexity they want in the laws of digital physics. Deeper, low-level, or "fine-grained" digital physics laws are more world-like, sacrificing usability and immediacy to prioritize the variety and complexity of what can be built on top of them. Shallower, high-level, or "coarse-grained" digital physics are more game-like, sacrificing variety and complexity to prioritize the usability and immediacy of what can be built on top of them.
On the one hand, worlds can have more low-level or fine-grained digital physics laws, leaning toward simulation and emergence. For example, Zuse's "world computer" of Tenet gives objects locality, which allows for the introduction of systems that propagate causality. Such systems are more complex and harder to access, but enable richer simulations and deeper engineering opportunities.
On the other hand, a world can have more advanced or coarse-grained digital physics that lean more toward realism and immersion. For example, Moving Castle's This Cursed Machine has the concept of components with inputs and outputs that can be built into "combinable circuits" and used as building blocks for larger worlds. This kind of system is more subjective and potentially less flexible, but allows for richer worldbuilding and more focused gameplay.
Expansion and Future Work
One way to extend the system is to add more atom types. The atomic object system in Downstream currently has three atom types, but we plan to add at least two or three more. John Carmack talks about the continued popularity of modding in games like Doom and Minecraft stemming from having enough "Turing-complete design freedom." We don't yet know how many atoms we need to achieve a "Turing-complete design space." It's easy to imagine more types across the periodic table, but we suspect a system of this complexity would be unwieldy in practice.
Another possibility is that atoms affect more than just combat stats. This is already possible in theory, as players could create buildings and components with custom logic that exploit atom values in different ways. A building might require a player to carry an item with 100+ red atoms in it to see its crafting recipe. But without adding extra player actions and traits that can really hook into the atom system, this seems uninspiring. Once we have digital physics laws governing movement speed or RPG-style skill acquisition, perhaps there will be more exciting interactions worth considering.