Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 1.52 KB

DEVELOPMENT.md

File metadata and controls

6 lines (4 loc) · 1.52 KB

On-Chain Mechanics of Octoguns

Octoguns operates as a fully on-chain game, where every movement and action is recorded and validated on starknet thanks to the dojo engine. Instead of tracking actions based on time, movements are recorded at a rate of every 3 frames, ensuring that all player inputs and character motions are constant. Once a player accumulates 100 recorded movements, an array is generated that stores the vectors for each movement. This array also records whether a player fired a shot, specifying the angle and the exact frame when the shot occurred.

After this data is compiled, it is sent on-chain to be processed and validated. The blockchain checks for the validity of each move, ensuring no wall collisions or boundary violations occur. While characters can pass through each other, bullets are also handled both on-chain and in the client. The client simulates the game, but the blockchain ultimately ensures everything is correctly processed and holds authority over the final outcome.

Since Octoguns is turn-based, the only data stored on-chain is the result after all the move sets have been computed. This includes the final position of the characters and any bullets still in motion on the map. If a bullet hits a character, both the bullet and the character are dereferenced from the world and the game session contract, reflecting their removal from the active game. This seamless integration of on-chain mechanics ensures that Octoguns remains fully decentralized while maintaining a fluid and dynamic gameplay experience.