Sign in to follow this  

Linking the Game to the Engine

This topic is 3313 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

Ok, i just wanted to hear some general opinions on how you guys link your game engine to your actual games, and the methods you choose to use. For example, the way i have chosen to do it is, create a class called cApplication which acts as the middle man between the engine and the game. The cApplication class member variables are a mix between engine classes and 'game' classes. the methods in the cApplication class are as follows:
void cApplication::Run();   //contains the main loop of the application
                            //and also calls the below methods.
void cApplication::Input(); //handles game input
void cApplication::Logic(); //handles game logic
void cApplication::Render();//handles rendering

This might not be the best way with larger and more complex games, it would probably need to be broken down a little more to make it easier to read the code. Im interested to hear other methods on linking the engine with the game, and perhaps what i learn in this post will help me go on to create better code

Share this post


Link to post
Share on other sites
What you describe seems to fit in well with what I've seen previously. In the few setups I've seen in practice, the engine handles collision detection, rendering and input processing, whereas the game handles collision response, game logic and other game-specific things.

Usually, this is achieved by having the game code register objects with the engine that are iterated over each frame and their Update() or Render() methods are called.

Often, the engine is implemented as a lib which is statically linked to the game, which contains the entry point and initialises the engine.

Share this post


Link to post
Share on other sites
I feel this topic has some crossover with this;

http://www.gamedev.net/community/forums/topic.asp?topic_id=514896

Animation system within a game engine. At a certain level of abstraction, having a game engine react to some user input, is the same as having a game engine react to an animation script.

Theres some bright words in here, which may also help you (I hope!)

Share this post


Link to post
Share on other sites
Quote:
What you describe seems to fit in well with what I've seen previously. In the few setups I've seen in practice, the engine handles collision detection, rendering and input processing, whereas the game handles collision response, game logic and other game-specific things.

Usually, this is achieved by having the game code register objects with the engine that are iterated over each frame and their Update() or Render() methods are called.

Often, the engine is implemented as a lib which is statically linked to the game, which contains the entry point and initialises the engine.


Ok thanks for the input, this is what im looking for, hopefully i can get more posts like this very soon [smile]

Quote:
I feel this topic has some crossover with this;

http://www.gamedev.net/community/forums/topic.asp?topic_id=514896

Animation system within a game engine. At a certain level of abstraction, having a game engine react to some user input, is the same as having a game engine react to an animation script.

Theres some bright words in here, which may also help you (I hope!)


Hmm, not sure how this ties in with what im asking.. but maybe thats just me, thanks anyways [smile]

Share this post


Link to post
Share on other sites

This topic is 3313 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.

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

Sign in to follow this