Chessmaster 2000 (1986)
Chessmaster 11 (2007)
Chessmaster 2000 | Chessmaster 11 | |
---|---|---|
View model | Simple sprites | Animation states, themes, skins,... |
Networking model | None | Player's info, time, board pieces |
Core model | Board pieces, time, AI algorithm | Board pieces, time, AI algorithm |
Physics model | None | Collision checks for correct placement |
AI model | David Kittinger's engine | King engine |
Heroes of Might and Magic I
The Longest Journey Saga (1999-2016)
Dune (1992)
Belegost (1989)
Geometry Wars (2004)
Linked together, components get things done
// Object-centric
interface GameObject {
id: number;
position: Vec3;
rotation: Quaternion;
health: number;
attack: number;
}
// Property-centric
interface GameObjects {
ids: number[];
positions: Vec3[];
rotations: Quaternion[];
healths: number[];
attacks: number[];
}
The overall behavior of a particular game object is fully determined
by the aggregation of its components (and attributes).
class ATOMIC_API Object : public RefCounted {
public:
Object(Context* context);
/// Return type info.
virtual const TypeInfo* GetTypeInfo() const = 0;
/// Handle event.
virtual void OnEvent(Object* sender, StringHash eventType, VariantMap& eventData);
/// Subscribe to a specific sender's event.
void SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler);
/// Unsubscribe from a specific sender's event.
void UnsubscribeFromEvent(Object* sender, StringHash eventType);
/// Send event with parameters to all subscribers.
void SendEvent(StringHash eventType, VariantMap& eventData);
/// Return execution context.
Context* GetContext() const { return context_; }
/// Return global variable based on key
const Variant& GetGlobalVar(StringHash key) const;
/// Set global variable with the respective key and value
void SetGlobalVar(StringHash key, const Variant& value);
/// Return subsystem by type.
Object* GetSubsystem(StringHash type) const;
... };
class ATOMIC_API Node : public Animatable {
public:
/// Register object factory.
static void RegisterObject(Context* context);
virtual bool Load(Deserializer& source, bool setInstanceDefault = false);
virtual bool Save(Serializer& dest) const;
void SetName(const String& name);
void SetTransform(const Vector3& pos, const Quaternion& rot, const Vector3& scale);
bool LookAt(const Vector3& target, const Vector3&, TransformSpace space = TS_WORLD);
void SetEnabled(bool enable);
/// Set enabled state on self and child nodes.
void SetDeepEnabled(bool enable);
void MarkDirty();
Component* CreateComponent(StringHash type, CreateMode mode, unsigned id = 0);
Node* Clone(CreateMode mode = REPLICATED);
void AddListener(Component* component);
void RemoveListener(Component* component);
};
public sealed class GameObject : Object {
public static extern GameObject CreatePrimitive(PrimitiveType type);
public unsafe T GetComponent<T>();
public T[] GetComponents<T>();
public extern Transform transform { get; }
public extern void SetActive(bool value);
public extern string tag { get; set; }
public static extern GameObject FindGameObjectWithTag(string tag);
public void SendMessage(string methodName, object value);
public void BroadcastMessage(string methodName, object parameter);
public Scene scene {get;}
public Component rigidbody {get;}
public Component rigidbody2D {get;}
public Component camera {get;}
public Component light {get;}
public Component animation {get;}
public Component renderer {get;}
public Component audio {get;}
public void PlayAnimation(Object animation);
public void StopAnimation();
}
RandomMovement
Profiler
CollisionChecker
HitReaction
Spawner
GameManager
ThreatReceiver
BonusCalculator
Healthbar
TrapController
It ain't no secret I didn't get these scars falling over in church