Dark Factory combines the exploration of Dark Forest with the automation of Factorio. Players design layouts for islands to optimize resource production, leveraging blockchain and ZKP for privacy, security, and decentralized gameplay. Creativity and strategy are key!
Prize Pool
Prize Pool
Dark Factory is a game that blends the strategic exploration of Dark Forest with the automation and resource management systems of Factorio. Unlike Dark Forest, which relies on random planetary data, Dark Factory empowers players to design and optimize island(planet) layouts, fostering creativity and strategic thinking.
Key innovations include:
By merging the best of both worlds, Dark Factory introduces a unique, privacy-focused take on strategy and resource management games, filling a gap in the current gaming landscape.
Why This Challenge Is Difficult: Our team consists of experienced ZKP circuit engineers, yet the early stages of this project were fraught with challenges. We needed to design circuits capable of proving production rates and capacity while incorporating the game's strategic mechanism. For example:
This involved solving complex problems, such as transforming the variable-length road search into fixed-length verifiable constraints, and designing hint path for efficient verification in the circuit. We also had to balance the circuit size to maintain performance and user experience.
Through meticulous optimization, we managed to keep the circuit around 100k constraints, enabling proof generation in just a few seconds, even on mobile browsers. This achievement ensures Dark Factory is ready for mass adoption, combining cutting-edge technology with accessible gameplay.
Dark Factory combines cutting-edge technologies to deliver a seamless gaming experience powered by ZKP and blockchain integration. Here's a breakdown of the technology stack and the development process:
Technology Stack
Development Workflow
Circuit Development:
Game.sol
.Smart Contract Integration:
Front-End and Proof Generation:
Automation with Typechain:
*Unique Challenges and Notable Hacks
Constraint Logic Design:
The most complex part of the project was encoding game logic into ZKP circuits. We invested significant effort in designing constraints on paper, exploring various methods to check and optimize constraints for efficiency.
Optimizing Performance:
Achieving a balance between circuit size and execution efficiency was critical. We reduced constraints to under 100k, ensuring proof generation in seconds, even on mobile browsers, enhancing accessibility.
Canvas-Based Interaction:
Directly manipulating the canvas for layout creation brought the game's strategy to life, providing an intuitive experience for players while ensuring the layout's compliance with constraints.
By leveraging EVM-compatible chains, we were able to iterate quickly, validating ideas and ensuring smooth integration of blockchain technology into gameplay. The result is a highly efficient and accessible system that bridges the gap between blockchain innovation and an engaging gaming experience.