On-chain Gaming Tech: A Tale of Servers, Clients, and Tick Rate | Skill Tree #28
The Tech Stack of On-chain Gaming: How Game State is Synced
Games-related challenges for on-chain games: Latency, randomness, hit point regeneration, continuous passive effects, time, etc.
we covered randomness here
There are several ways to implement the concept of time and tick rate on blockchains
tick rate = how often a game state is updated and broadcasted to the client every second
The block time is a bottleneck for high tick rates → solutions span from off-chain hybrid solutions (e.g. Argus, Curio, Aperture Labs) to fully on-chain (e.g. MUD)
Different tech stacks are emerging which make development more efficient with standards/frameworks, easier composability, and taking care of game state updates (ticks) and indexing to reflect game state on the clients
Timekeeping for Digital Gods
Devs set the physics in which players are autonomous
Key dimensions of physics are time, the world’s laws, and their scope
Time
ticks are updates to the game state, which are done by applying the laws to the game world
each tick is an “instant” within the flow of time
with on-chain games, the game state is on a blockchain, which creates challenges
unsynced time vs synced time (time passing is related to external time)
example: updating an NPC position on the map (synced time)
lazy updating: positions are only updated when a user interacts with them
update logic needs to be implemented in a smart contract & the client
manual ticking: external account calls update function → participates in gas market - uncertain if update can be done in time as account may be outbid
automatic ticking: tick contract can be called by the protocol itself → guaranteed time progression, no front-running, outside of regular gas market
requirement: custom rollup/blockchain
higher tick rate = more resource intensive for nodes, more state to be updated = more compuational costs
automatic ticking adds to load
Application of a world tick in 0xCitadel as a way to better balance economic risk/reward gameplay
Laws
closed-form: fixed number of operations
future state = past state + time elapsed (e.g. start at 10 gold, mine 1 gold per minute, have 15 gold 5 minutes later)
advantage over open form when time is synced: use lazy updating and set state to the state it would have been e.g. plant tree at block 1, harvest at block 10, logic is 1 apple per block → give player 9 apples
open-form: number of operations grows based on a given variable
future state = past state + actions iterated over time → unpredictable and interesting, but also computationally more complex
more dynamic/flexible e.g. (quasi-)random world events like plagues attacking trees etc.
Scope
world can be divided into different regions with different concepts of time
Region #1: vast user acticity → more expensive physics
Region #2: low user activity → simpler physics
may lead to feelings of inconistency & confusion and minimizes interactions between regions
other design decision: size of each region
Game Discovery in the New Age
The quantity of games that are being released each year is increasing. In 2022,10,963 games were published on Steam alone → Challenge for players: What (& what not) to play
Traditional methods (magazines, reviews) are single-dimension (‘“game of the year“) and miss context → players can’t uncover their identity
What’s needed: decentralized approach to gaming culture
Authenticity: Return to the earlier internet - users as individuals with values, personal truth, and cultural background/identity → innovative identity as a USP for a game/game studio
Participation: Bi-directional player-developer relationship
Community-centered development
Community governance & safety: Shifting from moderation (centralized) to governance (decentralized, self-governing communities based on shared values).
Expression: Required to build an identity
identity expression through affiliation
identity expression through player creativity
Achievement NFTs as a CV of a player’s macro-journey across games which builds an increasingly unique identity
The mentioned trends are something we see web3 game studios embrace, such as community-centered game development. Crypto can be helpful here in creating a more equitable player-developer relationship, for example by enabling value sharing with players, facilitating governance voting, and allowing players to exit games with their owned goods.
A decentralized world of federated, interconnected game experiences offers game players unprecedented choice and agency in the creation of their interactive digital experiences.