gm everyone, I’m derio, ethereumnavi’s owner.
In this article, I would like to introduce and explain Dark Forest, an “on-chain game using zkSNARK.
If you are a fan of crypto-native projects, you have probably at one time or another thought that you would like to play a game that is built on-chain as much as possible.
In fact, there are a number of games and other activities involving NFT/DeFi elements on the Ethereum, and I have the impression that various attempts are continuing, including Anonymice, Wolf Game, and The Crypt.
However, is it generally difficult to construct an “incomplete information game” in the case of Ethereum (L1) on-chain games? The question arises.
The author understands that since all information is recorded on the public blockchain and can be verified, it is not suitable for building games that have ‘hidden elements’, which makes it difficult to create complex games.
However, the “Dark Forest” introduced here has attracted a great deal of attention as it struggles to solve such issues by using zkSNARK while bringing MMO games on-chain.
This article introduces “Dark Forest,” an on-chain game using zkSNARK, with the aim of providing an overview of the project and its highlights, as well as an understanding of the imperfect information games in the web3 era that can be realized by primitive on-chain games. The purpose of this article is to give you an overview of the project, the main points of interest, and incomplete information games in the web3 era that primitive on-chain games can realize.
First, let me explain the structure of this article.
First, I will give you an overview of the on-chain game “Dark Forest,” the subject of this article, as well as an understanding of words such as “perfect information game,” “imperfect information game,” and “fog of war,” the cryptographic version of the game.
Next, the author will actually play “Dark Forest” to give you an idea of the actual on-chain game that is being talked about, and to get a feel for the game.
Finally, the author will explain the development potential of on-chain games and how they differ from centralized games, while sharing his personal views.
I hope that this article will be of some help to those who are interested in understanding the overview of “Dark Forest,” the points of interest, and the potential of decentralized on-chain games.
※This article is for general informational purposes only and is not intended to be and should not be construed as legal or investment advice. Therefore, it is not a recommendation to purchase any particular FT/NFT and should be used only as a study.
If you wish to place an ad, please contact us here.
thanks for sharing this @ethereumnavi! always awesome to see content from ethereum + DF community from around the world + in many different languages https://t.co/nkmQc0U8Sq— dark forest (@darkforest_eth) September 26, 2022
What is Dark Forest?
Dark Forest is a decentralized RTS (real-time strategy) on-chain game built on the Ethereum and Gnosis (previously xDai) chains.
The game is billed as an “MMO space conquest game” and is based on the novel of the same name, “The Dark Forest,” the second book in the “Three Bodies” series, one of Liu Jixin’s most famous works.
At the time of writing, the first beta (v0.3) of the game was released on Ethereum’s Ropsten testnet on August 7, 2020, almost two years ago, and the game is currently in v0.6.5 development (mid-September 2022).
In order to give you an idea of what the game is really like, I will play the Arena version later, but in this chapter, I will give an Overview of the game and explain the innovations and highlights of Dark Forest.
As will be explained in detail later, in general “on-chain games” all information is disclosed to all players, making it difficult to design games with hidden elements, which can be a challenge depending on the genre of the game.
However, thanks to the use of zkSNARK in this game, it is possible to achieve ‘a state where the player’s movements are verifiable in precise detail, but hidden from other players.
I would like to pick up and explain this point first.
Complete Information Games / Incomplete Information Games
As mentioned earlier, zkSNARK is used in this game, which allows for ‘the player’s movements to be verifiable in precise detail but hidden from other players‘ in an on-chain game.
In other words, despite being an on-chain game, it is described as an “incomplete information game” in the sense that it has “confidential information”.
The words “perfect information game” and “imperfect information game” may be unfamiliar to you, but the concept itself is simple.
What is a “perfect information game?” If I was to explain this question in terms of familiar games, such as chess and Go, I could say that they are “perfect information games” because all information on the board is open (revealed) to anyone’s point of view.
These games can be called “perfect information games” because all information on the board is open (revealed) from everyone’s point of view.
Similarly, CryptoKitties is a information game. CryptoKitties is a game of complete information, because all players know who owns which kitty and what the traits of each kitty are.
In short, it is a word that describes all kinds of games, such as table games with full visibility of the opponent’s situation, or traditional on-chain games that are played entirely on the Ethereum chain.
Dark Forest, on the other hand, is an on-chain game of the kind called “incomplete information games”.
To explain an “incomplete information game” in terms of a familiar game, it is a game with “hidden information” like mahjong or poker.
In mahjong, the opponent’s hand and deck are hidden, and in poker, information about the opponent’s hand and deck is also hidden.
The novelty of Dark Forest lies in its “on-chain” realization of this “incomplete information game.
Cryptographic Fog of War
Generally, there is a system called “fog of war” in war games, which is used to refer to “the method of not displaying information on the opposing side’s troops, terrain, etc. until the player’s troops can see it” and “uncertain elements in operations and battle scenes”.
The “fog of war” in Dark Forest is the part of the map that is invisible to players. When a new Dark Forest account is created, only a small portion of the map (the starting area) is revealed to the player, while the rest of the universe is covered by the “fog of war”. Over time, the map will be revealed through CPU mining, the speed of which depends on CPU power.dfwiki.net/wiki/Fog_of_war
Until now, most so-called “fully on-chain games” have been Complete Information Games, and it has been difficult to create practical MMO games with “fog of war” and other features.
However, as mentioned earlier, Dark Forest uses zkSNARK to create “fog of war” by hiding the location on a shared map.
The player does not send the coordinates of his conquered planet to the core smart contract, but instead sends a commitment to the planet’s location (by hashing the planet coordinates) with a zero-knowledge proof that the hash is valid, thus treating the planet location as secret data This allows the location of the planet to be treated as secret data.
Similarly, when a player makes a move, a hash of the source planet and a hash of the destination are sent along with a zero-knowledge proof that it is a “valid” move.
Since it is difficult to invert hashes, examining the Dark Forest contract will not reveal where the other players actually are. The only way to find other players is to search by force.
Others｜Factors such as presence of plugin systems
The most important objective of Dark Fores is stated to be “to have fun, which users can achieve in a variety of ways.
For example, those who are less interested in gameplay but more interested in development can have fun by creating and contributing plugins, while collectors can collect artifacts on an on-chain basis.
To delve a little deeper, the former “plug-in system” allows each user to “automate actions” by writing code, thus “enabling the construction of bot networks.
In addition, by automating actions, it will be possible to construct a “high-level game system” similar to what is happening in the DeFi space.
It is also important to note that this game system is not provided by the officials, but created by the users.
However, there are other features and points as follows, so if you are interested, please dig deeper and find out more.
- Advantages of being completely on-chain
- Very programmable and client independent
- Can write scripts for player groups and guilds, create 3rd party clients and bots, and even design smart contracts
- Existence of DAOs
- A group of player groups or guilds working together to run a single account or smart contract account, essentially trying to achieve the highest score on the leaderboard through a cooperative mechanism
- Presence of smart contract players
- Dark Forest core contracts treat EOA players and smart contract players the same regardless of whether they are EOA players or smart contract players
- New features, new global features can be added to Dark Forest with Ethereum-based architecture and smart contracts
- Supplementation of other technical elements
- One of the first applications capable of delivering zero-knowledge proofs into the hands of end users interacting with the system via a browser client
- Project to build a marketplace for secret data is also underway
Get a feel for the atmosphere by actually playing the game.
In this chapter, I will show you how I play the Arena version of Dark Forest to give you an idea of what the game is really like. (Dark Forest Arena is a forked version of Dark Forest created by dfdao.)
If you are not interested in the content of the game itself, you may skip to the next chapter 【Discussing the potential of “on-chain games”】.
At the time of writing, Dark Forest Arena has a command-line style UI/UX as pictured above.
First, you will create an account, so type
n and press Enter.
After waiting for a while and completing the wallet creation, I want to continue with the tutorial, so type
y and press the Enter key.
Then a planet and a spaceship orbiting around it appear, as shown in the photo above.
Checking the guide text in the upper left corner, it says, “Click your spawn planet to get started,” so click on it.
Well done! This is your first planet. During the game, you will be capturing planets from all over the universe. Within the planet frame, brief information about the planet will be displayed. When you hover the cursor over a planet frame, statistics for that planet will be displayed. (This information is displayed below the levels and ranks.)
This is followed by a brief review of how to operate the system.
Although brief, the following is a summary of basic operations.
|Action||How to operate|
|Zoom in/out of screen||Scroll with mouse wheel|
|Moving through space||Drag the mouse (while clicking on nothing)|
|Back from selection screen|
As mentioned in the Overview, the game also allows you to expand your empire by capturing other planets.
If there is an asteroid belt nearby, you can use the energy of your planet to move and occupy that asteroid belt.
By clicking on your planet, pressing
q and then clicking on another asteroid field within your position, you can send energy or spacecraft there.
Now that you have sent silver from your asteroid belt to a planet, you can now upgrade the planet.
Select a planet and click the Upgrade button.
Then, the amount of silver decreased from 625 to 500 and a yellow ring appeared to reflect the Upgrade of the planet.
In this way, in the beginning, it is a good idea to work on upgrading the planet while acquiring resources within your own camp.
Although I have only partially focused on the introductory part of the game, this is a rough and basic overview of the book, in which players are expected to expand their planetary empires as far as possible while strategically collecting resources randomly scattered throughout the star map, and sometimes fighting off invasions from other players. Overview of the game.
Discussing the potential of “on-chain games”
As mentioned in the opening Overview, Dark Forest was one of the first “on-chain games” to be launched entirely on the blockchain.
At the time of writing, the number of “on-chain games” is clearly smaller than the number of so-called “play-to-earn” games, but there is active development of on-chain games in the Starknet ecosystem, and the number of examples is steadily increasing on a global basis. This is the impression I have.
Now, I would like to touch on some of the advantages of on-chain games, imo.
For example, it is very difficult to achieve interoperability and interaction among Centralized games because of the silo structure of data recording servers in each game.
It may be possible for companies to form partnerships and share assets, but that would be a very “web2-like” approach, to use a common expression, where the fate of everything is decided by the sole discretion of the administrator.
If you want to pursue a “web3-like” approach, it would be better to incorporate elements such as permissionless network effects and composability that come from the publication/sharing of data.
However, as I have mentioned from the beginning, there have been various attempts to create games that pursue this “unique web3” concept, but one of the downsides of disclosing/sharing data is that “it was very difficult to create a game with hidden elements on-chain.
For example, when a simple game such as “rock-paper-scissors” is played on-chain, the player who calls the contract function and creates the transaction first is the first to disclose information, making a serious game of rock-paper-scissors impossible.
As a side note, I used to create pinball games using the Unity game engine.
As those of you who have used Unity may know, Unity allows game developers to freely manipulate and define the laws of physics in the game.
For example, in the case of the pinball game above, the developer can change the game as a whole at his/her own discretion by manipulating the speed of the falling ball (gravity), the friction coefficient of the ground the ball touches, and the repulsion coefficient of the walls and other objects the ball strikes.
In a decentralized on-chain game such as Dark Forest, for example, it is possible for everyone to make changes to the state of the universe, the orbits of planets, and any other coefficients “at the will of the users”.
In other words, a change made to one’s own planet will change the entire universe, creating an interaction, and I think this is one of the most interesting aspects of on-chain games.
Some may ask, “Isn’t that possible with existing Centralized games?
Some people may think that this is true, and that is certainly true.
However, there are hidden interesting experiences that can only be realized by putting everything on the chain, and I think this is the point where the romance lies.
For example, the following can be considered as an example of implementation in the pinball game mentioned above.
- Rabbithole will implement a quest “to give NFT to users who score more than 10,000 points in pinball”.
- Users who score 50,000 or more points in pinball will be awarded pinball objects in Phi
In the opposite direction, there could be cases of interaction such as “actions taken on DeFi have some kind of impact on on-chain games”.
In other words, the key to on-chain games in the future will be “how many products can be connected to each other beyond the boundaries of the game“.
Another important aspect of on-chain games is that the core game system is completely on-chain, completely open, immutable, and verifiable by default, but as this chapter is getting long, I will discuss this another time.
On-chain games such as Dark Forest are trying to achieve what centralized game services cannot, and I will apply the knowledge gained from this to products other than on-chain games.
From this perspective, I will continue to pay attention to the future trends of on-chain games, including Dark Forest.
Introducing Dark Forest Lobbies
Announcing Dark Forest
Dark Forest DAO: Games as mediums of technological experimentation and exploration
Six Moonshot ZK Applications
Welcome to the Dark Forest Wiki!
Fog of war
Nouns DAO JAPAN aims to be the best Nouns community in the world. Click here to join the Discord.
In this article, I introduced and explained Dark Forest, an “on-chain game using zkSNARK.
I hope that this article has been helpful to those who are interested in understanding the overview of “Dark Forest,” its points of interest, and the possibilities of decentralized on-chain games.
I also encourage you to share or comment on Twitter if you find it helpful.
🆙posted an article in English about Dark Forest.@darkforest_eth @gubsheep @Kooshaba @spencecoin https://t.co/JEYTTeCHTi— でりおてんちょー｜derio (@yutakandori) March 7, 2023