Under the hood update

The transition to the new architecture is slowly but steadily happening. Somewhere in the next couple of months it should be finished and then a new rounds of functionalities and updates will hopefully come close by thanks to the improvements, right now the management of lava has improved significantly and it no longer slows down your movements.

Lots of lava

Lava generation (shrunk because of file size)

As discussed previously, I am implementing an ECS architecture, this has changed quite dramatically the game architecture from this:

Source as of 6th of Septemebr 2015

To this (not everything is shown here):

WoU ECS Architecture

The graphic above is more complex because it is a lot more detailed, for now, but you may already be able to notice that there is a lot less coupling between objects. For example there is a difference between Grid Objects and Turn ActorsActors never reference Grid Objects, in fact, they don’t know where they are on the grid! Their parent system, Turn Manager, interfaces with Grid Manager only if necessary, for example to enable path finding, but these functionalities are few and all put together inside the same update routine. This makes it easy to debug things and make the game (i.e. the systems) behave exactly as I want to. No more asynchronous waiting that depend on a lot of if clauses, thanks to the easy to follow code paths.

WoU ECS Architecture - Widgets

Of course there are challenges. Right now I am unsure where to put the “Game Mechanics”: are they a Service or a System? (by the way, notice the use of locator pattern for services, there is a bit of boiler plate, but it really is nicer than singletons). What about the “Level Generator” stuff? It should probably be a service, but it is very tempting to have it as a component, in such way I can just implement various generators by loading different components…

What would you do?

By the way, you may have noticed a change in the style of the architectural drawings, that is because I am now experimenting with draw.io. Inkscape is a great tool, but I am finding that draw.io meshes more easily into my workflow thanks to its integration with Google Drive and, while maybe not on par with other dedicated graphic suites, it does a pretty good job and comes with a lot of instruments to make technical drawings a breeze. You may want to take a look at it.

Thanks for reading.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s