Realm Game Engine Development

NOTE: This isn’t a proposal that I would be able to complete as a solo developer. Instead this is an idea for how DFK / Kingdom Studios could implement a “game engine” that they themselves will consume and maintain as the game matures on CV, but allow other app developers to leverage in order to bring new worlds to the DFK chain.


Building an application on DFK Chain is difficult. What if there was a set of smart contracts / APIs collectively known as a “Realm Game Engine” that could be used to implement your own DFK-like game on the DFK chain. Games like this would be known as “Realms”.

The game engine and potential backend tooling would manage the creation of balanced mobs, quests and rewards based on a chain utility token called KINGDOM (name TBD).

Each Realm instance would need to be launched or deployed with a review process. That game instance cannot be changed until the developer(s) released a new version for review. In this way the game can be validated for balance and other issues prior to being made publicly available.

Things like: Crystal emissions, leveling and summoning are a feature of CV and not included in the Realms projects. They are treated as gaming worlds that have their own look and feel. They implement a map, story line, quests, mobs and reward paths.

Each Realm is a self contained ecosystem worth x amount of KINGDOM tokens based on the # of transaction and daily players (proposed – needs discussion). As users perform more game engine transactions the Realm gain more and more KINGDOM tokens.

The actual minting mechanic of KINGDOM is still TBD and probably needs a fair bit of discussion.

Part of the essential game engine would allow Realms to burn KINGDOM tokens to generate mobs, quests and rewards – these are known as “game interactions”. Hopefully, this can be managed as a smart contract based on a preset list designed by the developers of the Realm.

Players in the Realm compete to “win” these game interactions. Each interaction has a known time window once the first player completes it. This allows for several others to finish before closing and splitting whatever reward is made available.

These rewards can either be kept for inherent value in the current Realm or auctioned for the common exchange unit which could be used in CV (currently raffle tickets?)

Map data is persistent and heroes stay where they are unless moved which uses stamina. Map location system would be built into the engine to allow for travel enhancements at higher levels:

  • Horse / pet travel
  • Teleportation (Wizard? Or pay for transport)
  • Etc

While HP and Mana would be tracked individually in each Realm(?) – stamina should be shared. I think of hero-based stamina as a basic chain utility resource by which heroes interact with the chain. They can use stamina for professions, training, movement, etc. If stamina is shared across the DFK chain, then there is a higher value to have more hero NFTs. Stamina naturally increases as level increases giving the hero more functionality over time.

Rough draft of how the KINGDOM token utility would work: It’s a tier-based system where consuming KINGDOM would enable 1 through 10 tiers of game interactions:

  • Tier 1 is geared to levels 1 to 9 and would consume 1-9 KINGDOM
  • Tier 2 is geared to levels 10 to 19 and would consumes 10-99 KINGDOM
  • Tier 3 consumes 100-999 KINGDOM
  • Tier 4 consumes 1,000-9,999 KINGDOM
  • Tier 5 consumes 10,000-99,999 KINGDOM
  • Tier 6 consumes 100,000-999,999 KINGDOM
  • Tier 7 consumes 1,000,000-9,999,999 KINGDOM
  • Tier 8 consumes 10,000,000-99,999,999 KINGDOM
  • Tier 9 consumes 100,000,000-999,999,999 KINGDOM
  • Tier 10 is geared to levels levels 90 to 99 and would consume 1,000,000,000 KINGDOM

The idea behind the tiers is that higher level quests / rewards are limited by KINGDOM token stored in the Realm. There might be limits on the amount of interactions at various tiers so that a healthy amount of tier 1 events are spawned, but they don’t consume all of the Realm’s KINGDOM.

Examples of engine interactions

  • Goblin encampment spawn (tier 1?)
  • Small dragon nest (tier 5)
  • Random dungeon spawn in the hills (tier 8)
  • Random uncommon dungeon spawn in the mountains (harder to reach?) (tier 10)
  • Etc

In a perfect world, the combat system currently being implemented would also be made available to the game engine. In this way, Heroes could immediately jump into action in the Realms in the same way as CV. And perhaps a reference set of smart contact / mobs.

Skill concept for performing game interactions:

  • Moving a stuck object
  • Unlocking a chest
  • Spotting a trap

Skill rolls can be generated by combining 3 of the native Hero stats to form a baseline and then adjusted by difficulty. Examples:

  • Push: STR, STR, END
  • Unlock: DEX, DEX, LUK
  • Trap Spotting: LUK, LUK, WIS
  • Dodge: AGI, AGI, DEX
  • Dancing: DEX, AGI, END
  • Jumping: STR, AGI, DEX

As mentioned earlier, the DFK team could implement a “Realm Health Check” which runs a series of automated tests against every aspect of a Realm’s interaction with the game engine and reports any balance issues. (Not sure how difficult this would be to implement).

Value Proposition

  • The Realm Gaming Engine concept would allow for scaling the DFK experience across multiple different development studios. Story lines, art and interactions can be different while enforcing game balance that adds value to the hero ecosystem.
  • Hero NFTs gain more functionality and MORE heroes can be used at once.
  • Added JEWEL burn from more transactions on the DFK chain
  • Interesting PvE concepts around racing to beat game interactions
  • With enough enforcement of the game engine, Realms might have places where professions and skill use could be implemented. IE: Have to travel to the mountains to forage for level 50 quests. This might be more dangerous due to game interactions which can spawn in the area. Etc.

Team Information

Currently just myself: Software programmer with 25 years of experience across a variety of languages and technologies. Still learning Solidity and other block chain technologies.

Requests from DFK Team

This is where things become a bit muddy compared to a normal Kingdom Building Program proposal. I’m asking that the team consider building out CV gaming in a specific way so that the smart contracts and APIs can be easily consumed by 3rd party developers to introduce many other gaming worlds on the DFK chain.

This is mostly just an idea and I would be happy to pitch in an help where I can, but obviously the toll is heavy on Kingdom Studios. And so is the reward (IMHO).

Connection to DFK Game and DFK Blockchain

At some point in the future a zone similar to the portal or docks can be designed to allow users to jump into other Realms. There are serious concerns about adverse effects on the DFK economy when it comes to ideas like this. The game engine concept was the only solution that I felt could address that concern.

Timeline with Milestones


MVP milestone would center around an agile reference text-based UI + map to navigate that implements smart contracts for testing the game engine:

  • Verify process for Realms to accumulate KINGDOM token
  • Game interaction spawning at simulated levels of KINGDOM token
  • Movement / travel contracts
  • Combat contracts
  • Skill usage contracts
  • Game interaction completion interface
  • Reward claiming interface

Long Term Plan


External Links


File Uploads


1 Like

Feel free to contact me at Bless#9326 on Discord for Collaboration



Hello Hashcode,
Thank you for the writeup. I will share it with my team to get their thoughts. After that we may post it in the community brainstorming category to see if others have feedback or may want to contribute.

1 Like

For clarity, I’m getting more and more familiar with the dev docs:

It’s clear that Kingdom Studios is doing everything right.

At some point in the future, combat and travel contracts will probably be added there and I would probably have everything I need to start a Proof-of-Concept.

Keep up the great work!

1 Like