🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Game Engine :)

Started by
12 comments, last by XeRoZeN 20 years, 6 months ago
Don''t flame me for this please but I''m wondering what a game engine really is :] My friend told me things but there still confusing...Can you guys explain it to me and if it wouldnt be much trouble show a basic example like, if (modelbelongsthere) { place model 1.1 } etc it doesn''t have to be accurate just as long as I know it
Advertisement
A game engine is more of a concept than a piece of code or anything; the line between an engine and the game that''s based on it isn''t very clear. For example, a game engine is the underlying code that takes care of things like drawing to the screen.
Well, that''s usually refered to as the Graphics engine (drawing to the screen) which is commonly part of the game engine, but not the game engine in and of itself. The GAME engine usually refers to that set of code that enforces the game rules, tracks the state of the game, recieves and processes input, and communicates with other sub-systems (such as the rendering engine, sound engine, physics engine, etc.) to tell them to update their state to give a rendering of the current game state.
Here's some links that might help:
Game Engine Anatomy 101
Elements of a Game Engine
Enginuity 2 (just the overview part might give you an idea)
edit - fixed links

Tadd
- WarbleWare

[edited by - reana1 on December 19, 2003 6:15:58 PM]
Tadd- WarbleWare
Reana I read everything on the links you posted earlier but they still arn''t clear enough for me. I think I know what they do the trouble is now how to code it. I think thats whats troubling me most things I have a idea how to code it but not a accurate thing in my head. Most programs that I know things pop up on how to create it. When I see game engine my mind gets scrambled...Is there a another word to say game engine?
i think you might just be over-reaching to understand concepts without much doing. the best way to get a concept of how to make a game engine is to sit down and make a game. after you start working on a game you'll be able to start defining a game engine.

basically the game engine is NOT:
- the physics engine,
- the graphics engine,
- the particle system,
- the audio system
- the input system.
- the AI system

the game engine IS:
the system that ties all those sub-systems together to make all those components interact to make your game happen on the screen. it uses the input system to get input, decides what that input should do, tells the physics engine to move things around, tells the audio system to play sounds in certain circumstances, etc. the inportant thing to understand is that the game engine really is the game. someone else can take exactly the same code from all the above systems and use them to make a completely different game that is in almost no way similar to your game.

my advice is pick something nice and simple, like pong. code it. then try pong with sound. or maybe a 2D side-scroller game. don't worry about how to define game engine. you'll evolve your own understanding as you progress.

-me

[edited by - Palidine on December 19, 2003 7:50:09 PM]
I'm not even sure what you just said....:o So...can anyone show me a tiny example how its coded like I think my problem is how the its coded. I seen all the things it does mostly..so like its mainly a connecter like

Game Engine
^
Audio Psyhics

Etc so its mainly coded like this?
if (sound1 = active) {
tell audio engine to play sound
}

[edited by - XeRoZeN on December 20, 2003 3:44:37 PM]
Can we get this into a better forum for this type of question? Please?

ld
No Excuses
Palidine:
i would say these are "components" of an engine, and yes, all items of your list together ARE the engine. think when using another engine, you dont write the audio system or render yourself.

XeRoZeN:
you want some code? tell me, what are we supposed to do to show you in a thread how an engine is built? thats not possible.

imo, a good engine should look like this when using it:

void foo()
{
CMesh* Mesh = new CMesh();
CWorld* World = new CWorld();

Mesh->Load("my_model.md2", MD2);
Mesh->SetPos(0,0,0);

World->AddMesh(Mesh);

Engine::Render->SetWorld(World);
}

just a simple example, imagine you code this on our own using ogl/dx. the mesh should automatically be rendered to screen (all meshes added to the world). anything else should be done by the engine (like creating a window, set up the chosen renderer, set up audio system etc. etc.) and you can access all those features over some core objects like the inputmanager, kernel etc.
Here''s some code:
CGameEngine ge;CGraphicsEngine gfx;void MenuOption_StartGame(){    ge.InitGame();    if( StartLevel1() )        StartLevel2();         ge.EndGame();}BOOL StartLevel1(){    BOOL bWin = FALSE;    ge.LoadLevel("Data\\Levels\\Level1.lvl");    while( !ge.ShouldExit() )    {        if( ge.PlayerWins() )        {            bWin = TRUE;            break;        }        if( ge.PlayerLost() )        {            bWin = FALSE;            break;        }        ge.ProcessInput();        gfx.DrawGameToScreen( ≥ );    }    ge.UnloadLevel();    return bWin;}BOOL StartLevel2(){    BOOL bWin = FALSE;    ge.LoadLevel("Data\\Levels\\Level2.lvl");    while( !ge.ShouldExit() )    {        if( ge.PlayerWins() )        {            bWin = TRUE;            break;        }        if( ge.PlayerLost() )        {            bWin = FALSE;            break;        }        ge.ProcessInput();        gfx.DrawGameToScreen( ≥ );    }    ge.UnloadLevel();    return bWin;}

Hope this can help you

Kam1kaz3

This topic is closed to new replies.

Advertisement