Dancing about architecture #1

Published May 24, 2005
Advertisement
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]
Previous Entry The Beginning
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement