Advertisement

Game Engines -- ????

Started by April 09, 2001 08:56 PM
3 comments, last by Estauns 23 years, 10 months ago
Hey all, This is going to sound completely newbie-ish and _I WANT THAT_.. bwa ha ha =) Anyways.. how do game engines work? I know they''re made up of different parts, like input, sound, graphics, networking, etc.. But how do they all tie in together? Are they all part of a main loop or something, like main() serving as that "main loop" that will loop until quit = TRUE via a quit menu or something? And how do all the things run at once? Cuz my understanding of programming, is that it will go by line by line.. so how do they get a sound effect to play at the exact same moment that I push my key, in conjunction with a monster dying on the screen? I''ve heard of something called "Multi-threading" before, but I don''t understand what that is, anyone wanna explain it? Would a game engine have something like a "Naming" section to it? Because to derive an instance of a class, you need something like "Zombie BillyTheZombie" to create a new instance of that class called BillyTheZombie.. so would it have some sort of naming system if monsters were to appear randomly on the screen? (Like say a Gradius or Asteroids clone)? Thanks for reading this over, and if you''re you don''t want to answer please point me at a URL That could be beneficial. Also, any Win32 Tutorials you know of would be greatly appreciated. Thanks, -Estauns
"Where genius ends, madness begins."Estauns
the way i understand it, and am currently trying to emulate, is this:

yes, they use a main loop, the same as most games. you get the ''appearance'' of it running everything at once, because it runs everything in small pieces, once every loop. for example:
i addedd movement capability to my program.
when the script engine (another story) gets the command "move bob right'', it tells my main loop that the player bob should move right, a little every cycle of the main loop, until bob reaches his destination.
ALGORITHMmain loop  check for movement (a loop) in player[count]   if yes     move player[count].name by player[count].movespeed (variable in the class)   if no     check next player


or at least thats the way i understand it...

then again, i dont program in windows, so perhaps there is multi-tasking capabilities with direct X...

hope this helped.
Advertisement
quote:
Original post by Estauns
Anyways.. how do game engines work? I know they''re made up of different parts, like input, sound, graphics, networking, etc.. But how do they all tie in together?



There''s an open source game engine right here on GameDev.net (in GD Showcase) called the Scrolling Game Development Kit. The source code is at http://gamedev.sourceforge.net/.



"All you need to do to learn circular logic is learn circular logic"
"All you need to do to learn circular logic is learn circular logic"
quote:
Original post by BlueMonk

Original post by Estauns
Anyways.. how do game engines work? I know they''re made up of different parts, like input, sound, graphics, networking, etc.. But how do they all tie in together?



There''s an open source game engine right here on GameDev.net (in GD Showcase) called the Scrolling Game Development Kit. The source code is at http://gamedev.sourceforge.net/.



"All you need to do to learn circular logic is learn circular logic"





Are all comecial games crated with a game engine ?
Yes. The engine is essentially only there as an aid to the programmers. It allows the game to more than just a little guy walking across the screen. Also, the game engine can be reused and modified dozens of times in other projects-- and they''re not always games. You could get the "engine" for home-modeling software and modify it to be a 3d game engine (don''t try unless you WANT a stroke, but I''d say it can be done).

Also remember that an "engine" is just a mini-API meant for a specific program but can be expanded and used for others.

The way I see it:
--There is the main event handler.

--There are the audio, video and physics subsystems. Each of these have event handlers of their own.

--The level file that is loaded at the appropriate time sends messages like MESH_TOUCHED to the main event handler, which in turn sends them to the subsystems.

--MESHES_TOUCHED is sent when two meshes (the walkplayer and an enemy for example) have touched. The main handler sends this to the physics handler, which proceses the message and decides what happens.

Then there''s the scripting system, if any. If the programmers choose to include one, it will greatly simplify the process, as you can probably guess now.


Anyone who knows better please correct me wherever I''m wrong. I''m still learning and need help just as well as Estauns.

This topic is closed to new replies.

Advertisement