Glidias
unread,Jun 30, 2010, 12:15:26 PM6/30/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SWFt Game Framework
Note that with registering many updatable component classes per entity
being created (through an UpdatableEntityComponent base or IUpdatable
interface), there's no explicit priority given to the chain of
updatables being added to the update list. Currently, a push() is
being used, which turns out fine in this example because (I assumed)
you registered the WindManager first, which allows the WindManager's
updates to resolve prior to the entities' controllers. But again,
you're depending solely on one update to handle calculation and render-
validation through each given update of the controller.
What happens if there are multiple controllers, and some might need to
be resolved prior to the execution of the next controller update? One
of the balloons might be controllable by player keyboard upon being
selected, together with other components (eg. Collidable) and other
forces which affects the eventual velocity of the entity during
collisions? What if a particular collision prevents the player
keyboard controller from working because it disables the selection of
the balloon? Different collision resolvings between different type
groups of entities will eventually affect the eventual *visual* result
of the entity. As such, your framework would need to account for a
collision detection phase, a calculation phase, and a render phase.
It should also have (unlike OOP) have a single controller to handle
the precise order of how things should run given specific phases. One
of the problems with orienting your control to objects (OOP), is that
you'd have to look through many different components/object classes,
without clearly seeing the order priority from which they're being
executed. For more complex games, this can become unmanagable due to
the numerous amount of components being used across many packages.
Given the complexity and scale of a game, each component could simply
be a lightweight modifiers which modifies the eventual velocities of
the entity (though certain things like player keyboard control should
be managed after environmental factors are considered), leaving the
eventual visual result to a final render phase that is handled by
render order. However, if a physics engine (such as Box2D/Motor2)
already has that, you could already include wind and other forces
which affect the entity's position, and your entities (or components
thereof) merely holds the data to be fed to these engines. As such, a
controller class isn't needed per entity (as it results in numerous
class instance duplication), since there's no central engine being
used to define where your entities should be.
I'd prefer a framework that allows you to easily inject the required
references/properties into existing engines (such as Haxe/Alchemy-SWC
compiled engines or externally loaded .swf engine packages), so that
those engines can handle the outcome of your entities in a homogenous
manner through each given phase of a game's cycle. This can result in
a more data-oriented (vs object-oriented) approach though. Rather than
executing the operations from the bottom/bottom-up, you execute them
from the top-down, and certain components are useless without an
engine implementation of it, so why not just register some components
to an engine/manager that can keep track of everything from the top-
down? This approach is more engine-centric though.
I wished if there was a way to pre-process injector settings and bake
a SWF's classes' [Inject] code to inline dependency code generation,
that would really rock . Think of it as a compiler than can auto-
generate inline DI code for your classes based on metadata, assuming
that all dependencies can be clearly spelled out/resolved at compile
time (either specifying a wiring to a 1.static reference, 2. a class
to be made singleton, 3..a class to be generated, or a 4.static
provider factory method). For case no.2, the code generator even auto-
creates the static singleton-boiler plate method for you. Yes, compile-
time SwiftSuspenders inline preprocessor would really rock as it bakes
everything for you.