ECS Part 1: Intro to Entity Component System
ECS Part 2: Building a Basic ECS
ECS Part 3: ECS Views and Iterators
ECS Part 4: ECS Missile Command

ECS Part 4: ECS Missile Command

Whatttt

Goals

Non-goals

Requirements

  • Random missiles fall from sky to destroy cities
  • Missiles spawn in random positions in the sky
  • Missiles target random cities
  • Player has multiple cities
  • Player loses when all cities are destroyed
  • Player has a number of missile launchers
  • Missile launchers fire towards the mouse cursor
  • Missiles detonate when they reach the cursor
  • Missiles explode in an expanding radius
  • Launchers have a set number of missiles at the beginning

Thinking With ECS

Class hierarchy

vs

just behaviors

Using ECS of course.

Built using Visual Studio 2022. SFML Resources in entity 0 Locking to 60 fps using SFML All systems run 60 hz Input actions into input states Input actions may come from SFML or pre-recorded

Classes Level Scene

General entities 0 - resources 1 - world 2 - player

Systems Resources: Rendering context Level info

Input: Cursor positioning On demand spawning (firing missiles)

General: Projectile Spawners (more of a util system than an actual system) Random spawner Position explosion Collision with projectile and explosion City destruction?

Movement: System for each projectile movement

Rendering: Renderers have to happen in an order Contrails Rendering projectiles (different renderers?) Rendering cities, land Rendering GUI

Detailed Design

Systems & Components

Alteranatives

Potential Enhancements

System phases We don’t have a way to have groups of systems run at different rates ex: fixed update 50 hz, rendering unlimited

Concurrency

History

Ramblings

Sometimes one needs to ramble and see where the idea goes