Estfor Kingdom

PaintSwap
Paint Swap Finance
Published in
9 min readMar 31, 2023

--

Get ready to embark on an epic adventure and fight for glory and treasure in the Estfor Kingdom. Ready your web3 wallets, and be prepared to join the battle!

What Is Estfor Kingdom?

Estfor Kingdom is a medieval fantasy idle multiplayer browser-based blockchain game on the (Fantom Foundation) Fantom Opera network. The alpha test version of the game will go live with 12 individual skills for users to train and level up, over 250 unique items to collect, craft, smith and more.

Each item including the player character in Estfor Kingdom is an NFT (ERC1155) which means they have a unique id on the blockchain, can be transferred and sold without restrictions on secondary marketplaces. These will be two NFT collections: players and items.

Each action can be set to run from 1 hour to 24 hours. There can be up to 3 actions queued which can split up the 24 hours, this gives allows idle progression of your character. Through these actions, you will gain XP towards your character levels as well as item rewards from those activities. From chopping trees for logs to fighting monsters and collecting random loot you can choose your own path on this magical adventure.

Compete with all other players to become the top of the high scores list overall and in specific skills.

Skills intertwine with certain skills needed to create items needed for other skills.

Alpha Testing

We announced that holders of certain NFT collections on Fantom would get access to our Alpha version of the game. These wallets will be able to access the alpha version of the game which is now released! The alpha version will have separate contracts & NFTs compared to the main live game but you will be able to test, play and help balance new features moving forward on the alpha version. We may even have a special treat for those who get involved in alpha testing. To see the full list of addresses who can access the alpha version please see this spreadsheet:
https://docs.google.com/spreadsheets/d/1lYhltsnwThbZIYX51lnnJwwunq9faNwc/

The World

Starting Area map

In the Woodlands on Roust, far behind the tallest mountain known to humanity, there is a simple colony. They’ve lived in harmony with nature and magic for centuries, though something has recently upset that balance. Far off, from Unnder Ravine, smoke rises. It is prophesied that this smoke will mean an age of villainy and heroism. One devil and one saviour will rise from the dark shroud that has slipped across the land. Who is the Monster and who is the Hero? Only time will tell.

Heroes

Upon creating your character ($FTM gas cost only) you are given the choice of several amazing creatures from the Estfor world. Choose wisely which hero you want to play as, it could be the choice between the devil & saviour. Each character will start with some skills slightly higher levels than others based on their description.

Training

Training your skills is an important part of the Estfor adventure, many skills have level requirements and tool requirements to complete the actions. Gathering resources and completing actions will grow your XP and increase your levels to unlock new actions. All through a simple easy-to-use user interface.

Skills

Upon launch the game will have 12 skills:
- Melee
- Magic
- Defence
- Health
- Woodcutting
- Firemaking
- Fishing
- Cooking
- Mining
- Smithing
- Crafting
- Thieving

Each with its own unique way of training and leveling up of the skill. With intertwining requirements to craft, make, smith and use a variety of items you’ll either need to train up multiple skills or work together with other players to unlock the full range of items in game. The maximum level in the current version is 100 in each of the skills.

Game Shop

The in-game shop of Estfor Kingdom is linked to the $BRUSH token from PaintSwap. Users can sell items from their inventories to the game shop for BRUSH instantly, and some items can be bought from the game shop for BRUSH. When selling items there is a weighted value assigned to all items that exist. Depending on the “pool” of BRUSH the shop currently holds, that decides how much each item is worth! Make sure you hold onto your items until the best price comes! A minimum of 100 of each item must exist before they can be sold to the shop to prevent new items being immediately worth too much.

When buying items (such as boosts) 50% of the $BRUSH is immediately burnt and the rest goes into the pool for seller. In addition there is a 2.5% royalty when users buy items or players from secondary marketplaces (such as PaintSwap). This is used to buy $BRUSH from the Spooky Swap FTM-BRUSH LP and add it all to the in-game pool.

Gameplay

As mentioned above you can queue up skills to be trained as long as you have the resources and equipment needed. You can set between 1 hour to 24 hours per skill up to a maximum of 24 hours total. This allows you to chop some trees for 8 hours, go fishing for another 8 then go battle some monsters for another 8 hours (or any combinations that add up to 24). This is all done through one simple transaction to keep gas costs low and optimise gameplay. Allowing you to play the game not only with a small amount of time but also not at a great expense.

Random Rewards

Some skills including combat will have random rewards. To keep this truly random we are making use of ChainLink oracles where every 24 hours someone can worship the oracle to generate new random numbers.

These random numbers are only used after the player’s actions have been completed; this makes it deterministic, efficient & un-gameable. Every day at 00:00 UTC a new set of random numbers are requested and retrieved to be used to calculate the loot for the previous day's actions.

Three random words are chosen per day via ChainLink oracles and for actions which require a lot of randomness “rolls” the previous five days of random numbers can be XOR’ed with the new unpredictably chosen random numbers from the ChainLink VRF Oracle to give access to 15 words of 256-bits each. These can then be sliced up into 16-bit sections (maximum number of 65535) which gives up to 240 unique rolls per action. These are keccak256 hashed with the skill end time and the player id to ensure that no 2 users will have the same chance of getting the equivalent randomness.

This is then tied into the action random rewards which have thresholds set based on rarity. If the random slice is low enough you will get the reward + the more common rewards.

For example:

Random chance illustration

Let's say we have an action of killing a monster. Bone has a 50000/65535 chance of dropping upon killing the monster. Bronze Bar has a 32787/65535 chance and finally, Bronze Pickaxe has a chance of 10000/65535. We then grab out 16-bit section to roll a random number. If it were to land on 64,000 we’d get nothing as a drop. If it was to land on 45,000 we’d get a Bone. If it was to land on 30,000 we’d get a Bone & a Bronze Bar and finally, if it was to land on 9,000 we’d get a Bone, a Bronze Bar & a Bronze Pickaxe. For most actions which have random rewards, each hour completed of the actions is a roll, for combat it is each each monster killed for which there can be many in an hour.

Daily Rewards

Everyone likes free stuff right? As long as you connect to the game and queue up an action every day you will get a reward for that day. Hit seven days in a row then you get a weekly bonus reward on day 7! But don’t worry if you miss a day, you can still claim the following days just not the bonus item and then can try again next week. The week start is not relative to each player, it always starts on Monday 00:00 UTC (Between Sunday night & Monday Morning).

Leaderboard

Train to become the best, choose to master a single skill or be the best overall! You can even compare yourself to other players skill for skill to see who is the best.

Multiple Characters

Each wallet can have multiple characters held or minted to it. However, only one character can be active at any one time performing tasks. So it does not make sense to have many players on a single wallet, if you wish to train multiple characters then they must be done on separate wallets.

Discord Bot

We are also releasing a discord bot that allows you to check the leaderboards and fetch information about your player and other players characters. This will be open source and available for anyone to run, but we will also be running a version on our discord.
https://github.com/PaintSwap/estfor-discord-bot

Wiki

We’ve spun up a wiki and added some basic information there. However, we’d love for the community to get involved and submit their own findings and information about the game as it is discovered. We may even incentivize the best contributors!
https://wiki.estfor.com/index.php/Main_Page

Developers rejoice!

We have a variety of libraries & tools available to help with ecosystem development of the game.

Estfor Definitions

A library for Estfor Kingdom with types and constants available for Javascript, TypeScript, and AssemblyScript /WebAssembly programming languages.

The items in this library will allow you to interact with Estfor Kingdom via:

  • Vanilla JS applications
  • React, Angular, and other front-end frameworks
  • NodeJS / Typescript back end services
  • AssemblyScript / WebAssembly for use with The Graph Protocol’s web3 indexing

The npm library is available here: https://www.npmjs.com/package/@paintswap/estfor-definitions

The source code available here:
https://github.com/PaintSwap/estfor-definitions

Smart contracts

The core of the game is decided by the decentralized smart contracts on the Fantom blockchain. These have all been verified on ftmscan:

World = 0xfe93dbf15b733024f67e5a11a7c87401cd951bdc
Shop = 0x30e37152cdde1720be35a2ebc8c799809c4acda9
RoyaltyReceiver = 0x430fe699f1468d19176d4697c237e4e8712b1822
ItemNFT = 0x5220cbe203cbff2b8257ba231859dcbfdd69da53
PlayerNFT = 0x6a92745fbb3c1bad2c6074b53396ab0e7abb8ba9
PlayersLibrary = 0xcc17dc0e82072372635602c9ef7db7710ad8b382
PlayersQueueActions = 0xee111c111368a0362b268f4e27d7e1679d232f3d
PlayersProcessActions = 0xa02433b3eb5cfeb12bdcd08ef3f4e3acb0a216be
PlayersRewards = 0x7e83c4db27e3342afea79bdf1195248d635c9571
Players = 0xbd0d3fb6123ed252620c696c7d91caeb25c8a0f9

The entire smart contract codebase is also available completely open sourced here for developers to check out, review, and contribute:

https://github.com/PaintSwap/estfor-contracts

API Docs

Full API documentation for all indexed data is available here:
https://api-docs.estfor.com

API documentation

Discord bot

Extend the discord bot yourself with custom commands suitable for your own clan and host in your private discord if you want! Source code available for our bot: https://github.com/PaintSwap/estfor-discord-bot

Estfor Kingdom

I bid you farewell, and may the winds of destiny carry you to lands of adventure and prosperity.

--

--