# HordeSurvival 3D
A stylized third-person survival roguelite for the browser. Survive increasingly dangerous hordes, auto-attack weapons, collect XP, choose powerful upgrades, evolve weapons, fight elites and a phased boss — and build increasingly broken runs.
## Gameplay — Version 2
Full video with audio (MP4)
## تصاویری از محیط بازی ورژن 1
Game environment images from version 1.
 |
 |
**Play:** https://mohsen-niksirat.github.io/Horde_Survival_3D_Godot/ (after Pages is enabled)
Inspired by the gameplay philosophy of [HordeSurvival (Android)](https://github.com/mohsen-niksirat/HordeSurvival), rebuilt from scratch as an independent Godot 4 project.
## Features
- Third-person 3D arena combat, camera-relative movement, zero aiming
- **Standard run: survive 15 minutes for VICTORY** — or toggle **Endless** for infinite scaling
- **Campaign mode:** 8 story missions across 3 acts (Torchfall) with briefing cards, objective HUD, and palette-shifted arenas
- **14 base weapons** (incl. Void Lance, Soul Fire) + **6 evolutions** (Hellfire, Holy Bible, Aurora, Judgment, Thunderstorm, Void Reaver)
- 7 weapon synergies + relic synergy hooks (Inferno Band, Favored Fortune, Mobile Bulwark)
- **13 enemy archetypes** (drone→brood_keeper) + 8 modular elite abilities + one complete 3-phase boss
- **7 playable characters:** Mage free → Paladin (1 win) → Rogue (3 wins) → Cleric (2 wins) → Ranger (3 wins) → Stormcaller (5 wins) → Warden (6 wins)
- XP orbs with magnet pickup, level-ups with 3 rarity-colored choices, **13 passive items**
- Relics (rarity-weighted map pickups incl. Phoenix Feather revive), a pet (Dragon Welp), 2 active abilities (Meteor Strike, Time Freeze), plus an F-key dash with brief invincibility frames
- Combo system with XP multiplier (capped) and 6 visual tiers, **15 achievements** with gold rewards
- Threat-budget horde spawning, difficulty timeline, quality-tier entity caps
- Versioned meta save (gold, bests, wins, unlocks, achievements) that persists in the browser
- Responsive HUD (boss HP bar with phase tint, ability cooldowns); virtual joystick + touch camera
- Settings: UI scale, reduced VFX, damage numbers, quality tiers, screen shake, independent music/SFX mute, language (English / فارسی with RTL layout), in-game feedback link
- Kenney CC0 GLB heroes/enemies/weapons/skybox (see docs/ASSET_CREDITS.md); quality Very Low→Ultra + FPS counter
- **Android-ready:** ARM64 export preset, safe-area insets for notches, hardware back button routing, auto-pause + save flush on background, and a CI-built debug APK
- **Meta shop:** 9 permanent upgrades × 20 levels (Vitality, Might, Frenzy, Swiftness, Luck, Greed, Bulwark, Precision, Arsenal)
## Win / Unlock Roadmap
| Goal | Reward |
|---|---|
| Survive 15 min | VICTORY + 250 gold |
| 1 win | Unlock **Paladin** |
| 3 wins | Unlock **Rogue** |
| Achievements | Bonus gold (see in-game list) |
| Stormcaller | 5 wins (Lightning + Ember Lens) |
| Warden | 6 wins (Orbiting Shield + Iron Bark) |
## Recent polish (R/S/T series + After the Forge expansion)
- 15-minute victory ending + endless mode
- V16A: F-key dash (18 m/s burst, 0.25s i-frames, 2.5s cooldown) with HUD/touch button, career stats line in the menu, achievement progress bars, best combo/level persistence
- V20A perf pass: deferred menu panel builds, auto-quality startup grace, horde AI/animation LOD, weapon query reuse, XP-orb material recycle guard, throttled HUD boss bar/objective — smoother on weak hardware
- Void Lance → **Void Reaver** evolution, Hunter's Mark passive, extra synergies
- Character unlocks by wins, achievements panel (15), victory gold + interest
- Live boss HP bar, enrage aura, fan flash, elite rings/bursts/warnings
- Victory fanfare, combo tier toasts, phoenix revive toast
- Meta shop: 9 upgrades (incl. Bulwark, Precision, Arsenal slots)
- XP shard value tiers (gold = big XP), relic beacons, rarity toasts
- HUD win countdown, run phase, NEW BEST TIME, pause run stats
## Expansion — After the Forge
- **Act IV missions:** Shattered Observatory (storm hazards, 240s survive) + Hollow Grove (2·50 kills, healing sanctuary)
- **New heroes:** Stormcaller (5 wins) + Warden (6 wins) with starting passives
- **New enemies:** ember_runner, crystal_guard, broodling, brood_keeper (broodlings on death)
- **New passives:** Iron Bark, Ember Lens, Time Sand, Quartz Heart
- Web spawn budget + lifecycle guards (see `docs/EXPANSION_ROADMAP_FA.md`)
## How to Run Locally
1. Install [Godot 4.7+](https://godotengine.org/download) (project features pin `4.7`)
2. Open `project.godot` in the Godot editor
3. Press **F5** (Play)
## How to Export Web
1. In Godot: **Project → Export → Web** (preset included in `export_presets.cfg`)
2. Ensure the Web export templates are installed (Editor → Manage Export Templates)
3. Export to `build/web/index.html`
Or use the CI workflow (below) which does this automatically.
## How to Deploy to GitHub Pages
Deployment is automated via GitHub Actions (`.github/workflows/deploy-web.yml`):
1. Push to `main`
2. Enable **Settings → Pages → Source: GitHub Actions** (one time)
3. The workflow builds the Web export and deploys it to Pages
Manual URL after setup: `https://mohsen-niksirat.github.io/Horde_Survival_3D_Godot/`
## How to Export Android
Android is now a first-class target:
- An `Android` export preset ships in `export_presets.cfg` (ARM64, Compatibility renderer, landscape, immersive).
- CI builds a **debug-signed APK** on every push to `main` — see `.github/workflows/build-android.yml` and the `HordeSurvival3D-debug-apk` artifact.
- Mobile support: safe-area insets for notches/punch-holes, Android back button routing (pause in-game, step back in menus, confirm on the main menu), and auto-pause + immediate save flush when the app is backgrounded.
- Full instructions: [docs/BUILD_ANDROID.md](docs/BUILD_ANDROID.md).
Local build: install the Android build template (`Project → Install Android Build Template`), point Godot at your SDK/keystore in Editor Settings, then export with the `Android` preset.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md). Bug reports, balance notes, and PRs welcome.
**Feedback:** use the **SEND FEEDBACK** button in the in-game Settings menu, or
open an issue here:
**Changelog:** [CHANGELOG.md](CHANGELOG.md) · **Weapon balance table:** [docs/WEAPON_BALANCE.md](docs/WEAPON_BALANCE.md) · **Android build:** [docs/BUILD_ANDROID.md](docs/BUILD_ANDROID.md) · **Publish on itch.io:** [docs/PUBLISH_ITCH.md](docs/PUBLISH_ITCH.md)
## License
Code and project scripts: **MIT** (see [LICENSE](LICENSE)).
Third-party art/audio (Kenney, KayKit): **CC0** — see [docs/ASSET_CREDITS.md](docs/ASSET_CREDITS.md).
## Controls
| Action | Desktop | Mobile | Gamepad |
|---|---|---|---|
| Move | WASD / Arrows | Left virtual joystick | Left stick |
| Camera | Click to capture mouse, then move / Arrow keys | Right touch drag | Right stick |
| Ability 1 (Meteor) | Q | Button | Trigger |
| Ability 2 (Freeze) | E | Button | Trigger |
| Dash (brief i-frames) | F | Dash button | — |
| Fullscreen toggle | F11 or Alt+Enter | FS button (next to zoom) | — |
| Pause | Esc | — | Start |
| Debug overlay | F3 | — | — |
| Perf session log | F4 (dump at run end) | — | — |
## Architecture Overview
```
scenes/ bootstrap · main · menu · world · player · enemies · weapons · bosses · pickups · ui
scripts/ core · player · combat · enemies · spawning · weapons · abilities · items ·
progression · save · input · audio · performance · utilities
data/ weapons · enemies · passives · relics · abilities (all .tres data-driven)
web/ custom HTML shell (loading bar, Click-to-Play, WebGL fallback)
tests/ headless smoke + phase test suites (godot --headless --script tests/.gd)
```
Key systems:
- **Autoloads**: EventBus (signal hub), RunManager (run session), GameManager (state machine), InputManager (platform abstraction), PoolManager (deferred-release pooling), SaveManager (versioned JSON), AudioManager (procedural SFX), PerformanceManager (quality tiers + caps)
- **Per-run**: WaveManager (threat budget), EnemyManager (registry + queries), ProgressionManager (level-ups/evolutions), RelicSystem, ComboManager, AchievementSystem, AbilityController
- **Data-driven**: all content lives in `.tres` resources — new enemies/weapons/relics = new resource files
- **Combat pipeline**: single DamageEvent flow (crit → armor → status → death → loot → combo → achievements)
## Development
Phased development per `docs/ROADMAP.md`; design rationale in `docs/GAME_DESIGN.md`, `docs/ARCHITECTURE.md`, and reference analysis in `docs/EXISTING_GAME_ANALYSIS.md`.
Run all headless tests:
```powershell
godot --headless --path . --script res://tests/smoke_phase1.gd # (and test_phase2..10)
```