Skip to content

Instantly share code, notes, and snippets.

Last active August 25, 2021 00:43
Show Gist options
  • Save jacobrosenthal/ce6dc70ac34c661d04575a5e11c0fa2c to your computer and use it in GitHub Desktop.
Save jacobrosenthal/ce6dc70ac34c661d04575a5e11c0fa2c to your computer and use it in GitHub Desktop.
Developing for Dark Forest

Developing for Dark Forest

Through the past year of development Dark Forest has found funding for its cutting edge research in Zero Knowledge gameplay through in game hat purchases and Gitcoin sponsors like you! Thank you.

With Ethereum gaming, the closed source server model has been replaced by a few Ethereum contracts. This means you can hack literally every other part of the experience to your liking.

Dark forest publishes npm packages for its types and utilities functions and releases an official subgraph to ease your development workflow.

Plugins Developers

Anyone can get started scripting with the Dark Forest Console. Just look out for the command that is printed from your mouse actions. You can copy and repaste that command to run it again any time, or modify it slightly to try something new. Mostly you'll just be replaying a command so dont worry too much about breaking anything, give it a shot. The df object and the ui object are the main api surfaces for plugins developers so you'll want to familiarize yourself.

Our plugins developers have written mini maps, automation plugins, remote miners and much much more. Check the Dark Forest Community Plugins Showcase for inspiration and to copy existing plugins and make them your own. Please join the community by submitting your plugins back there as well.

Client developers

By forking the React/WebGL client frontend and running one yarn command you'll be running a webpack local dev client against mainnet. This allows you to edit the client to your liking customizing any part of the game and the license even allows you to fork to your own open source version and publish to IPFS or a static site host like netlify to share with your guild or friends.

Also with the local client running you can develop plugins in your usual text editor. The webpack loader will watch the local_plugins directory for changes and reload your plugin automatically.

Contract Developers

If you're interested in Ethereum smart contract development and Hardhat tooling we release all smart contract source code and scripts used in developing and maintaining the game

But thats not all. With that knowledge you should be able to write contracts that interact with the mainnet Dark Forest universe, no permission needed. See the Sophon Reveal Marketplace example for a contract that lets users sell their daily reveal to the first bidder.

Happy hacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment