During spring I've been digging into several C++ resources, trying to learn the language. The classic C++ Primer by Lippman et al. have been of great value. Now I think I know about enough of the intricacies of the language to begin doing something real. Because that's the best way to learn for real if you ask me. And what's a better summer project than a game?
Summer break has now officially begun, even though I myself have been free for the past two weeks. The little time I've been able to motivate myself despite the heat I've been busy reading Game Coding Complete by Mike McShaffry et al. A great book with some good concrete information about game developing, unlike Fundamentals of Game Design by Ernest Adams. Which in itself is a good book too, but with focus on designing the game idea to make it appealing. It doesn't touch programming the slightest.
Game Code Complete discusses an event based game engine architecture throughout the entire book and gives you code examples on stuff that actually works. I've been reading and trying to apply this knowledge on my own summer project, a dungeon crawler-ish sort of game. I haven’t spent too much focus on that part as I have absolutely nothing to build it on just yet.
My thoughts on the architecture however are coming along nicely. The event system allows messages to be passed from the game logic to everyone who is listening. And a command system passes commands back to the game logic, which is the authoritative part of the application, deciding whether or not these commands should go through. Actually its more like requests.
I also had a rather nifty idea about generating (seemingly) infinite worlds in an effective way by dividing it into sectors, all placed in an STL map. There I can map a pair of ints, representing the sectors global coordinate, into the sector itself. And by just loading the current sector and its neighbours into the views and AI and Physics systems, I can keep the game fast and nice. The sectors themselves only contain information about where you can and cannot be, by keeping a list of polygons. What I do wonder however is how on earth am I supposed to map the logical representation of a world, to a strictly graphical one. Every sector would need to be attached to some sort of image object, partially destroying my nice separation. But I believe true separation cannot be truly achieved in a game like this. The beauty of the sector system was that given a little bit of information and computation time, I could generate these on the fly, creating a truly expanding world that would challenge the gamer in new ways.
When I feel more pedagogical and have come further into the development I will go into more detail about my solutions and the state of my summer project.