Engine Structure

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Engine Structure

Post by mager »

I'm starting to make a small engine from Irrlicht, and I have a few questions as to the placement.

Im modelling it a bit after Xna. You have your 4 functions
Load
Unload
Draw
Update

Code: Select all

int main()
{
	IrrlichtDevice * device = createDevice(EDT_OPENGL,dimension2d<u32>(640,480),16,false,false,false,0);

	if(!device)
		return 1;
	device->setWindowCaption(L"Irrlicht - Hello World");

	video::IVideoDriver* driver = device->getVideoDriver();
	scene::ISceneManager* smgr = device->getSceneManager();

       Load(smgr,driver);

	
	while(device->run())
	{
		//Perform Updates
		Update()


		//Perform Draw
		driver->beginScene(true,true,SColor(255,100,101,140));
		
		smgr->drawAll();

		driver->endScene();
	}

         Unload();
	device->drop();


}
Would that be the proper way to set it up?
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Yours should work. I'm using custom scene nodes and animators for all the game objects, and controls. You can create animators for specific types of objects if you type check and typecast. And I've got my own event system to tie everything together. You should also look into user data for setting any flags. It's also nice in the future if you design everything to be editable from within the editor, and not having to hardcode very much.
Hope that helped.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Its just gonna be a small engine, Gonna create a few classes to help me create a GUI and to manage models. its for my game im making.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

What kind of game is it?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Its a space flight game - Its very basic so i figured a safe bet for my first irrlicht game. I used to program in Xna, then SDL. Game programming isn't new to me. But finishing a game is. lol
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Kinda like star fox 64? I'd use custom nodes for the ships, and I'd store the attributes, like shield strength, rate of fire, etc. In the nodes, then use an animator for the controls. And I think you've got it right what you showed for the basic structure. An event manager would be useful for hit and damage tracking, but you could just as easily loop through all the types of nodes and look for an ammo node, then collision check them.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Actually I'm building a general class that will work for all objects and creating a vector (or other form of collection) to store and then loop through the values. To perform updates on everything and check for collision etc. I've got a basic class called Model3D - I use it to load my models and set the textures and its my base class for everything so far.
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

Is your game meant to be more like Freelancer, or Descent 3?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Honestly - I have never heard of either of those.

Basically, I doing one of those things where people would challenge themselves to finish a game in like a month. My issue is, i get far in a game but I find something cooler and give up. I figured if I write about what i was doing I might stay more interested. The game is gonna be a 3rd person space shooter, like starfox 64. I plan on having different missions such as search and destroy, fly and asteroid belt, Kill All Enemies, protect targets and all that such
Post Reply