# Dark Forest: Lessons from 3 Years of On-Chain Gaming by gubsheep | Devcon Bogotá

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2023-10-07
- Duration: 25:51
- Watch: https://streameth.org/watch/yt-z7V830zndoA
- YouTube: https://www.youtube.com/watch?v=z7V830zndoA

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more.
https://archive.devcon.org/archive/watch/6/dark-forest-lessons-from-3-years-of-on-chain-gaming/

We'll present an overview of learnings from 3 years of building and running Dark Forest, the first fully decentralized MMORTS, including: why ZK is important for games, what a crypto-native game is and why we should care, designing for emergent player behavior, pushing the limits of Ethereum devex, and social consensus and legitimacy - why is Dark Forest more like chess than League of Legends? We'll also hint at 0xPARC's next crypto-gaming experiments.

Speaker(s): gubsheep
Skill level: Intermediate
Track: UX & Design
Keywords: crypto-native,gaming

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 6 was held in Bogotá, Colombia on Oct 11 - 14, 2022.
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

foreign [Music] and today I'm going to be talking about Dark Forest lessons from Three Years of on-chain Gaming um so first real brief introduction on gupsheep I've been working with the ethereum foundation since about 2018 on various education community and applied ZK research and development projects I co-created Dark Forest and spent a lot of 2019 to 2021 building the game out with various friends including Ivan Chubb Alan law Bryce Huang Robert Cunningham and more and currently I'm working on applied ZK research and development and other applied crypto experiments with Xerox Park so to give a little bit of context Xerox Park is a research focused organization that supports a network of teams that are all aiming to push the envelope on what is possible to build on blockchains or with New cryptographic Primitives and a lot of these experiments started with dark Forest which is a part of the Xerox Park Community so today's talk is nominally about Dark Forest but uh you know the subject or the question that I'd really like to answer looking back on three years of running this game is what can projects like Dark Forest teach us about Innovation and crypto more broadly and to answer that first we have to talk a little bit about what Dark Forest actually is so summed up in a sentence Dark Forest is a decentralized MMO RTS game built with ZK snarks on ethereum now that's kind of a mouthful so let's take a look at a few screenshots to understand what this really means so first off Dark Forest is a massively multiplayer strategy game that takes place on an infinitely on an infinite procedurally generated Universe of all sorts of different types of planets and space entities the most popular dark force game mode is a week-long battle royale contest where thousands of players Bots AIS and even smart contracts compete head-to-head for Galactic Supremacy players are dropped into the Universe on a tiny home planet and they must Harvest resources conquer nearby planets and interact with their neighbors either through alliances or trade or negotiation or even war in order to expand their Empires it's a hardcore free-for-all space themed strategy game and rounds can get pretty intense the thing though that makes Dark Forest different from your typical strategy game is that it's entirely run on an evm compatible blockchain this means that all of the game State and all of the game rules are actually stored in smart contracts rather than a traditional backend server and every single move that any player makes is in fact an on-chain transaction because the game is so complex in comparison to a lot of modern uh ethereum applications in production each move can take up to millions of gas and players over the course of a single round can end up making thousands or even tens of thousands of moves per game the other key mechanic of Dark Forest that is shared with a lot of other strategy games is that much of the Intrigue in the game comes from the concept of hidden information or information asymmetry the overall Dark Forest universe is practically infinite and it's teeming with thousands of adversarial players Bots scripts smart contract players etc etc however individual players upon joining the universe only have access to a very small slice of the total Universe map and this is exactly what gives Dark Forest its characteristic or namesake sort of Dark Forest feeling so at first it might seem kind of paradoxical that we can have this on-chain application where there's so much complex private State being mutually moved around by different parties especially because blockchains are systems where all information is public and transparent in other words any data that's stored inside of a smart contract is something that anyone can access so how can we put a game where different players know different parts of the map on the blockchain well the answer is that this is exactly what ZK snarks enable and thanks to the work of the Iden 3 team with circom and snark JS back in 2019 these kinds of applications or incomplete information Games first became possible to build on chain okay so hopefully that gives a little bit more color into what Dark Forest actually is next I want to take a step back and just talk a little bit about how our thinking about the game has evolved over time so we started working on Dark Forest back in 2019 and it started off as just a pie in the sky experiment you know let's build a ZK game where every single wasd move is in fact a blockchain transaction uh triggering a ZK snark proof verification on chain now at the time this seemed pretty ridiculous blockchains are super slow and super expensive databases that of course could only be used for critical Financial applications or transfers and games require pretty much the opposite we did some benchmarking and we estimated that on ethereum mainnet a move on Dark Forest could cost anywhere from 10 to 100 US dollars and players might need to make up to thousands of Moves In order to meaningfully interact with the game so we originally built a game not because it was necessarily like possible or feasible but it was an intellectual experiment to learn more about the tech and obviously from a cynical or skeptical point of view it would have seemed like pretty much a useless thing to do but if you fast forward three years A lot has happened since over 10 000 players from around the world have participated in dark forced rounds running entirely on chain they've collectively spent trillions of gas on robsten xdi and gnosis chain and a rich developer ecosystem has emerged for player built third-party plug-ins alternate clients GPU miners player corporations data marketplaces chain analysis tools and more and we've seen some epic on-chain dramas featuring deception betrayal universe-wide alliances one of my favorite examples of this is this long-running rivalry between these two player alliances Orden Gigi a group of Ukrainian and Eastern European players uh and DF Dao which is uh both of these are basically player groups that have teamed up using various crypto native governance mechanisms in order to play the game and one of my favorite sort of you know summaries of this story is this thread by Will Chang on Twitter uh where he basically if you find this thread you can read about the story of bitter Rivals a dream of Glory betrayal Redemption it's kind of Awesome and Beyond Dark Forest we've seen this entire ecosystem of Next Generation application Level r d uh in the broader Xerox Park ecosystem and Beyond sort of emerge uh oftentimes taking some degree of inspiration from Dark Forest as key ideas from the game have clarified and been built on top of and extended so the first question that we're often asked is why build games on the blockchain to begin with um and I think the answer to this question is pre-revealing about what crypto games can teach us about uh Innovation at the application Level more broadly so there's been a lot of talk in the last couple of years about things like game five or play to earn or how crypto can help to financialize games but to be quite honest for me personally these ideas are pretty much the least interesting parts of the possibilities of crypto gaming um I think that there's a kernel of some interesting stuff there however I think also 90 of it is a lot of times inflated by hype and speculation and instead I think that crypto native games are powerful because they have this property which you know I sort of in my own head label as permissionless interoperability dark force is an ethereum smart contract which means that anyone player bot script or smart contract can interact with the game programmatically this has led to some really interesting emergent Behavior which I'll show in the next couple of slides so the first thing to note about any crypto native game is that it is pretty much necessarily client agnostic because the source of Truth for the game rules and state is the blockchain itself the game doesn't care about what client you use to read its data or interact with its API in the first releases we provided an out of the box web client for players to use and we noticed that players quickly got to work hacking the client to build automations different kinds of data visualizations or new skins so Ivan and a number of other contributors released a plugins tool chain that allowed people to build and share Snippets of JavaScript code that would allow them to customize or modify their front-end gameplay experience and today there's nearly 100 open source plugins that players can use to remotely generate snark proofs outline enemy territory or even wage automated war and all sorts of different functions so this has been fascinating to see over time one step further than that you have the idea of third-party client implementations so again Dark Forest or any crypto native game starts to look more closely uh like resembling a protocol or a set of you know rules digital physics that uh various people will subscribe to uh via whatever client they want and this is an example of a client that Georgios and Kobe Gerkin built for Dark Forest originally built in Rust now the advantage of this is that it allows you to play Dark Forest in your terminal and it offers better performance perhaps than the typical uh the you know vanilla JavaScript web client in that you can generate Stark proofs and explore the universe faster however this comes at the cost of having a nice visual UI finally one more thing on the client side that I want to explicitly point out is the level of complexity that we began to see in automations and Bots programmed by players to play the game again all of that kind of activity is fair game on Dark Forest Dark forests smart contracts simply specify the rules or almost the physics of the universe and subject to following those rules you can do almost anything you want by 2022 some top players had built tools that allowed them to almost entirely abstract away the base level gameplay mechanics of Dark Forest rather than making individual moves players were instead operating these more complex dashboards of higher level heuristics and strategies things like press a button to distribute silver to all upgraded planets in this region these scripts would then translate these higher level strategies and to base their moves uh and at this point players were basically programming their own gameplay experiences you had players building third-party tools that became a part of their first party player uh gameplay experience okay so so far we've only talked about client-side programmability um and we've seen plugins third-party clients automations Etc but I think that the true promise of crypto native games comes even one step further while all of those previous things are kind of reminiscent of things you might see in the modding ecosystem of games like Minecraft Etc um crypto native games do allow you to do something that is fundamentally different and that fundamentally was not possible in the same ways before so to illustrate exactly what's going on here I want to bring up a hypothetical example say you're playing a traditional multiplayer RPG game and you want to see a new feature added to the game so this might be a game like Runescape or World of Warcraft or you might imagine like a multiplayer version of Pokemon or something and let's say that you have a new feature that you'd like to see implemented of the game like player to player trading so in the traditional Paradigm here's what has to happen first I'd have to go to the core developers of the game and make my feature requests and maybe they decide to accept it or maybe they don't then after that the core devs have to introduce a new data transformation on their proprietary back end and API routes on their web server that trigger these data Transformations and finally they have to go to their canonical game client implementation that's distributed to everybody and add in a new UI component like a button or something that when clicked triggers this new or hits this new API route contrast that with dark Forest where in Dark Forest any player can develop an escrow or Marketplace contract that talks to the core Dark Forest contract they can then deploy this contract to the blockchain and maybe it says something like all right if anyone deposits one eth into this escrow contract it will programmatically talk to the dark force contract and trigger a release of like 100 silver from my planet to yours afterwards they can write a JavaScript plugin that allows a web client to interact with this Marketplace contract and distribute this to any player who wants to opt into this new core gameplay feature in this way players can add entirely new features to the game without having to go through specially permissioned Developers so the broadcast Market which you can see on screen right here was the first example actually of a feature developed in this way it was built by Blaine bubblitz and Jacob Rosenthal and what it allows you to do is it allows you to ask for someone to broadcast or share with you a certain set of map information for a fee now this was extended earlier this year with Night Market built by Xerox stage and prxyz which is a trustless ZK enabled Marketplace for you to exchange encrypted data with other players uh on the map again for a fee and we've also seen several groups build out Marketplace contracts for in-game items as well as some interesting experiments into player corporations or other coordination constructs so on the screen here you can see a contract called astral Colossus built by DF Dow Dark Forest Dow so this was really cool essentially the dark force contract does not distinguish between players as eoas externally owned accounts or smart contracts so a smart contract can play the game just as much as a regular player can play the game and the astral Colossus was essentially a smart contract player that anyone could contribute to our pilot and in just 48 Hours of its operation it reached you know among the top 50 places on the leaderboard with contributions from dozens of players so I just want to imagine like you know you're playing Dark Forest and you run into this growing amoeba that's this like crazy headless organism amalgamation of dozens of individuals um it's super interesting to speculate on on how these kinds of things might evolve going forwards and finally new tools like those being built by teams like lattice will make it easy for players to even add in new rules or resource types to the games so this is a screenshot from a mock-up of what it might look like for players to introduce plugins and third-pity contracts that add in their own game modes side objectives or even resource types so to sum it all up what is permissionless interoperability mean permissionless interoperability means that players can build the game experience not just the core developers and this unlocks a massive range of new kinds of affordances in Games built in this fashion okay so I think uh that's mostly my answer to question one why build games on the blockchain in other words what can blockchain do for games the second question that I think is also very instructive to ask is why build games on the blockchain in other words of all the things that you could build on the blockchain why bother with a use case why bother with an application that doesn't have any obvious practical use case and you know the text and the purple sort of my like broader interpretation of uh what I want to answer this question for and I think it's a big question to ask any r d facing org which is working on things that don't have a concrete practical use case so I've got three reasons um the first is that games and other experimental applications of this nature are a technically demanding yet low stakes environment uh for us to rapidly push forward infrastructure without putting massive amounts of capital or social stake at risk in the process of building crypto native games and game infrastructure the Dark Forest and Xerox Park communities have uncovered bugs and core infrastructure and motivated significant optimizations uh to you know things like uh nethermind or optimism Canon or akula or Aragon etc etc um this progress can happen rapidly and iteratively without putting hundreds of millions of dollars at stake as in D5 so we can move forward the ecosystem very quickly we can move fast and break things again without suffering enormous consequences where people's real livelihoods are at stake um this is very reminiscent of I would say Gaming's impacts on the early days of personal Computing and of the internet games like Wolfenstein 3D and doom massively Advanced the graphics industry and stretched networking infrastructure to its limits back in the 90s and devs were forced to invent new techniques and optimizations many of which we still use today so the second reason is that games are a leading indicator in technology and player behavior in today's games can help us predict user behavior on tomorrow's digital systems to draw a parallel back to the early days of mobile Computing another recent platform that you know has been hugely impactful for all of our Lives interactions such as swiping and rotating were initially popularized and you know somebody even say invented by games like Cut the Rope or Angry Birds and while these apps were just games these interaction patterns that they pioneered have become ubiquitous across everything that we do on mobile apps today so we've seen a few examples of this a few early examples in crypto gaming thanks to the Community Management efforts of folks like Jordan Spence classic Jay and Ivan we've seen various crypto native player cooperatives emerge uh using new crypto enabled mechanisms for governance voting and value distribution the lead of DF Dao Tony Goss sums this up quite nicely in an article the crypto gaming governance thesis in which she argues for the values of the value of games as a Sandbox for Innovation inside digital governance and then the final reason that I would say that games are good for blockchain is that games are inherently playful the crypto space currently is dominated I would say by technologists and financiers and a thriving indie game Community can potentially help to bridge the gap between crypto and uh more creatively leaning folks such as artists writers thinkers Etc introducing critical dimensions of intellectual diversity that crypto doesn't currently have and I think that this kind of diversity is crucial for any intellectual movement or counterculture historically many creatives have been extremely turned off or outright hostile to crypto due to the hyper financialization of things like nfts um but by really showing what the technology makes possible and what permissionless interoperability makes possible we've been finally getting some indie game devs to come around so for example the loudest team out at the autonomous world's residency has been pulling together a community of artists and creatives in London to introduce proper game devs uh and creators to blockchain technology so now I want to zoom out even a bit more um what are some of the lessons that we can learn from Dark Forest and crypto gaming which we've talked a lot about in this talk that are even more broadly applicable to Innovation on blockchain technology in my head three things really stick out the first is to put it bluntly the importance of [ __ ] around and finding out so much Innovation is the result of people being willing to work on seemingly blue sky moonshots that seem impractical at the time that they're conceived and for which we can't really predict what the outcome is going to be so to give a historical example that I think sums up this principle very nicely I want to take us back to the 1970s so up until the 1970s computers themselves were commonly conceived of as these like monolithic room-sized beasts only accessible to a select few organizations like government agencies and University Labs simply because they were so expensive the idea of the personal computer as a tool for personal expression and Liberation was something that was not on the map at all until researchers at Xerox Park basically put together these Xerox Alto which was the first personal computer somewhat resembling what we think of as a PC today at the time the altar seemed like a colossal waste of resources and money it was one of the first devices to have a graphical display like a monitor and that took up two-thirds of the memory of the entire unit and in a world where memory is really scarce and really expensive this seems extremely frivolous um also it costs like twenty thousand dollars per unit in nineteen seventy dollars which is pretty terrible but Xerox Park what they were doing was they were looking at Moore's Law at the time and they correctly predicted that all of these resources would become more accessible over time and they decided to skate to where the puck was going and in doing so they quite likely either altered or accelerated the trajectory of computing technology by potentially even decades Steve Jobs and Bill Gates in later decades cited Xerox Park as the inspiration for so much of their own commercial Visions for personal Computing technology now on a much smaller scale again we mentioned how three years ago Dark Forest and various other experiments started as pie in the pie in the sky experiments and we've seen firsthand how [ __ ] around and then finding out has been so valuable to us in enabling us to uncover new research directions or New Dimensions for crypto applications to really take the stage in the coming years another interesting that I've taken away from watching Dark Forest evolve is a mental model which I think of in my head as a dichotomy between systems and tools so to give an example of what I mean or to explain what I mean by systems versus tools and the particular usage here I'll give a few examples so this is a screenshot from battle.net which is Blizzard's launcher for a number of very popular AAA games such as Warcraft uh or sorry World of Warcraft Starcraft Etc each of these games has a clearly defined canonical game mode set of rules ranking system you know methods of interacting with the game it's a pretty prescriptive thing that tells you exactly how you can and can't interact with Battle.net and it's a very well engineered very large monolithic system similarly this is a screenshot from the Facebook homepage Facebook itself is also a monolithic system and they've specifically engineered ways that you are permitted to interact with other participants and components of the system how you can log in and authenticate uh how you can message other people and even what API routes you're permitted to access and how frequently you're permitted to access them in both of these examples Battle.net and Facebook we see monolithic systems that are disproportionately engineered to serve the goals and visions of a particular group on the other hand dark force has found many of its coolest and most unexpected outcomes as a result of building tools for users tools as opposed to systems are small modular and accessible things that aren't overtly prescriptive in their use a tool invites a user to uncover their own visions and use cases and in our case the dark force plugins tool chain and many of the other developer tools that we built enabled people to do all sorts of those creative crazy creative experiments that we saw earlier in this presentation this also means that tool Builders have an enormous leverage in these kinds of early technology ecosystems for example Blaine bubblets built the Dark Forest plug-in Dev server which again enabled a ton of innovation and the folks at DF Dow have been building out custom infrastructure that allows anyone to modify and run their own dark force rounds with custom rule sets leading to things like the dark forced Arena Grand Prix and more now I don't think systems at least as I'm referring to them are necessarily better or worse than tools they're quite necessary for the world to function but there's a time and a place where you either want to be Building Systems or building tools and early on in a Technology's life cycle before you can predict all of this serendipitous Innovations or second order effects of the technology I think it's important to focus on tools because tools Empower people future generators of innovators to express their own visions that are unpredictable to us today with crypto native gaming I think we're also just getting started and I want to shout out again one particular team that will be releasing and demoing a lot of really cool stuff this week so the lattice team has been building out a tool stack for various crypto native games and crypto native applications uh and if you're curious uh their sessions are on the Devcon schedule so the final note that I want to end on uh is the importance of playing what some people call the infinite game so this is a term coined by James P carce a religious scholar in his book finite and infinite games which I highly recommend to anyone who's never heard of it in this book cars basically puts forward the idea that there are two kinds of games finite games and infinite games a finite game is played for the purpose of winning think of a sports match or a political election or an Mev arbitrager conversely infinite games are games that are played for the purpose of continuing the play to me this means engendering Innovation experimenting with new rule sets and ways of collaborating and developing new tools for continued creative expression I think that dark Forest has done a good job of representing what it might look like to participate in the infinite game that is ethereum and I'll wrap this up with a quote from Tony Goss at DF Dao where he outlines the philosophy of the dfl player Group which is to play Dark Forest is to build is to build on Dark Forest so thank you everyone and if you're curious about any of the other work that we're doing to build on top of these communities you can check out these sessions um but otherwise yeah I think that's all I've got for today thank you
