Skip to content

Release v1.0.0: Godot 4 HTML5 port#53

Open
Peolite001 wants to merge 4 commits into
Bitcoindefi:mainfrom
Peolite001:feature/32-godot-tilemap
Open

Release v1.0.0: Godot 4 HTML5 port#53
Peolite001 wants to merge 4 commits into
Bitcoindefi:mainfrom
Peolite001:feature/32-godot-tilemap

Conversation

@Peolite001

Copy link
Copy Markdown

[EPIC] Godot port: reemplazar demos canvas JS con Godot 4 HTML5
Closes #32

Description

This PR implements the complete Godot 4 HTML5 port of the hexagonal strategy game "Human vs Bots", replacing the legacy canvas/JS prototype (demo/zemeroth-demo/game.js) with a maintainable Godot 4 engine build while preserving all existing Web3/ZK functionality.

What Changed

Engine Migration: Replaced the canvas/JS game engine with Godot 4.3 HTML5 export
Hex Tilemap System: Implemented native Godot hexagonal tilemap with 5 biome support (plains, forest, hill, water, desert)
Core Game Systems:
GameState autoload — global game state management
TurnManager — commit/reveal turn system with action queuing
EconomyManager — food/production/science/gold resources
EventBus — signal-based event architecture
Gameplay Features:
Unit movement with hex A* pathfinding
Combat system with terrain defense modifiers and counter-attacks
City building and territory capture
Procedural map generation using noise algorithms
UI/UX:
CIV-style HUD with resource panel, minimap, unit info
Camera controls: zoom (mouse wheel), pan (drag), edge scroll
Unit animations and tweening
Particle effects for combat and environment
Audio system: background music and SFX with separate buses
Web3 Bridge: JavaScriptBridge
integration connecting Godot to the existing JS layer:
StellarGameService — wallet connection, Soroban contract calls
ZK proof export/verify (unchanged JS layer)
CI/CD: GitHub Actions workflow for automated HTML5 build and deploy to GitHub Pages

Architecture

[Godot 4 HTML5 build]
├── Scenes / Scripts (GDScript)
│ ├── Autoloads: GameState, TurnManager, EconomyManager, EventBus
│ ├── HexTileMap ←→ MapGen (noise)
│ ├── Units / Cities
│ └── HUD / Camera
└── JavaScriptBridge
└── JS Layer (sin cambios)
├── StellarGameService (wallet, contratos Soroban)
└── ZK proof export / verify

Sub-Issues Resolved

Sub-issue Description Status
#godot-setup Proyecto Godot y estructura de carpetas
#godot-tilemap Tilemap hexagonal con biomas
#godot-turn-system Sistema de turnos commit/reveal
#godot-web-bridge HTML5 export + JavaScriptBridge
#godot-signals Bus de eventos y señales
#godot-autoloads Singletons globales
#godot-economy Economía: comida/producción/ciencia/oro
#godot-combat Sistema de combate
#godot-pathfinding Pathfinding en hexágonos
#godot-mapgen Generación procedural de mapa
#godot-hud HUD estilo CIV
#godot-camera Cámara: zoom, pan, edge scroll
#godot-animations Animaciones y tweening de unidades
#godot-particles Efectos de partículas
#godot-audio Sistema de audio: música y SFX
#godot-ci CI/CD: build HTML5 y deploy

Type of Change

[ ] Bug fix
[x] New feature
[ ] Breaking change
[ ] Documentation update
[x] Refactor (major engine migration)
[ ] Performance improvement

Files Added

godot/
├── project.godot
├── export_presets.cfg
├── src/
│ ├── autoload/
│ │ ├── GameState.gd
│ │ ├── TurnManager.gd
│ │ ├── EconomyManager.gd
│ │ ├── EventBus.gd
│ │ ├── Web3Bridge.gd
│ │ └── AudioManager.gd
│ ├── map/
│ │ ├── HexMap.gd
│ │ ├── MapGenerator.gd
│ │ └── HexCell.gd
│ ├── units/
│ │ ├── Unit.gd
│ │ ├── UnitFactory.gd
│ │ ├── Pathfinder.gd
│ │ └── CombatSystem.gd
│ ├── structures/
│ │ ├── Structure.gd
│ │ └── StructureManager.gd
│ ├── camera/
│ │ └── GameCamera.gd
│ ├── ui/
│ │ ├── HUD.gd
│ │ ├── Minimap.gd
│ │ ├── UnitInfoPanel.gd
│ │ ├── ResourcePanel.gd
│ │ ├── TurnPanel.gd
│ │ └── WalletPanel.gd
│ └── utils/
│ ├── HexMath.gd
│ └── NoiseGenerator.gd
├── scenes/
│ ├── main.tscn
│ ├── game.tscn
│ └── [sub-scenes]
└── assets/
├── terrain/
├── units/
├── structures/
└── ui/

Files Modified

README.md — Updated with Godot setup instructions
Makefile — Added godot-export target
.github/workflows/godot-ci.yml — Added CI/CD pipeline

Files Unchanged (Archived)

demo/human-vs-bots/ — Legacy JS demo (retained for reference)
demo/civ-lite/ — Alternative prototype (retained)
demo/zemeroth-demo/ — Original canvas prototype (retained)

@leocagli

Copy link
Copy Markdown
Collaborator

Hi @Peolite001 — the SonarCloud Code Analysis gate is failing on this release PR. Check the dashboard — for a Godot HTML5 port it's likely flagging generated/vendored build output; you may want to add those paths to sonar.exclusions. Once the gate is green this is good to merge. 🙏

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EPIC] Godot port: reemplazar demos canvas JS con Godot 4 HTML5

2 participants