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
Linking the Game to the Engine
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:
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
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.
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.
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!)
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!)
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement