Domain Model
Presentation Model
Physics model
AI model
Networking model
Chessmaster 2000 (1986)
Chessmaster 11 (2007)
Chessmaster 2000 | Chessmaster 11 | |
---|---|---|
Domain model | Board, pieces, time, game rules | Board, pieces, time, game rules |
Presentation model | CGA Sprites, beep sounds | Animated 3D objects, 3D sounds |
Physics model | None | Rigidbody engine |
AI model | David Kittinger's engine | King engine |
Networking model | None | Sending move commands |
Heroes of Might and Magic
Summary
Entity
Component
System
Attribute
Root
Maze
GameSystem
BoxBehavior
PacmanBehavior
GhostBehavior
By modifying the container object's state
By direct calls
By using a message broker
Unicast
Multicast
Broadcast
1 | public interface ICustomMessageTarget : IEventSystemHandler |
2 | { |
3 | // functions that can be called via the messaging system |
4 | void Message1(); |
5 | void Message2(); |
6 | } |
7 | |
8 | public class CustomMessageTarget : MonoBehaviour, ICustomMessageTarget |
9 | { |
10 | public void Message1() |
11 | { |
12 | // handle message |
13 | } |
14 | |
15 | public void Message2() |
16 | { |
17 | // handle message |
18 | } |
19 | } |
20 | |
21 | // sending message |
22 | ExecuteEvents.Execute<ICustomMessageTarget>(target, null, (x,y) => x.Message1()); |
Artemis framework
Atomic Game Engine
Unity
Unreal Engine
Godot Engine
1 | // new component |
2 | public class Health extends Component { |
3 | public int health; |
4 | public int damage; |
5 | } |
6 | |
7 | // new archetype |
8 | Archetype dragonArchetype = |
9 | new ArchetypeBuilder() |
10 | .add(Flaming.class).add(Health.class).build(world); |
11 | |
12 | public class MovementSystem extends EntityProcessingSystem { |
13 | public MovementSystem() { super(Aspect.all(Position.class, Velocity.class)); } |
14 | } |
15 | |
16 | // create new transmuter |
17 | this.transmuter = new EntityTransmuterFactory(world) |
18 | .add(FrozenFlame.class).remove(Flaming.class).build(); |
19 | |
20 | // apply transformation to entity |
21 | this.transmuter.transmute(entity); |
1 | // RocketComponent |
2 | void OnTriggerEnter2D (Collider2D col) { |
3 | // If it hits an enemy... |
4 | if(col.tag == "Enemy") { |
5 | // ... find the Enemy script and call the Hurt function. |
6 | col.gameObject.GetComponent<Enemy>().Hurt(); |
7 | // Call the explosion instantiation. |
8 | OnExplode(); |
9 | // Destroy the rocket. |
10 | Destroy (gameObject); |
11 | } |
12 | // Otherwise if it hits a bomb crate... |
13 | else if(col.tag == "BombPickup") { |
14 | // ... find the Bomb script and call the Explode function. |
15 | col.gameObject.GetComponent<Bomb>().Explode(); |
16 | |
17 | // Destroy the bomb crate. |
18 | Destroy (col.transform.root.gameObject); |
19 | |
20 | // Destroy the rocket. |
21 | Destroy (gameObject); |
22 | } |
23 | } |
EnTT
Entitas
A-Frame
ECSY
1 | var world = new World(); |
2 | world |
3 | .registerSystem(MoveSystem) |
4 | .registerSystem(RendererSystem); |
5 | |
6 | class MoveSystem extends System { |
7 | execute(delta, time) { |
8 | this.queries.moving.results.forEach(entity => { |
9 | let pos = entity.getMutableComponent(Position); |
10 | pos.x += entity.getComponent(Velocity).x; |
11 | }); |
12 | } |
13 | } |
The most important thing about each strategy game is Primalex - when a soldier with a bucket of paint repaints buildings to your faction, and then the enemy cannot get into themScore Reviewers