You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that enough time has passed, and requirements have changed enough to necessitate an overhaul of the object system. There are very minute differences between the subclasses of Entity. The difference between a GameObject and an Entity is also questionable since there is basically no application of plain GameObject besides lookups, which then get casted.
By unifying the objects in the system with a simpler definition, it should make it easier to handle the kinds of features we haven't been able to implement due to complexity of interaction between objects.
At a high level, the notion of classes separating Enemies, Items, Projectiles, etc. no longer makes sense because most of these object types need to do the same kind of things.
There should just be "GameObject".
Additionally, scripting via Squirrel may not be necessary, and possibly can be replaced by behavior trees with special hooks for certain events (onDeath, onBirth, onParentDeath, etc).
Object Types / Attributes
Attribute
Item
Enemy
Particle
Projectile
Spawner
`id`
✓
✓
✓
✓
✓
`active` flag
✓
✓
✓
✓
✓
`onActivated` hook
✓
✓
✓
✓
✓
`onDeactivated` hook
✓
✓
✓
✓
✓
`onBirth` hook
✓
✘
✘
✓
✘
`onDeath` hook
✓
✘
✘
✓
✘
`onWake` hook
✓
✘
✘
✓
✓
`onSleep` hook
✓
✘
✘
✓
✓
`update` hook
✓
✓
✓
✓
✓
`reset` hook
✓
✓
✓
✓
✓
behavior
✓
✓
✘
✓
✘
A simple type of base object without subclasses should be able to cover all the cases we see in the game. "Optional" parts of an object can just be pointers to other structures. Overall the current system is over-engineered to its own detriment.
Definition
What is a GameObject, then? A GameObject is any object that can appear on-screen within the game world. For example:
Enemies
Items (drops, collectibles, etc.)
Particles
Projectiles
This means the following things are not GameObjects:
Forces (wind, magnets, conveyors, etc.)
Spawners
Block Sequencers
The text was updated successfully, but these errors were encountered:
Summary
The current object system discourages code reuse because it is overly specific. The system should be simplified.
Tasks
id
system, where IDs can be used in place of smart pointershandle
system, used in combination with theid
systemGameWorld
to issueHandle
s and support lifecycle (UpdateGameWorld
to support objectHandle
s andId
versioning #244)Projectile
into aGameObject
+ removeProjectile
class (GeneralizeProjectile
into aGameObject
+ removeProjectile
class #245)GODefinition
object, which stores "type" information for different objects (Create anGODefinition
object, which stores "type" information for different objects #246)Description
I think that enough time has passed, and requirements have changed enough to necessitate an overhaul of the object system. There are very minute differences between the subclasses of Entity. The difference between a GameObject and an Entity is also questionable since there is basically no application of plain GameObject besides lookups, which then get casted.
By unifying the objects in the system with a simpler definition, it should make it easier to handle the kinds of features we haven't been able to implement due to complexity of interaction between objects.
At a high level, the notion of classes separating Enemies, Items, Projectiles, etc. no longer makes sense because most of these object types need to do the same kind of things.
There should just be "GameObject".
Additionally, scripting via Squirrel may not be necessary, and possibly can be replaced by behavior trees with special hooks for certain events (onDeath, onBirth, onParentDeath, etc).
A simple type of base object without subclasses should be able to cover all the cases we see in the game. "Optional" parts of an object can just be pointers to other structures. Overall the current system is over-engineered to its own detriment.
Definition
What is a
GameObject
, then? AGameObject
is any object that can appear on-screen within the game world. For example:This means the following things are not
GameObject
s:The text was updated successfully, but these errors were encountered: