---
# System prepended metadata

title: Uncharted Waters Onchain
tags: [infinite seas]

---

# Uncharted Waters Onchain Game Design
revision 1/29 @SerenaTaN5
![image](https://hackmd.io/_uploads/ByF2u2iKa.png)


### Game Type: 

* MMORPG, Idle, Strategy, Simulation

### Design Principle: 

1. **Enhancing Composability**
   - Mods Marketplace
   - Layer Composability
2. **Building Alliances in Social Gaming**
   - Maximizing the ability to form alliances
     - Having a tab displaying existing alliances
3. **Item Development: Stats, Values, and Levels**
   - The higher the skill level, the lower the energy cost will be
4. **Automating Interactions with Blockchain Integration**
   - Idle game
   - How to achieve this with blockchain?
     - Use of a commit-and-reveal function
5. **Risk and Return Equalization**
   - The energy bar is refilled every 24 hours; all actions cost energy
   - Stake `xDAI` to claim ownership of an island. Unstake `xDAI` to stop playing the game.
   - The heavier the cargo you carry, the slower your movement speed will be



---

## Game Overview

* Players need to stake coins (`xDAI`) to gain ownership of an island
<img src="https://hackmd.io/_uploads/S1CTd2iK6.png" width=40% height=40%><img src="https://hackmd.io/_uploads/BJvR_2jKT.png" width=40% height=40%>
* Players can engage in woodcutting, fishing, mining, etc., to accumulate resources for crafting and cooking.
* Once they have equipped and crafted a ship, they can sail to other islands to engage in diplomatic activities (trade, combat, theft).
* They need to build a defense system to protect their land and avoid attacks or theft by other players. If the island's hitpoints fall to zero, the loot can be claimed by others.
* By establishing marketplaces, they can exchange resources with others to earn profits.

---

## Game Specification: Map and Resources Setup

## Overview

The game world consists of an infinite big grid, where each cell represents a hexagonal tile. The map is primarily composed of water tiles, with a few islands scattered throughout. Each island is rich in resources that players can collect and use for various in-game activities. 

## Map Generation

### Grid

- The map is infinitely big. 
- Each cell in the grid is a hexagonal tile.

### Water

- The default tile is a water tile, represented by the color blue.

### Islands

- The map contains 15 islands in every 100 x 100 grids 
- Each initial island is generated using a random walk algorithm, ensuring that all tiles in an island are interconnected.
- The minimum distance between any two island centers is 8 tiles.
- Each island has exactly 19 tiles.
- islands are expandable, tho each additional grid will resulting in more stakes. 

## Resources

### Types of Resources

1. **Base Resources**
    * Wood
   - Stone
   - Cotton
2. **Advanced Resources**
   - Iron
   - Coal
   - Copper
   - Uranium

### Resource Distribution

#### Base Resources

- Each island contains 3 ``base resources``
- 4 of the 15 generated island contains additional 1 ``advanced resource``
- The distribution of base resources is randomized but follows these constraints:
  - ~~Each type of base resource must appear at least 2 times but no more than 3 times on each island.~~

#### Advanced Resources

- Four islands will contain advanced resources.
- ~~Each of these islands will contain exactly 2 tiles of the same advanced resource.~~


### Tile Representation

#### Water Tile

- Represented by the color blue.
- Contains no resources.

#### Resource Tile

- Represented by various colors depending on the resource it contains.

<img src="https://hackmd.io/_uploads/BkbeFnjtp.png" width=50% height=50%>

  - Wood: Brown
  - Stone: Dark Grey
  - Cotton: Light Yellow
  - Iron: Light Grey
  - Coal: Black
  - Copper: Golden Brown
  - Uranium: Shiny Green

#### Empty Grid

- Represented by the color white.
- Contains no resources.
- Able to build in later stage

### Random Walk Algorithm

* Used to generate islands.
* Ensures that each island has exactly 19 tiles.
* Ensures that all tiles in an island are interconnected.
* If an island cannot be generated with the specified constraints, the algorithm will retry until it succeeds.

<img src="https://hackmd.io/_uploads/HJ8fK3sFp.png" width=60% height=60%>


---

## Game Specification: Player Action

- Each action causes `energy` - 1;
- All successful action causes the specific skill`xp` +  1; 
- After accumulating enough `xp`, the skill specific `level` + 1, which resulting less energy cost
- Energy bar will be refilled every 24 hrs

**``Mining``**: all the mined resources go to players ``inventory``. `Mining` skill `xp + 1`.~~inventory is a table with name, item color, and amount, can be show and collapse when click button. The inventory will update.~~

- ~~when player select the grid by single left click, add a effect on the grid. once they press "m" on keyboard, the resources start to mine~~!![image](https://hackmd.io/_uploads/Hy07Y3iKT.png)


**`Crafting/Smithing`**: players can craft items with existing receipts and suffcient resources in inventory, `crafting` skill `xp + 1`; 
* ship repairing (必须回城镇修复)

**`Woodcutting`**: players can cut woods. Each action will make the `woodcutting` skill `xp + 1`

**`Fishing`**: players can go fishing. Each action will make the `fishing` skill `xp + 1`

**`Cooking`**: players can go fishing. Each action will make the `cooking `skill `xp + 1` cooked food are used to add `Hitpoints`

~~**`Thieving`**: player can steal things from other players. Successful thieving will make `thieving skill xp + 1`~~

**`Sailing`**: player can sail from one place to another with crafted ships. Sailing will make `sailing xp + 1`

**`招募`**: 更高等级的水手，消耗的sailing能量越小

**`Building(later)`**: players can place buildings on their islands; buildings have different kinds

- **`Military building`**: building will auto attack enemies, once the enemies enter a given range
- **`House`**: growing population will need bigger housing unit over time
- **`Storage building`**: store excessive equipments
- **`Marketplace`**: allow players to buy and sell; 24 hrs open


<!-- 
**walkthrough**

In-game items can be traded with xDAI

1. 玩家pick一个土地 选择质押50个DAI

2. 质押DAI了之后，玩家就获得了土地

3. 玩家可以开采资源 - **采矿**，钓鱼，砍树

4. 以采矿的故事线举例，

   采矿 -> 铜 -> 锻造青铜装备

   采矿xp + 1; 铜 inventory + 1; 锻造 xp + 1

   能量 - 2;

   采矿xp 锻造xp 升级可以解锁更厉害的装备

5. 装备 -> ship; 装备 -> 城池
6. ship可以攻占城池 / 攻打舰队
7. 攻占城池可以获得城池产生的资源 / 攻打舰队可以获得之前质押的xDAI；xDAI的数量会累积在ship上
 -->
----
<!-- process：

每个人出生stake 获得一个岛，岛会有资源，根据时间来收获

通过资源可以建造船

船和岛都有相应的防御和攻击力

每个人最多有5个船，岛无限量

战斗：

每个人可以派船去攻打别人的船或者岛，如果对方在战斗中没血了，那么成功

如果是成功的，那么获得这个岛或者船

如果船到达上限，那么直接获得船所对应的资源

战斗时，会根据装备，技能等来决定

每天有体力限制，针对wallet。越多船，消耗能量越多

待解决：

攻打完之后，剩下的船的hp，会自动回复么，还是需要通过其他获得进行加血

战斗中扣血的流程是怎么样的？

玩家之间，是否可以联盟攻打其他人

攻打别人时，只能一个船打一个船，还是可以5个船一起出动打对面任意的船只。 -->

## Gameplay and More Specs
### 水手
* 招募可以获得等级越高的水手，等级越高的水手航行消耗更少能量
* 每一搜船有水手数量的要求
* 水手航行需要消耗食物（钓鱼->烹饪 or 种植）
* 水手缺少食物会死亡
* 如果食物耗尽，船失去拥有权，路人可以通过给船分配食物和水手claim拥有权
* 水手可以被交易

### 锻造系统

### 定制船体
中号船：
![Screenshot 2024-01-28 at 19.50.00 Medium](https://hackmd.io/_uploads/HkqeWs4c6.jpg)
小号船默认有3个货物仓库、2两个房间、1个船长室、两个大三角帆、空的船首、空的船尾
可以通过装备crafting，对船进行改造：
* 增加货物仓库（储物空间增加）
* 增加房间（水手数量增加）
* 改造成厨房/锻造台
* 把大三角帆改为不同的横帆斜帆和上帆（增加船的推进力）
* 在船首、船尾装备不同炮台（改变船的攻击力）
* 在船尾装备装甲（改变船的防御力）

#### 船的属性：
![Screenshot 2024-01-28 at 20.18.27 Medium](https://hackmd.io/_uploads/BkEVPoN9p.jpg)
（与图片相比有所改动，简化了属性）
船有小号船、中号船、大号船；小号船的房间数量少、可以装备的武器少；反之亦然。
船有以下属性：
* 耐久性/生命（每个船的使用寿命，可通过锻造修复）
* 装载量 （装载重量越大，航行速度越慢）
* 船员人数上限
* 船员人数下限
* 航行速度 （除了配备的风帆外，航行速度受到装载量、风向影响；如果船为舰队≥2,航行速度为舰队平均速度）
* 攻击力
* 攻击间隔时间
* 防御力

#### 船的编排
* 当玩家拥有≥2数量的船后，可以自制船的顺序；可以编排的顺序 1 - 3 - 1; 2 - 1 - 1; 1 - 1 - 1 - 1 - 1; 
* 在战斗模式中，阵首的船会先收到攻击，阵尾的船最后收到攻击；在相同列的船会拼摊伤害。

### 战斗系统
* 船的受攻击顺序：船的编排
* 船的攻击顺序：所有的船一起攻，每一条船的攻击间隔时间不同
* 受伤的船可以进行修复（锻造->回城修复）
* 生命归零的船包括穿上的水手、装备、货物直接丢失
* 可以进行逃跑（舰队航行速度）
* 允许多方协作：当有多方舰队在场，可以选择舰队攻击

### 交易系统
* 在城镇港口设置amm pool
    * 可以开不同物品的amm pool
* 在城镇港口设置order book
    * 自定义 buy / sell; 
    * 通过游戏内货物交易
* 交易筹码可以是一方/双方城镇的token

### 游戏货币
* 每个城镇可以发行自己的token，可以自定义每股对应数量和equity（token对应税收产值 -> 矿物和食物；可以设置equity时效）；
* 24小时为结算周期，可以开船来城镇领取税收（生产raw资源）
* token可作为贸易货币
* 当城镇被打败，城镇停止向原拥有者提供生产资源


### 气候设定 风向
* 风向每天变化；风向影响航行速度

### 城镇系统
#### 城镇的作用
* 城镇产生资源。城镇是玩家的出生地，玩家出生，就拥有所有权，城市有中心地，一旦中心地被攻破城市就被占领，城镇仓库洗劫一空, 原玩家失去城镇拥有权，从而不能产生更多的资源；
* 城镇可以建立amm市场
* 城镇有储存空间
* 城镇可以建立安防系统
#### 城镇的维持
* 更高的action等级能采更高级的矿、铸造更高等级的装备、钓更高等级的鱼、招募更好的水手...
* 更高等级的action需要城镇更多人口
* 城镇人口的增长需要充足的食物 （种植 or 钓鱼->烹饪）和时间

#### 城镇的攻占
* 舰队炮轰攻打城镇；首先收到攻击的是防守单位 - 城墙；其次是炮台大炮；再是城市中心
* 城市被洗劫之后人口减半（无法生产和原来同等的资源）；残血装备可修复；没有生命的装备不可修复

#### 城镇的防守
* 玩家可以在城镇里放置防御装置和攻击装置
* 如果地方玩家选择攻打，攻击装置在一定范围攻击范围自动攻击
* 在白名单内的船只可以停泊在城镇内庇护
### 门派系统

### 能量系统
* 每次action要消耗能量

### 游戏主体
* 一个钱包最多控制5艘船，但可以制造多余的船进行交易
* 每次action要消耗能量
* 一个玩家可以殖民多个城镇，一个玩家只能发行一种国债
* 当玩家歼灭一整支舰队可以获得该舰队所质押的token
* 游戏玩家可以随时退出游戏通过提取质押的方式，需要3天时间提取时间，3天内的时间不能死亡；提取完毕后，该玩家的游戏内assets变灰，被freeze，不再流通。如果有国债，必须提前归还完毕。

## Front end
### Graphic
* 无法抹去死亡痕迹，所以死亡船只留下印记

## Dev tools