Stellar Interface: behind the game - Architecture
STELLAR INTERFACE is a rogue-like, permadeath space shooter with randomized perks, providing the player an unique experience every run!
The backbone of any game, behind the graphics, sound, gameplay, is the code. As seasoned app developers we are used to play with the application architecture, to experiment and try different things, making it easier to reuse or modify the source in the current and future projects.
In games things aren’t so easy, the shear size of the code is ridiculous. Up until now, the biggest project that we ever worked, in both code size and feature length, was Pages Manager for Facebook. But StellarInterface is easily ten times bigger both in code size, features and complexity (and it is only about half done!).
Looking into it, it is quite simple to understand why we didn’t make a rogue like Space Shooter, but made an entire framework to make Space Shooters. Despite of its complexity, adding content to the game is very easy: most of our favorite perks are made with less than a dozen lines of code, we have a complete game, run, level and wave cycles automatized, one can even change enemy behaviors without changing a single line of code (configuration FTW :D).
It was probably a mistake, and we talk about it a lot, to make such huge infra-structure, but the liberty that we gained, to pretty much implement anything that comes to mind, is very powerful. Specially in game design where testing ideias quickly is a must in order to proceed forward.
Dividing our game in the classic three layer architecture will yield the following.
Our database, can be divided in three components: resources, configurations and game generated data.
The resources are what one would expect: strings, spritesheets, audio, etc. The configurations have all the data about the weapons, enemies (and their behaviour). Finally the game generated data is simply the usual saved games and the metric database.
Most of our database is access through data storages, which transforms the raw data into objects that our game know how to work.
The SLAM (Statistics Logging Achievements and Missions) is a “super” data storage that reads/writes metrics and transforms them into knowledge. As an example, an event logging a projectile hit will obtain information such as average damage taken, how many times it destroyed a spacecraft, what spacecraft does it hits more often, etc. All this information will then be consumed by the rest of the SLAM system, the one that actually “listens” to data updates and act when certain conditions are met (and voila an achievement and mission system).
The application layer is a little more complex and looks like the following.
Here we have our framework. The logger is pretty much the producer of data, used across all the game. The level generation deals with the graph generation, what spacecrafts will appear on the next level, how will they appear, how will they act (Pathing) and what will they fire. The features (base name for the perks and consumables) is one of the most important aspects of the game (that is why we already have more than 80 perks implemented!). These services offers the foundations for the perks/consumables activation, configuration and overall handling.
The controllers are the hard workers of the game, they handle pretty much everything that need to be done. They work directly with the DAL and the service layer in order to expose the game features and logic the graphics components.
Finally the presentation layer.
This is a crazy layer, mainly because we really didn’t understand how to work with it at the beginning and are still figuring out all the details (the game loop is a scary thing xD).
Everything that you will see, hear and feel, the graphics, the audio, the SPX, all the physics, collisions and overall behaviors are in here.
In the near future we will probably dive deeper into this awesome technical adventure that we called Stellar Interface, until then, follow us on the usual places:
Website - http://stellarinterface.com
Twitter - https://twitter.com/stellar_net
Facebook - https://www.facebook.com/stellarinterface
Youtube - https://www.youtube.com/channel/UCT3pJJwn-BEyLqH9pNTQCxw
Reddit - https://www.reddit.com/r/stellarinterface
Google+ - https://plus.google.com/105756639144658056270?pageId=105756639144658056270
Blog - http://blog.imaginationoverflow.com/tagged/StellarInterface