# Selda Chronicles Game Dynamics

This document describes the playable systems, economy, multiplayer model, progression loops, and reward logic for Selda Chronicles.

## Game Overview

Selda Chronicles is a retro action-adventure MMO prototype set in the Chainlands of Selda. Players create a character, explore tile-based maps, fight monsters and bosses, complete NPC quest chains, gather resources, and redeem in-world effort for SELDA through a marketplace exchange.

The current game supports guest play, wallet-bound profiles, server-backed multiplayer presence, global/local chat, marketplace resource claims, homes, companions, inventory, level progression, boats, fishing, woodcutting, and multiple regions.

## Player Identity

Players can enter in two modes:

- Guest mode: no wallet required. Guests can explore, fight, gather resources, fish, cut wood, and complete local gameplay, but they cannot save progress or claim SELDA rewards.
- Wallet mode: a connected Solana wallet binds the character profile, save data, inventory, resources, rewards, and anti-abuse checks.

Supported wallet providers in the current browser flow include Phantom, Jupiter, Solflare, Talisman, auto-detected Solana wallets, and a dev wallet option for testing.

## Character Creation

At the landing page, players create a character with:

- Name
- Body color
- Accent color
- Starting weapon

Starting weapon choices:

- Sword: balanced melee weapon.
- Bow: ranged combat style.
- Magic Staff: scroll-like magical projectile style.

The character name and level are shown above the local player and remote multiplayer sprites.

## Core Controls

Desktop:

- WASD or arrow keys: move.
- Space: attack.
- E: talk, open, interact, enter buildings, use marketplace.
- Q: use scroll.
- Tab: cycle weapon.
- R: cycle scroll.
- F: cycle relic.
- M: shift realm.
- Plus/minus: zoom.

Mobile:

- On-screen d-pad for movement.
- On-screen buttons for interact, slash, scroll, and zoom.

## Multiplayer Model

Multiplayer is server-backed through WebSocket.

The server owns the live multiplayer state:

- Player presence.
- Player room assignment.
- Nearby remote player broadcasts.
- Chat routing.
- Marketplace claim validation.
- Earned-resource claim eligibility.

Normal map rooms are capped at 30 players. If a 31st player enters the same map, the server creates another room for that map.

The marketplace hub is shared and uncapped. Players near the marketplace are moved into the shared `hub:marketplace` room so everyone can gather there.

Players can see other players in the same room as remote sprites with name and level labels.

## Chat

The game has two chat scopes:

- Global chat: sent to every connected player on the server.
- Local chat: sent only to players in the same room or hub.

Chat appears in the in-game multiplayer panel.

## Maps And Regions

The main starting region is the Dawn Realm around Solrest Village. Players progress through quests and bosses to unlock additional regions.

Current major spaces include:

- Overworld and Solrest Village.
- Interiors such as smithy, archive, inn, carpenter house, market house, and other village buildings.
- Dungeons and boss spaces.
- Greenwood Expanse.
- Azure Reef.
- Stormpeak Kingdom.
- Glassdune Empire.

The first-map boss chain gates the later world regions.

## Movement And Navigation

Players move on a tile-based map. Collision blocks walls, trees, stones, and water unless a special system allows traversal.

The spawn logic moves the player to a safe walkable tile if a saved or generated position would place them on water or blocked terrain.

## Boats And Water

Players should not spawn on water. Boats allow seamless water traversal:

- The player can walk onto a boat.
- Once aboard, movement navigates the boat.
- The player can leave the boat when it reaches shore.
- Fishing is available while on a boat.

## Fishing

Fishing produces fish as an in-world resource. Fish can be sold in the marketplace for SELDA through the same runway exchange model as gold and wood.

Fishing has an action cooldown. After a successful catch, the player must wait before fishing again, which prevents rapid repeated key presses from farming fish.

Current marketplace base unit:

- 3 fish = 1 base reward unit.

## Woodcutting

Players can cut trees to gather wood logs. Logs are added to inventory/resources and can be sold at the marketplace.

Cut trees regrow after one hour. The cut state is saved for the player profile, then restored automatically when the regrowth timer expires.

Current marketplace base unit:

- 5 logs = 1 base reward unit.

## Gold

Gold is the main in-world reward resource. Players can earn gold through:

- Monster drops.
- Boss kills.
- Treasure chests.
- NPC quest rewards.
- Some progression events.

Current marketplace base unit:

- 10 gold = 1 base reward unit.

## Inventory

Inventory tracks weapons, scrolls, relics, keys, resource items, boss drops, and utility items.

Examples include:

- Weapons: Rune Blade, Moon Bow, Aether Staff, Validator Dagger, Rootcleaver Axe, Pearl Trident, Summit Maul, Glass Spear.
- Moon Bow attacks are ranged arrows, not melee swings.
- Aether Staff attacks are ranged neon green light bolts, not staff swings. Bolts can also cut trees and collect wood.
- Scrolls: Validator Scroll, Gravebind Scroll, Blockward Scroll, Rootsnare Scroll, Abyssal Wave Scroll, Frostpeak Scroll, Sunflare Scroll.
- Relics: Grave Crown, Block Core, Wisp Heart, Root Crown, Leviathan Pearl, Avalanche Plate, Scorpion Lens, elemental crowns.
- Utility items: Lantern, Mirror Seed, Rootkey, Bubblebreath Spell, Froststep Boots, Sunveil Cloak.
- Resources: Gold, fish, logs.

Equipped items are highlighted in the inventory panel.

## Combat

Players fight monsters with the active weapon and can use scrolls or relics once unlocked.

Combat progression includes:

- Basic monster fights.
- Sentinel encounters.
- Boss fights.
- World boss fights.
- Blood Moon events with boosted danger and drops.

Defeating enemies gives XP and can drop gold. Bosses can award unique weapons, relics, scrolls, quest progress, and larger gold rewards.

## Level And XP

Players gain XP by defeating monsters and completing progression activities. Level and XP are displayed in the game UI next to the main resource indicators and in the menu.

Level increases player power through strike potency and progression status.

## Quests

NPCs provide real objectives instead of random flavor-only dialogue. Quest types include:

- Speak to a named NPC.
- Retrieve an item from a specific building or marked area.
- Bring a required amount of gold, fish, or wood.
- Kill a required number of monsters.
- Defeat a boss.
- Find a scroll, relic, key, or map item.
- Return to the quest giver for reward completion.

Rewards can include:

- Gold.
- Items.
- Healing.
- Unlocks.
- Progression flags.
- Quest completion.
- Access to new regions or dungeons.

Quest reward value should outweigh the effort required.

## NPC Intel

NPCs are expected to give actionable information:

- Where to go.
- What item to find.
- Which resource count is required.
- Which monster or boss must be defeated.
- Which building, chest, shelf, or road contains the next clue.
- What reward the player receives after returning.

## Marketplace

The marketplace is the main conversion point for in-world resources into SELDA.

The current public build marks the exchange as opening shortly while SELDA reward settlement is tested. Client and server claim paths reject payouts until the exchange is reopened.

Players must connect a wallet to claim SELDA. Guests can gather resources but cannot claim token rewards.

Exchange base units:

- 10 gold = 1 base unit.
- 3 fish = 1 base unit.
- 5 logs = 1 base unit.

The server validates marketplace claims when multiplayer is connected. It checks that the wallet is not a guest identity, throttles claims, and only pays against server-tracked earned resources.

## Reward Runway Formula

SELDA payouts use a conservative runway model.

The current model uses:

- Reward vault balance.
- Seven-day runway target.
- Floor of 50 active players.
- Daily action weight estimate.
- Clamped multiplier.

The multiplier is calculated from available vault budget divided by expected daily activity. This keeps payouts frugal when activity rises or the vault is low.

## Anti-Cheat Rules

The game should not trust client-submitted rewards.

Current prototype protections:

- Server validates marketplace claim requests.
- Server tracks earned gold, fish, and logs separately from browser-local state.
- Server enforces claim throttling.
- Server rejects guest wallet claims.
- Server clamps resource amounts per earn event and claim.
- Server applies movement sanity checks to reject obvious teleport jumps.

Production requirements:

- Server-authoritative monster state.
- Server-authoritative quest state.
- Server-authoritative fishing and woodcutting.
- Persistent database ledger.
- Wallet signature authentication.
- Idempotent payout records.
- Rate limits by wallet, IP, and device/session.
- Fraud scoring for abnormal earning paths.

## SELDA Payout Settlement

Basic SELDA payouts do not require Helius. A production service can use standard Solana RPC to sign and submit SPL token transfers from a server treasury wallet.

Required payout infrastructure:

- SELDA mint address.
- Server treasury keypair.
- Associated token account handling.
- Persistent payout ledger.
- Idempotency keys.
- Confirmation tracking.
- Wallet signature login.
- Claim rate limits.

Helius is optional but useful for:

- Reliable RPC infrastructure.
- Parsed transaction history.
- Webhooks.
- Enhanced token and NFT indexing.
- Operational observability.

## Treasury And Sink Loops

SELDA is spent on in-game systems such as:

- Forging items.
- Building homes.
- Staking.
- Progression preparation.
- Future marketplace actions.

The design intent is that in-game SELDA spending can feed the treasury and future reward vault activity.

## Homes

Players can buy land plots and build homes. Homes are player-owned progression markers and future social/economic anchors.

Home systems can later support:

- Decoration.
- Storage.
- Crafting stations.
- Guild rooms.
- Marketplace stands.
- Social spawn points.

## Staking

Players can stake SELDA in the prototype. Staking increases status and can affect rewards or odds in certain systems.

Current examples:

- Staking adds renown.
- Staking can improve forge odds or reward calculations where enabled.

## Forging

The forge lets players spend SELDA to attempt equipment upgrades or acquire gear. Forge outcomes can be influenced by staking, progression, or rare items.

## Companions

Players can unlock or toggle companions. Companions follow the player and can contribute small bonuses in reward or combat systems where enabled.

## World Events

World events change the state of the world for a limited time.

Current example:

- Blood Moon Raid: monsters surge and drops can be boosted.

## Save Model

Guest mode does not save.

Wallet mode saves locally under the connected wallet key in the current prototype. Multiplayer transient state such as remote players, chat, room IDs, and sockets is not saved.

Production should move saves to a server database while keeping local guest play as a fallback.

## Current Prototype Boundaries

The current build implements live multiplayer presence, rooms, chat, shared market hub, and server-validated marketplace claims. It is not yet a fully server-authoritative MMO for all combat, enemies, quests, and map events.

Production should migrate these systems server-side:

- Enemy spawning and health.
- Damage and hit validation.
- Quest completion.
- Chest opening.
- Fishing results.
- Woodcutting results.
- Boss loot.
- Chests are per-player rewards: once a player opens a chest, that same profile cannot open it again, but other players can still open their own copy of that chest and receive the same reward.
- Marketplace settlement ledger.
- Persistent player inventory.

## GitBook Structure Suggestion

Recommended GitBook sections:

- Overview
- Getting Started
- Wallets And Guest Mode
- Character Creation
- Controls
- Multiplayer
- Chat
- World And Regions
- Combat
- Quests
- Inventory
- Fishing
- Woodcutting
- Marketplace
- SELDA Rewards
- Anti-Cheat And Payouts
- Homes And Treasury
- Roadmap
