The state of things, a summary of thoughts

12 views
Skip to first unread message

Michael Cann

unread,
Jul 16, 2011, 12:00:58 PM7/16/11
to swft-fr...@googlegroups.com
As promised, I have put together the following a kind of summary / current state of thinking for SWFt.



01.png
[Figure 1]

SWFt is a micro-game framework built upon Robotlegs. At its core it is very simple indeed, with only three new classes on top of RobotLegs'.

EntityComponent - is a modular nugget of game functionality. 
Entity - contains and manages a number of components
System - provides functionality global to all entities
 
With just these three elements (ontop of the classes provided by RobotLegs) you are able to construct an extremely modular, reusable and performant game. 
 
A very simple example follows:

02.png
[Figure 2]

The above diagram attempts to illustrate a very basic 'game' with just one entity.

The GameContext extends Context and maps models, views, commands, services and systems. In the above example the BlittingSystem is mapped and is responsible for rendering entities in the world. The EntitiesSystem is responsible for creating and destroying entities. 

Commands in SWFt are used for business logic and as such respond to events dispatched on the event bus. In the above example StartupCommand is triggered when the same starts and proceeds to call createEntity() on the EntitiesSystem to create a Player entity. 

PlayerKilledCommand is created in response to the PlayerKilledEvent and in the above example calls destroyEntity() on the Entities system. 

When an entity is created it creates a number of components which each have their dependencies on each other and other systems. An entity has its own child injector meaning any components mapped with it are local to that entity. Any dependencies on System's or Model's or other game-wide Actor's are automatically provided by the parent injector.  

The idea is that SWFt framework provides the base framework, very much in the way RL does for webapps. For it to be of any use to build a game an Engine needs to be built ontop. The engine will contain the 'meat and potatoes' which would include many different System's and components. Crucially however the Engine should not contain any Commands or Entities as these are business logic and belong in the realm of the specific game. 

--

So thats about it for now. I know its abit short, but hopefully I explained the current state of things as I see it. 

If theres any interest, ill resurrect the github source and update it to reflect the current state of things.

Cheers,
01.png
02.png
Reply all
Reply to author
Forward
0 new messages