How We Built a Tower‑Defense Mini‑Game with EVA JS ECS for D2
During the D2 conference, the Taobao Interactive team created a fully featured tower‑defense mini‑game using the EVA JS ECS engine, detailing the entire workflow from concept and PRD to numeric balancing, asset creation, component‑system design, and rapid early‑stage development.
Game Planning
When the team learned their booth would be featured at D2, they seized the chance to develop a small tower‑defense game they had wanted to make for years. The concept was built around EVA heroes defending against slime monsters, with a simple yet complete set of mechanics.
Product Requirements
The product team drafted a PRD, balancing the need for clear specifications with the constraints of a short development window. The PRD defined attribute‑based weapon and enemy interactions and was signed off with a playful spirit.
Numeric Balancing
Balancing was handled by a dedicated numeric designer who created an initial spreadsheet of core values, then simplified it to deterministic parameters to reduce randomness.
Slime health
Slime movement speed
Slime attribute resistance
Weapon level
Weapon attack speed
Weapon upgrade cost
Weapon attribute attack value
EVA hero health
EVA hero funds
A minimal viable version was built to validate these numbers before full development.
Early Development Build
Using the EVA JS engine, which follows an ECS architecture, the core functionality was implemented in about eight hours. This prototype allowed rapid testing of the numeric model.
Art and Assets
Art assets were created in‑house to match the game’s whimsical style. Simple slime sprites and hero illustrations were produced, then uploaded to a CDN with preview capabilities for developers.
ECS in the Game
The game’s architecture was broken down into entities, components, and systems.
Entities
Objects visible on screen such as "Slime", "Weapon", and "Hero" are entities placed in a scene.
Components
Components store data for entities, for example:
Enemy component : health, speed, resistance, etc.
Weapon component : level, damage, cooldown.
Hero component : health, funds.
Map component : grid coordinates.
Wave component : wave index.
Animation component : animation assets.
Transform component : screen position.
Systems
Systems process component data each frame:
Map system : converts grid coordinates to transform positions.
Enemy system : handles movement, damage to heroes, and death.
Weapon system : calculates attacks on enemies.
Hero system : monitors hero health and defeat.
Wave system : checks wave progression and victory.
Animation system : plays animations.
Transform system : computes actual canvas coordinates.
Render system : draws the scene.
This ECS breakdown shows how components and systems interact, with solid lines indicating parent‑child relationships and dashed lines showing data dependencies. The order of system execution is crucial for correct gameplay.
Final Product
After polishing the balance and adding the final assets, the game was released on the D2 Space EVA booth. A single upgrade path leads to victory, inviting players to discover the hidden winning strategy.
For deeper technical details, visit the team’s blog.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
