terminus-game 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. terminus_game-0.1.0/.github/workflows/ci.yml +30 -0
  2. terminus_game-0.1.0/.github/workflows/release.yml +112 -0
  3. terminus_game-0.1.0/.gitignore +18 -0
  4. terminus_game-0.1.0/LICENSE +21 -0
  5. terminus_game-0.1.0/PKG-INFO +137 -0
  6. terminus_game-0.1.0/README.md +99 -0
  7. terminus_game-0.1.0/product-backlog/BACKLOG.md +831 -0
  8. terminus_game-0.1.0/product-backlog/epic-01-foundation.md +447 -0
  9. terminus_game-0.1.0/product-backlog/epic-02-game-engine.md +1000 -0
  10. terminus_game-0.1.0/product-backlog/epic-03-server-networking.md +501 -0
  11. terminus_game-0.1.0/product-backlog/epic-04-tui-client.md +725 -0
  12. terminus_game-0.1.0/product-backlog/epic-05-game-balance.md +205 -0
  13. terminus_game-0.1.0/product-backlog/epic-06-persistence.md +174 -0
  14. terminus_game-0.1.0/product-backlog/epic-07-visual-overhaul.md +513 -0
  15. terminus_game-0.1.0/product-backlog/epic-08-testing.md +206 -0
  16. terminus_game-0.1.0/product-backlog/epic-09-packaging.md +120 -0
  17. terminus_game-0.1.0/product-backlog/epic-10-stretch-goals.md +136 -0
  18. terminus_game-0.1.0/pyproject.toml +61 -0
  19. terminus_game-0.1.0/terminus/__init__.py +1 -0
  20. terminus_game-0.1.0/terminus/__main__.py +198 -0
  21. terminus_game-0.1.0/terminus/client/__init__.py +1 -0
  22. terminus_game-0.1.0/terminus/client/api.py +178 -0
  23. terminus_game-0.1.0/terminus/client/app.py +189 -0
  24. terminus_game-0.1.0/terminus/client/art.py +302 -0
  25. terminus_game-0.1.0/terminus/client/screens/__init__.py +1 -0
  26. terminus_game-0.1.0/terminus/client/screens/build.py +214 -0
  27. terminus_game-0.1.0/terminus/client/screens/catastrophe.py +322 -0
  28. terminus_game-0.1.0/terminus/client/screens/colony.py +321 -0
  29. terminus_game-0.1.0/terminus/client/screens/connection_lost.py +127 -0
  30. terminus_game-0.1.0/terminus/client/screens/help.py +81 -0
  31. terminus_game-0.1.0/terminus/client/screens/leaderboard.py +159 -0
  32. terminus_game-0.1.0/terminus/client/screens/lobby.py +318 -0
  33. terminus_game-0.1.0/terminus/client/screens/main_menu.py +80 -0
  34. terminus_game-0.1.0/terminus/client/screens/market.py +195 -0
  35. terminus_game-0.1.0/terminus/client/screens/setup.py +135 -0
  36. terminus_game-0.1.0/terminus/client/screens/workers.py +92 -0
  37. terminus_game-0.1.0/terminus/client/theme.tcss +451 -0
  38. terminus_game-0.1.0/terminus/client/widgets/__init__.py +20 -0
  39. terminus_game-0.1.0/terminus/client/widgets/ascii_art_panel.py +53 -0
  40. terminus_game-0.1.0/terminus/client/widgets/building_card.py +118 -0
  41. terminus_game-0.1.0/terminus/client/widgets/countdown_timer.py +88 -0
  42. terminus_game-0.1.0/terminus/client/widgets/notification_toast.py +100 -0
  43. terminus_game-0.1.0/terminus/client/widgets/resource_bar.py +101 -0
  44. terminus_game-0.1.0/terminus/client/widgets/sparkline_chart.py +88 -0
  45. terminus_game-0.1.0/terminus/client/widgets/worker_slider.py +153 -0
  46. terminus_game-0.1.0/terminus/config.py +171 -0
  47. terminus_game-0.1.0/terminus/data/__init__.py +1 -0
  48. terminus_game-0.1.0/terminus/data/achievements.json +58 -0
  49. terminus_game-0.1.0/terminus/data/buildings.json +182 -0
  50. terminus_game-0.1.0/terminus/data/catastrophes.json +449 -0
  51. terminus_game-0.1.0/terminus/data/loader.py +156 -0
  52. terminus_game-0.1.0/terminus/data/locations.json +42 -0
  53. terminus_game-0.1.0/terminus/data/specializations.json +46 -0
  54. terminus_game-0.1.0/terminus/dev/__init__.py +1 -0
  55. terminus_game-0.1.0/terminus/dev/__main__.py +18 -0
  56. terminus_game-0.1.0/terminus/dev/console.py +387 -0
  57. terminus_game-0.1.0/terminus/screenshots/Screenshot 2026-05-15 200436.png +0 -0
  58. terminus_game-0.1.0/terminus/server/__init__.py +1 -0
  59. terminus_game-0.1.0/terminus/server/app.py +670 -0
  60. terminus_game-0.1.0/terminus/server/engine.py +1226 -0
  61. terminus_game-0.1.0/terminus/server/models.py +288 -0
  62. terminus_game-0.1.0/terminus/server/persistence.py +191 -0
  63. terminus_game-0.1.0/test_engine.py +59 -0
  64. terminus_game-0.1.0/tests/__init__.py +0 -0
  65. terminus_game-0.1.0/tests/conftest.py +46 -0
  66. terminus_game-0.1.0/tests/test_api_validation.py +99 -0
  67. terminus_game-0.1.0/tests/test_balance_data.py +243 -0
  68. terminus_game-0.1.0/tests/test_buildings.py +92 -0
  69. terminus_game-0.1.0/tests/test_catastrophe.py +87 -0
  70. terminus_game-0.1.0/tests/test_catastrophe_selection.py +66 -0
  71. terminus_game-0.1.0/tests/test_engine_fixes.py +160 -0
  72. terminus_game-0.1.0/tests/test_integration.py +66 -0
  73. terminus_game-0.1.0/tests/test_load.py +84 -0
  74. terminus_game-0.1.0/tests/test_market.py +127 -0
  75. terminus_game-0.1.0/tests/test_multiplayer.py +106 -0
  76. terminus_game-0.1.0/tests/test_persistence.py +100 -0
  77. terminus_game-0.1.0/tests/test_reconnection.py +78 -0
  78. terminus_game-0.1.0/tests/test_resources.py +90 -0
  79. terminus_game-0.1.0/tests/test_scoring.py +71 -0
  80. terminus_game-0.1.0/tests/test_sprint7.py +200 -0
  81. terminus_game-0.1.0/tests/test_sprint8.py +209 -0
  82. terminus_game-0.1.0/tests/test_state_machine.py +73 -0
  83. terminus_game-0.1.0/tests/test_validation_fuzz.py +97 -0
  84. terminus_game-0.1.0/tools/__init__.py +1 -0
  85. terminus_game-0.1.0/tools/balance/__init__.py +1 -0
  86. terminus_game-0.1.0/tools/balance/_smoke_test.py +31 -0
  87. terminus_game-0.1.0/tools/balance/constraints.py +199 -0
  88. terminus_game-0.1.0/tools/balance/report.py +145 -0
  89. terminus_game-0.1.0/tools/balance/simulator.py +352 -0
  90. terminus_game-0.1.0/tools/balance/strategies.py +246 -0
  91. terminus_game-0.1.0/tools/build_exe.py +52 -0
  92. terminus_game-0.1.0/tools/load_test.py +153 -0
  93. terminus_game-0.1.0/uv.lock +764 -0
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Run tests
30
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,112 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.11", "3.12", "3.13"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - run: |
22
+ pip install --upgrade pip
23
+ pip install -e ".[dev]"
24
+ - run: pytest tests/ -v --tb=short
25
+
26
+ build-wheel:
27
+ needs: test
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+ - name: Build wheel and sdist
35
+ run: |
36
+ pip install build
37
+ python -m build
38
+ - uses: actions/upload-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/
42
+
43
+ build-exe:
44
+ needs: test
45
+ strategy:
46
+ matrix:
47
+ include:
48
+ - os: windows-latest
49
+ artifact: terminus-windows.exe
50
+ exe-path: dist/terminus.exe
51
+ - os: ubuntu-latest
52
+ artifact: terminus-linux
53
+ exe-path: dist/terminus
54
+ - os: macos-latest
55
+ artifact: terminus-macos
56
+ exe-path: dist/terminus
57
+ runs-on: ${{ matrix.os }}
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - uses: actions/setup-python@v5
61
+ with:
62
+ python-version: "3.12"
63
+ - name: Install dependencies
64
+ run: |
65
+ pip install --upgrade pip
66
+ pip install -e ".[build]"
67
+ pip install -e .
68
+ - name: Build executable
69
+ run: pyinstaller terminus.spec --clean --noconfirm
70
+ - uses: actions/upload-artifact@v4
71
+ with:
72
+ name: ${{ matrix.artifact }}
73
+ path: ${{ matrix.exe-path }}
74
+
75
+ release:
76
+ needs: [build-wheel, build-exe]
77
+ runs-on: ubuntu-latest
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+ - uses: actions/download-artifact@v4
81
+ with:
82
+ path: artifacts/
83
+
84
+ - name: Organize release files
85
+ run: |
86
+ mkdir -p release-files
87
+ cp artifacts/dist/* release-files/
88
+ cp artifacts/terminus-windows.exe/terminus.exe release-files/terminus-windows.exe
89
+ cp artifacts/terminus-linux/terminus release-files/terminus-linux
90
+ cp artifacts/terminus-macos/terminus release-files/terminus-macos
91
+
92
+ - name: Create GitHub Release
93
+ uses: softprops/action-gh-release@v2
94
+ with:
95
+ generate_release_notes: true
96
+ files: release-files/*
97
+ env:
98
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99
+
100
+ publish-pypi:
101
+ needs: [build-wheel]
102
+ runs-on: ubuntu-latest
103
+ environment: pypi
104
+ permissions:
105
+ id-token: write
106
+ steps:
107
+ - uses: actions/download-artifact@v4
108
+ with:
109
+ name: dist
110
+ path: dist/
111
+ - name: Publish to PyPI
112
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ *.egg
9
+ .eggs/
10
+ *.db
11
+ *.sqlite
12
+ .env
13
+ .venv/
14
+ venv/
15
+ env/
16
+ .idea/
17
+ .vscode/
18
+ *.spec
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Terminus Dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: terminus-game
3
+ Version: 0.1.0
4
+ Summary: Multiplayer CLI survival strategy game
5
+ Project-URL: Homepage, https://github.com/kushal-DL/terminus
6
+ Project-URL: Repository, https://github.com/kushal-DL/terminus
7
+ Project-URL: Issues, https://github.com/kushal-DL/terminus/issues
8
+ Author: Terminus Dev
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: cli,game,multiplayer,strategy,survival,terminal,tui
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Framework :: FastAPI
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Games/Entertainment :: Simulation
23
+ Classifier: Topic :: Games/Entertainment :: Turn Based Strategy
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: aiosqlite<1.0,>=0.20
26
+ Requires-Dist: fastapi<1.0,>=0.100
27
+ Requires-Dist: httpx<1.0,>=0.24
28
+ Requires-Dist: pydantic<3.0,>=2.0
29
+ Requires-Dist: textual<1.0,>=0.40
30
+ Requires-Dist: uvicorn[standard]<1.0,>=0.20
31
+ Requires-Dist: websockets<14.0,>=11.0
32
+ Provides-Extra: build
33
+ Requires-Dist: pyinstaller>=6.0; extra == 'build'
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
36
+ Requires-Dist: pytest>=7.0; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Terminus
40
+
41
+ Multiplayer CLI survival strategy game. Manage your settlement, allocate workers, build structures, and survive catastrophes — all in your terminal.
42
+
43
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)
44
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
45
+
46
+ ## Install
47
+
48
+ ### From PyPI (recommended)
49
+
50
+ ```bash
51
+ pip install terminus-game
52
+ ```
53
+
54
+ ### From GitHub
55
+
56
+ ```bash
57
+ pip install git+https://github.com/kushal-DL/terminus.git
58
+ ```
59
+
60
+ ### From source (development)
61
+
62
+ ```bash
63
+ git clone https://github.com/kushal-DL/terminus.git
64
+ cd terminus
65
+ pip install -e ".[dev]"
66
+ ```
67
+
68
+ ### Pre-built executable
69
+
70
+ Download the latest release for your platform from [GitHub Releases](https://github.com/kushal-DL/terminus/releases) — no Python installation required.
71
+
72
+ ## Prerequisites
73
+
74
+ - **Python 3.11 or newer** (for pip install methods)
75
+ - **Terminal with Unicode support** (Windows Terminal, iTerm2, most Linux terminals)
76
+ - **cloudflared** (optional — only needed for `--public` mode to share games over the internet)
77
+
78
+ ## Run
79
+
80
+ ```bash
81
+ terminus # Launch the game (starts server + TUI client)
82
+ terminus --public # Launch with public URL via cloudflared tunnel
83
+ terminus --server-only # Run headless server (for dedicated hosting)
84
+ terminus --port 9090 # Use a custom port (default: 8080)
85
+ terminus --verbose # Enable debug logging
86
+ ```
87
+
88
+ ## Quick Start
89
+
90
+ 1. Run `terminus` — select **"Create Game"**
91
+ 2. Choose your colony location and specialization
92
+ 3. Share the displayed URL with other players (or use `--public` for internet access)
93
+ 4. Other players run `terminus` → **"Join Game"** → paste the URL
94
+ 5. Host starts the game once all players are ready
95
+ 6. **Survive 5 catastrophes** over ~45 minutes. Highest score wins!
96
+
97
+ ## Gameplay
98
+
99
+ - **Allocate workers** across farming, mining, research, construction, defense, and medicine
100
+ - **Build structures** (farms, walls, hospitals, labs, warehouses, housing) up to level 3
101
+ - **Trade resources** at the market — prices fluctuate each tick
102
+ - **Prepare for catastrophes** — the watchtower gives early warnings
103
+ - **Manage morale** — starvation and damage reduce it; good management boosts production
104
+
105
+ ## Dev Console (Admin Tools)
106
+
107
+ For debugging and testing, Terminus includes a dev console TUI:
108
+
109
+ ```bash
110
+ # Start the game server first
111
+ terminus --server-only
112
+
113
+ # In another terminal, launch the dev console
114
+ TERMINUS_DEV_MODE=1 python -m terminus.dev --server http://127.0.0.1:8080
115
+ ```
116
+
117
+ The dev console provides: real-time state inspection, resource overrides, catastrophe controls, and instant building completion.
118
+
119
+ ## Development
120
+
121
+ ```bash
122
+ # Install with dev dependencies
123
+ pip install -e ".[dev]"
124
+
125
+ # Run tests
126
+ pytest tests/ -v
127
+
128
+ # Run balance simulator
129
+ python -m tools.balance.simulator --preset standard --games 10
130
+
131
+ # Run load test
132
+ python tools/load_test.py --players 20 --duration 60
133
+ ```
134
+
135
+ ## License
136
+
137
+ MIT — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,99 @@
1
+ # Terminus
2
+
3
+ Multiplayer CLI survival strategy game. Manage your settlement, allocate workers, build structures, and survive catastrophes — all in your terminal.
4
+
5
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)
6
+ ![License: MIT](https://img.shields.io/badge/license-MIT-green)
7
+
8
+ ## Install
9
+
10
+ ### From PyPI (recommended)
11
+
12
+ ```bash
13
+ pip install terminus-game
14
+ ```
15
+
16
+ ### From GitHub
17
+
18
+ ```bash
19
+ pip install git+https://github.com/kushal-DL/terminus.git
20
+ ```
21
+
22
+ ### From source (development)
23
+
24
+ ```bash
25
+ git clone https://github.com/kushal-DL/terminus.git
26
+ cd terminus
27
+ pip install -e ".[dev]"
28
+ ```
29
+
30
+ ### Pre-built executable
31
+
32
+ Download the latest release for your platform from [GitHub Releases](https://github.com/kushal-DL/terminus/releases) — no Python installation required.
33
+
34
+ ## Prerequisites
35
+
36
+ - **Python 3.11 or newer** (for pip install methods)
37
+ - **Terminal with Unicode support** (Windows Terminal, iTerm2, most Linux terminals)
38
+ - **cloudflared** (optional — only needed for `--public` mode to share games over the internet)
39
+
40
+ ## Run
41
+
42
+ ```bash
43
+ terminus # Launch the game (starts server + TUI client)
44
+ terminus --public # Launch with public URL via cloudflared tunnel
45
+ terminus --server-only # Run headless server (for dedicated hosting)
46
+ terminus --port 9090 # Use a custom port (default: 8080)
47
+ terminus --verbose # Enable debug logging
48
+ ```
49
+
50
+ ## Quick Start
51
+
52
+ 1. Run `terminus` — select **"Create Game"**
53
+ 2. Choose your colony location and specialization
54
+ 3. Share the displayed URL with other players (or use `--public` for internet access)
55
+ 4. Other players run `terminus` → **"Join Game"** → paste the URL
56
+ 5. Host starts the game once all players are ready
57
+ 6. **Survive 5 catastrophes** over ~45 minutes. Highest score wins!
58
+
59
+ ## Gameplay
60
+
61
+ - **Allocate workers** across farming, mining, research, construction, defense, and medicine
62
+ - **Build structures** (farms, walls, hospitals, labs, warehouses, housing) up to level 3
63
+ - **Trade resources** at the market — prices fluctuate each tick
64
+ - **Prepare for catastrophes** — the watchtower gives early warnings
65
+ - **Manage morale** — starvation and damage reduce it; good management boosts production
66
+
67
+ ## Dev Console (Admin Tools)
68
+
69
+ For debugging and testing, Terminus includes a dev console TUI:
70
+
71
+ ```bash
72
+ # Start the game server first
73
+ terminus --server-only
74
+
75
+ # In another terminal, launch the dev console
76
+ TERMINUS_DEV_MODE=1 python -m terminus.dev --server http://127.0.0.1:8080
77
+ ```
78
+
79
+ The dev console provides: real-time state inspection, resource overrides, catastrophe controls, and instant building completion.
80
+
81
+ ## Development
82
+
83
+ ```bash
84
+ # Install with dev dependencies
85
+ pip install -e ".[dev]"
86
+
87
+ # Run tests
88
+ pytest tests/ -v
89
+
90
+ # Run balance simulator
91
+ python -m tools.balance.simulator --preset standard --games 10
92
+
93
+ # Run load test
94
+ python tools/load_test.py --players 20 --duration 60
95
+ ```
96
+
97
+ ## License
98
+
99
+ MIT — see [LICENSE](LICENSE) for details.