Sign in to follow this  
  • entries
    72
  • comments
    104
  • views
    45399

Dancing about architecture #1

Sign in to follow this  

136 views

The last week I have spent some time looking at the overall architecture of the project. One of the things I wish to acheive is some degree of platform or API independence. I'm trying to find a slick way to encapsulate all API-specific calls into respective classes and by doing so create some kind of abstraction interface. Then the core program can work up against this abstraction without having to worry about which platform it is runnig on. This should also enable me to write additional support for other platforms later on if i want to. At least that is my aim... [smile]

Another thing that I have been thinking about is to divide the functionality of the game into several different subsystems. For example the ship movement is one subsystem, the damage calculation is one and the user interface is another. The reason for this is the same as above: flexibility. The game class doesn't need to know which or how many subsystems that are present, more than that it holds them all in an array. It just calls upon them all in turn every frame and lets them do theirs. (It has to make sure though that no duplicate subsystems are present that might interfere whith each other.) This way I am free to add, remove or modify subsystems later on without having to alter the game class. I'm not yet sure how to distribute ingame data between the game class and particular subsystems, though.

The third concept for today is the draw manager, which is a class that is responsible for gathering the graphical output from all the subsystems, sorts it and relays it on to the graphics API abstraction interface, which does the actual drawing. In this way no drawing is done until all subsystems are done updating and as far as graphics are considered the sbsystems can be updated in any order, since they don't do the actual drawing themselves.

Well, I guess that's it for this time. More to come.

BTW: I just realized how much clearer these ideas became to me as I wrote them down. Very nice! [smile]
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now