Structure of a Game Engine?
Moderator: Coders of Rage
- Lord Pingas
- Chaos Rift Regular
- Posts: 178
- Joined: Thu Dec 31, 2009 9:33 am
- Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
- Programming Language of Choice: C++
- Location: Hiding In My Mum's Basement With My Pokemon Cards
Structure of a Game Engine?
Hi, I want to get to work on a basic SDL engine that can be used to make small 2d games.
How would I go about the structure of a game engine?
And how would I seperate the engine from the actual game? External .txt files?
Can someone please show me the light?
How would I organise my files and classes, as a matter of fact, what classes would I use?
Thanks!
How would I go about the structure of a game engine?
And how would I seperate the engine from the actual game? External .txt files?
Can someone please show me the light?
How would I organise my files and classes, as a matter of fact, what classes would I use?
Thanks!
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Structure of a Game Engine?
Have a skim through this topic, gotta run hope it helps
http://thechaosrift.com/viewtopic.php?f ... e29#p53934

http://thechaosrift.com/viewtopic.php?f ... e29#p53934
- Lord Pingas
- Chaos Rift Regular
- Posts: 178
- Joined: Thu Dec 31, 2009 9:33 am
- Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
- Programming Language of Choice: C++
- Location: Hiding In My Mum's Basement With My Pokemon Cards
Re: Structure of a Game Engine?
I had a look at the thread and I came up with this:
I will have a general cCore or cSystem class that has the five functions that get called in main (onInit, onRun, onInput, onUpdate and onCleanup).
With it there will be other classes such as cCharacter and cNPC in a seperate game folder that will inherit from a cSprite, cSpritesheet class from the engine so that it can render the Player and NPC and such.
Sounds good?
What are all the things I would need in the engine?
I will have a general cCore or cSystem class that has the five functions that get called in main (onInit, onRun, onInput, onUpdate and onCleanup).
With it there will be other classes such as cCharacter and cNPC in a seperate game folder that will inherit from a cSprite, cSpritesheet class from the engine so that it can render the Player and NPC and such.
Sounds good?
What are all the things I would need in the engine?
Re: Structure of a Game Engine?
kittens definitely need kittens... And uh turtles too if its not too much of a bother :D but seriously it depends on what you want the engine for. Broad do anything engine? a puzzle game engine. I see you say you want a 2D game engine. That's kinda broad, so it would have to be pretty generic and extensible. I'd say what you've got planned out here is a good start. But you'll probably want to look at some sort of scripting language possibly. Also you'll need Different object/entity classes. Collision. Tiles. And all that good stuff. All this will get you a good start if not on your way to being able to make an actual game

- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Structure of a Game Engine?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Structure of a Game Engine?
Nobody is denying that, but on a side note engines are the futuredandymcgee wrote:Write games, not engines.

- WSPSNIPER
- Chaos Rift Regular
- Posts: 145
- Joined: Sun Jan 03, 2010 6:19 pm
- Current Project: top down shooter
- Favorite Gaming Platforms: ps3
- Programming Language of Choice: c++
Re: Structure of a Game Engine?
agree engines are the future because people want to do as little work in as little time as possiable to save money so they will use an engine to help them out... most companys dont want to pay someone to develop the engine from ground up so they will find an engine that is already made and buy it for less then it would cost to pay developers and cut off a lot of development timeGroundUpEngine wrote:Nobody is denying that, but on a side note engines are the futuredandymcgee wrote:Write games, not engines.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Structure of a Game Engine?
...you might really like AiGD17 then...
- hurstshifter
- ES Beta Backer
- Posts: 713
- Joined: Mon Jun 08, 2009 8:33 pm
- Favorite Gaming Platforms: SNES
- Programming Language of Choice: C/++
- Location: Boston, MA
- Contact:
Re: Structure of a Game Engine?
GyroVorbis wrote:...you might really like AiGD17 then...

"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
http://www.thenerdnight.com
- ismetteren
- Chaos Rift Junior
- Posts: 276
- Joined: Mon Jul 21, 2008 4:13 pm
Re: Structure of a Game Engine?
I guess that means you are goong to talk about the structure of the engine. I've always wanted to get an idea of how you did it. Now i can't wait even lessGyroVorbis wrote:...you might really like AiGD17 then...

Re: Structure of a Game Engine?
*GASP*GyroVorbis wrote:...you might really like AiGD17 then...
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Structure of a Game Engine?
well then...GyroVorbis wrote:...you might really like AiGD17 then...

- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Structure of a Game Engine?
That's good and all, but for a newbie chances are your portfolio will look a lot more enticing with a working game than a working engine using the same ideas used by games in the early 90's. That's the point I was trying to make at least. There's absolutely nothing wrong with doing it for the experience, to the contrary I would highly recommend it. In the end, we all know anything is better than nothing.GroundUpEngine wrote:Nobody is denying that, but on a side note engines are the futuredandymcgee wrote:Write games, not engines.

Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- RyanPridgeon
- Chaos Rift Maniac
- Posts: 447
- Joined: Sun Sep 21, 2008 1:34 pm
- Current Project: "Triangle"
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/C++
- Location: UK
- Contact:
Re: Structure of a Game Engine?
WIN!GyroVorbis wrote:...you might really like AiGD17 then...
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Structure of a Game Engine?
Fair point. A good example of clever engine creation is Falco +team because originally the game started to evolved around the engine but more recently the engine evolves around the game, that way everything specifically planned for ES in the beginning can now be achieved and finally determine how ES engine is made. Casing point this focuses on writing the gamedandymcgee wrote:That's good and all, but for a newbie chances are your portfolio will look a lot more enticing with a working game than a working engine using the same ideas used by games in the early 90's. That's the point I was trying to make at least. There's absolutely nothing wrong with doing it for the experience, to the contrary I would highly recommend it. In the end, we all know anything is better than nothing.GroundUpEngine wrote:Nobody is denying that, but on a side note engines are the futuredandymcgee wrote:Write games, not engines.

This is kinda true, but I would say that's a little exaggerated. Engine programmers these days try to be creative or even innovative with thier ideas and implementations, e.g. looking at current/future hardware and seeing how it can be taken advantage of.dandymcgee wrote:than a working engine using the same ideas used by games in the early 90's.