Radioactive-Software Radioactive-Software
Forum to discuss Radioactive-Software Products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Game processes and organizing the core/kernal.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Taymo
Forum Regular


Joined: 16 Mar 2006
Posts: 19

PostPosted: Wed May 02, 2007 7:28 pm    Post subject: Game processes and organizing the core/kernal. Reply with quote

I've started a game design and I'm pretty impressed with it so I'm gonna try to produce a game with it. Anyways I'll be using the Irrlicht engine as it's easyly upgraded and super fast so most engine aspects I'll luckyly not have to implement.. phew.

One aspect I've been kinda confused about is how to organize game modes and the general game itself on the more, autonomous, internal level or the kernal. I was thinking I could have "processes" that implement updating and rendering. Then derive all the processes from the bass class. I'll store these in a std::map. I'm wondering if this is a logical way of doing it and also how Gang Wars does it if you can give that kinda information. Thanks for any info!
_________________
Working on:
Project Acerbus - Action / Adventure

The first step to ultimate wisdom, is the realization that one knows nothing at all.

Sinister Inceptions
Back to top
View user's profile Send private message AIM Address MSN Messenger
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Thu May 03, 2007 8:56 am    Post subject: Reply with quote

Heh, proper game engine design is a meaty topic to say the least...some of those terms you used have multiple meanings so I'm gonna try to nail down what you're getting at.

Are you planning to make each aspect of your game engine a seperate process/thread? I'd recommend against that...and would just use a single thread for your engine. Seperate the networking & physics into their own threads. Or by 'process' did you mean internal function call?

In terms of organizing your game engine, and handeling different game modes, just use a state machine approach and a tight update loop for your main callback.

As the old saying goes... K.I.S.S....Keep it simple stupid Very Happy that's my motto at least Wink Try to avoid over-engineering things as it usually comes back to bite you in the ass.

Just have an engine "update" function, and an engine "render" function...and structure your main update function as such....

Code:

void CGameEngine::Update()
{
 CalculateFPS();

 if(GetTime() - m_LastStepped >= (1000/m_TargetEngineFPS))
 {
  if(Console.IsActive() == false)
  {
   m_LastStepped = GetTime(); m_TotalSteps++;
   
   InputCallback();     
   if(m_EngineState != ENGINE_STATE_GAME) return;

   if(m_IsPaused == false)
   {

     //... Step game world
 
   } //end of if
  } //end of if 
 } //end of if

 RenderingCallback();
} //end of Update function

void CGameEngine::RenderingCallback()
{

 //Render scene here

} //end of RenderingCallback function



Throw the GameEngine.Update() call into the appropriate area of your Windows message pump and you're good to go.

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
Taymo
Forum Regular


Joined: 16 Mar 2006
Posts: 19

PostPosted: Fri May 04, 2007 5:56 pm    Post subject: Reply with quote

Ok, that makes sense. Actually I decided to use the Irrlicht engine and it does most of the processing.. it's more I just basically have to initialize everything and let it run. Thanks for the info!
_________________
Working on:
Project Acerbus - Action / Adventure

The first step to ultimate wisdom, is the realization that one knows nothing at all.

Sinister Inceptions
Back to top
View user's profile Send private message AIM Address MSN Messenger
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Fri May 04, 2007 11:41 pm    Post subject: Reply with quote

Ah, well be sure to post some screens / a demo once you get something up and running!

Take it easy, and good luck.

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group