Archived

This topic is now archived and is closed to further replies.

Geh! Base Game Object

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Are you talking about a base game object such as CVehicle that can derive classes like CJeep, CJet, CTank...

Or are you talking about a base game object that is used to conduct the workings of your engine in a modular and overridable way?

Share this post


Link to post
Share on other sites
Well, when I wrote a few game experiments, I discovered that there were a lot of things they had in common.

But there were also a lot of things they didn't.

Common:
Timer loop
Poll the controls (keys states, mouse values, joystick values) and store in structures
Sound engine
Base network communication (connect, player list, ping messaging)
Vector mathematics
Templated linked list, array handlers with memory cleanup (could use STL for this)

Not common:
Table of game control events for game (jump, forward)
Special game object management structures (loop-around playfields, octree space partitions, etc.)
Memory management of objects (arrays? Lists?)
Handling of particle effects (arrays? Lists?)
Game-specific network messages
Object behaviors

Setting up a base game object along with overridable function calls will allow you to write the base game code once and build everything for your specific game on top of it. The base game object establishes the order in which everything is called, so all you have to do is write your custom routines and add the custom structures necessary to make your game work.

It basically keeps you from having to redo code over and over again every time you want to make a new game, providing you with a quick starting point that is easy to add to.

That's a very simplified way of putting it. You'll likely end up writing a lot of classes for one game that you could easily re-use for the next. But you'll end up not using a lot, too.


[edited by - Waverider on June 5, 2003 4:46:25 PM]

Share this post


Link to post
Share on other sites