Introduction to FOGs

Ishanee Nagpurkar
IOSG Ventures
Published in
6 min readJun 2, 2023

--

Fully on-chain games like Dark Forest have showcased that you can put game logic completely on the blockchain and that it inspires the community to build new tools, alliances, DAOs etc due to its properties of extensibility and permissionlessness. While the motivations and interesting new paradigms of autonomous worlds have been well documented before, I haven’t read many articles on FOG game engines which is one of the most fascinating new areas in this direction.

Game Development: Traditional vs. FOGs

Traditionally, game engines like Unreal, Unity and Phaser are used as the one stop shop for game development. It includes essential building blocks for developers like physics engine which controls things like motion, 2D and 3D rendering, object collision detection, sound, color, scripting, and even distribution mechanisms like server client architecture, frameworks for PC vs consoles vs mobiles, marketplaces for trading etc.

When World of Warcraft was launched, Blizzard had been working on the game’s networking tech stack for four years and spent only 1 year on the game content. Unity was launched shortly after in 2005 which cut down the development time from 4 years to a few months thanks to its modular tech stack.

In FOGs — the full game state is fully stored on the blockchain. Their game development represents a unique set of challenges and infrastructure. The 1st one developed for the Ethereum ecosystem is called the MUD Engine by Lattice. Since then, several others have emerged for different ecosystems and programming languages like DojoEngine for Cairo (starkware) and OPCraft by Lattice x Optimism.

The first game engine — MUD (Multi-User Dungeons)

MUD by Lattice was built during the 0xParc Residency in Q3 2022. The Lattice was trying to build several FOGs and despite different gameplay, style etc, kept running into the same generic blockchain problems. It wasn’t rocket science work but a lot of hectic work — and with that, they launched MUD, the first FOG engine that powers over 90% of FOGs.

MUD Devcon

When the MUD team was trying to build games, they did use game engines like PhaserJS, Three and Godot but those engines were client engines with the key job to take state of the World and make it player readable. Examples they shared — “is the bishop on the board?” and readability is “3D bishop piece with a fancy shadow and UI to move it on the board which includes click and drag based on the rules of the bishop’s movement”.

What is ECS?

They use ECS (entity component system) architecture. In this framework, every FOG will deploy a World contract which is a registry of all things in that world called entities. The entities are numerical IDs. Components are details attached to the entity and can be added to the World.

In this example, Entity 1 can be a dragon character and position, can Fly and Price are 3 different components.

Components don’t have any logic on their own. They can be added to new entities via System contracts. A system contract requires write access to the component of the owner. In MUD there is no difference between 1st party and 3rd party developers.

The first game — Dark Forest

Dark Forest

Dark Forest is an MMORTS space conquest game where players discover & conquer planets in an infinite and randomly generated universe. The game beta was launched in 2020 and its v0.3 was released on Ropsten testnet which lasted for 1 week. Players who entered this were whitelisted and competed for 102 Dai as part of the prize pool. Till date, over 10k players participated in Dark Forest rounds with trillions of gas used on Ropsten and Gnosis Chain.

Dark Forest Ecosystem

  • Plugins
  • Alternate Clients
  • GPU miners
  • Player Corporations
  • Data / Broadcast Marketplace — players can add new features via the data marketplace and use them in their gameplay.

DF doesn’t distinguish between players as EOAs or smart contract players. New types of gamer communities emerge.

  • Orden GG — another alliance / collective rivalling DF DAO.
  • DF DAO — created in May 2021. Astral Colossus is a smart contract (bot) player by the DF DAO group. This player has several restrictions like it can’t withdraw resources and plays with the solo objective of improving DF DAO’s score on the leaderboard. If you contribute to the player for any round, then the winnings will be recorded.

FOG Ecosystems

Due to the contributions of MUD & DojoEngine, EVMs and StarkNet are emerging as developer favourites.

Challenges with FOG Development

The challenges can be categorized as technological, user onboarding and economy management.

IOSG

Technical

Developing FOGs requires technical sophistication and is still a difficult task. Thanks to MUD and Dojo, FOG development has a lower barrier to entry but it still doesn’t provide the same ease to developers as Unity. Technical challenges presented to game developers also include scalability challenges which is why several teams use rollup as a service companies like Caldera to build on the OPStack, or using client-side proofs or building on L2s directly. Several builders are also keeping a close eye on verifiable decentralised compute networks like RiscZero to scale the scope of what their smart contracts can do. Gas optimization is also a big issue which is partially technical and scalability related and partially game design related.

SNARKs are used for either privacy or for scalability. Dark forest uses zkps to add incompleteness to the game without which any player can see the entire worldview. Others use zkps to offload heavy computation to the client side and to sync states (example playmint).

Onboarding

Wallet management is of the utmost importance if FOGs want to attract the broader blockchain gaming community (before they even think about mass adoption). Since the full game is onchain the gamer will likely have to sign a popup for every single in-game action which makes for a terrible user experience. Session keys are the easiest way to solve this problem however it has security implications. Current game developers don’t expect players to hold high value items in their wallets so for now this is not the most pressing issue for them, but will likely be one as more gamers flock to FOGs.

Another aspect is developer onboarding to encourage and attract modders to contribute and extend the game which naturally adds value to the autonomous world. This is primarily done by providing proper tooling for devs as well as ensuring proper monetisation or incentives for their contributions.

Economics & Monetisation

This is an unknown challenge at the time which will be clearer with the first successful on-chain game. The in-world economics will contribute to the fun or mining or resource collection aspect of any FOG and needs to be tweaked several times to ensure gamers have fun while playing. As FOGs don’t differentiate between 1st party and 3rd party developers, the game studio will also need to find ways to monetise themselves while maintaining extensibility for other game developers.

One of the interesting ways that game developers today are approaching monetisation is through sequencer fees, in-game actions using their token and using their token for custom gas on their L2.

--

--