Build a fully playable Age of Empires-style real-time strategy game that runs in the browser, in a single self-contained HTML file (Three.js via CDN — full 3D, no pixel art).
Core loop:
- Start with a town center and a few villagers on a generated map.
- Villagers gather resources — wood, food, gold — and construct buildings.
- Train more villagers and soldiers; advance through ages that unlock stronger units.
- An enemy AI builds its own base and attacks. Win by destroying its base; lose if it destroys yours.
Controls: classic RTS — click to select units, drag to box-select, right-click to move, gather, or attack. Include a minimap and a resource bar.
Make it look like a real game: lighting and shadows, readable unit silhouettes, terrain with texture variety, smooth camera pan and zoom — not blobby placeholder geometry. If the full loop won't fit in one shot, scope it down but keep it genuinely playable. Return only the HTML.
…