some basics

Michael Zhang 2023-12-08 15:31:15 -06:00
parent 3e01300d99
commit 6eb0d9ee5b
4 changed files with 79 additions and 4 deletions

8
Empire.md Normal file

@ -0,0 +1,8 @@
# Empire
The universe consists of a bunch of empires. Empires can be controlled by either
humans or AI.
## Star systems
Empires may control several star systems.

@ -1,7 +1,3 @@
### epoch
A single iteration of a multiplayer world. When an epoch is started, no civilizations except primitives will exist. Players will need to spawn in with a fresh starter empire, and build up from there. The lengths of epochs should be **pre-determined** and is recommended to last around 1-3 months of wall-clock time.
### primitive civilizations
Low-level AI civilizations that exist for users to be able to plunder and take over. These civilizations will scale over time and get buffed along with the players in its **progression ring**

31
Metrics.md Normal file

@ -0,0 +1,31 @@
# All metrics
- empire.(id).energyStock : number
## Effects
```ts
interface Effect {
affectedGlob: string;
operation: "add" | "mul";
// TODO: Make this actually a union
rate: string; // For add
amount: number; // For mul
timeStart: number;
duration: number | "indefinite";
}
```
Examples:
```ts
const alloyProductionUpkeep: Effect = {
affectedGlob: "$empire.alloyStock",
operation: "add",
rate: "1/s",
timeStart: <...>,
duration: "indefinite",
};
```

40
State.md Normal file

@ -0,0 +1,40 @@
# State
The entire current and future (to an extent) state of the game is deterministic.
## Core State vs. Derived State
Think of derived state as a snapshot of what the core state produces at a
specific point in time. Here are some examples:
| Core state | Derived state |
| -------------------------------- | ------------------------------------ |
| empire alloy production rate | how much alloys does the empire have |
| where is this fleet trying to go | where is the location of this fleet? |
The core state _always_ has a **start time** and a **decision time** (see below)
between which _all_ derived state can be interpolated. As a result, no
computation occurs on the server until a decision time happens.
## Decision Times
A `DecisionTime` is essentially a timestamp at which point some kind of
non-determinism is introduced. `DecisionTime`s are generated from either:
- The `CoreState` itself, including AI decisions
- A player makes an action that's received by the server
At this point, an RNG external to the `CoreState` (i.e not part of an
individual AI's decision making) is used to make some important decisions about
the game (i.e battle results, etc.) in order to create a new `CoreState`.
## Probabilistic Values
---
Testing mermaid:
```mermaid
graph TD
Start --> End
```