sankaralingamv / solana-civ

Home Page:https://solciv.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solana Civ

A fully on-chain game built on Solana. SolanaCiv is inspired by Civilization games. In SolanaCiv, players manage their civilization by building cities, farming resources, recruiting units, researching new technologies, trading with each other, and fighting off barbarians. The game is turn-based. Players can perform many actions (transactions) per turn: move units, build, fight, upgrade, research and more.

Demo: https://solciv.com

Audit

Program is audited by sec3 X-ray scanner. Report is available here: sec3-report.pdf

The reported issue is false positive, as the unchecked account is needed for withdrawals from burner to any Solana address.

Run locally

anchor build && anchor test

Game design

Initialization

  • When a player joins, frontend generates a burner wallet and funds it with devnet SOL. Session keys will be used in mainnet for a smooth gaming experience.
  • Program initializes the civilization with a starting amount resources, and 3 units: Settler, Builder and Warrior. Resources and units are soulbound to a game session and cannot be transferred to a different game session.

Turn mechanics

  • At the start of each turn, players receive (or lose) resources based on their current buildings and units to maintain.
  • Players can then choose actions for their workers, soldiers and cities. Every action is an on-chain transaction. Players can research new technologies, construct buildings, recruit units, move units on the global map, send soldiers to fight barbarians.

Construction

  • Building a structure costs production points that are generated by every city. Some structures can be built only by workers on the global map, other directly in the city.
  • Construction time depends on the production params of the specific city.

Resource gathering

  • Resource generation occurs at the beginning of each turn, affected by the number and type of buildings and units.

Resources

  • πŸͺ™ GOLD - currency for trading, building and maintenance.
  • 🌽 FOOD - needed for recruiting and healing of units.
  • πŸͺ΅ LUMBER, STONE - required for constructing buildings and to repair damaged citites.
  • IRON - required to recruit advanced military units (e.g. swordsmen)
  • Science points and Production points generated by cities and corresponding buildings.

Technology tree | Science

Military Tree

Technology Research Points Unlocks
Archery 15 πŸ§ͺ Archer
Iron Working 21 πŸ§ͺ Swordsman, Forge
Medieval Warfare 30 πŸ§ͺ Crossbowman, WallMedieval
Gunpowder 42 πŸ§ͺ Musketman, WallRenaissance
Ballistics 60 πŸ§ͺ Rifleman
Tanks and Armor 80 πŸ§ͺ Tank, WallIndustrial

Science & Economy Tree

Technology Research Points Unlocks
Writing 5 πŸ§ͺ Library
Education 7 πŸ§ͺ School
Economics 10 πŸ§ͺ Bank, Market
Academia 14 πŸ§ͺ University
Astronomy 18 πŸ§ͺ Observatory
Capitalism 22 πŸ§ͺ StockExchange

Production & Agriculture Tree

Technology Research Points Unlocks
Agriculture 6 πŸ§ͺ Granary, Mill
Construction 8 πŸ§ͺ Wall, Bakery
Industrialization 12 πŸ§ͺ Factory
Electrical Power 16 πŸ§ͺ EnergyPlant
Modern Farming 20 πŸ§ͺ Supermarket

Units

Image Unit Movement Melee HP Cost Maintenance
Worker 2 0 ❀️ 1 🌽 50 0
Scout 3 βš”οΈ 10 ❀️ 100 🌽 30 0
Warrior 2 βš”οΈ 20 ❀️ 100 🌽 40 πŸͺ™ 1
Swordsman 2 βš”οΈ 35 ❀️ 100 🌽 90 πŸͺ™ 2

Buildings

Image Building Production Cost Maintenance Construction time
Barracks Allows the recruitment of soldiers πŸͺ΅ 30 πŸͺ™ 2 5 turns
Wall Adds ❀️ 50 to the city πŸͺ΅ 150 πŸͺ™ 1 9 turns
Market πŸͺ™ 3 per turn πŸͺ΅ 120 0 7 turns
Farm 🌽 3 per turn 1 worker 0 0
Lumber Mill πŸͺ΅ 3 per turn 1 worker 0 0

Fights with barbarians

  • The likelihood of encountering barbarians increases with each turn.
  • Players can send soldiers to fight barbarians.
  • If successful, players earn GEMS that can be withdrawn to a personal wallet
  • If unsuccessful, soldiers can die.

End of the game

  • Player wins when all enemies are defeated.
  • Player can restart the game with a new generated map at any time.

Roadmap & future expansions

  • Multiplayer mechanics, match-making
  • Enhanced in-game reward system, DEX
  • Assets store for third-party content creators and developers
  • Mobile app (the game is already playable on mobile via web browser)
  • New game mechanics:
    • Alliances and diplomacy
    • A greater variety of land tiles, resources, units, buildings, and technologies
    • Distinct nations
    • Culture and tourism mechanics
    • Story mode
    • And much more, this is only the beginning ;)

About

https://solciv.com


Languages

Language:Rust 81.3%Language:TypeScript 18.7%