Sign in to follow this  
EmpyrealHell

Game Engine

Recommended Posts

So I've decided that I want to write a game engine. I've attempted various small engines in the past (of which most were nothing more than wrappers for DirectX) and I've decided that this time around I want to take it seriously. I'm a hobbyist, not a professional, and I'm not looking to be a professional, at least any time soon. I've take 4 years of C++ so I know my way around a compiler, I'm familiar with the basics of DirectX, the STL, most of what I feel are the main parts of setting up a game engine. Since I'm hoping this will be the last time I start an engine from the ground up I want to do it right from the start. I read a few articles on this site about design documents and decided that would be a good first step. I wanted to know if I could drop one of those bad boys in here and see what you guys think of it. I'm sure I'm missing some stuff, or maybe have too much stuff. Anyway, I plan on writing this as a library to statically link to any games I'll make with it, to help keep it separated from the game code. Enough rambling, here's what I have so far Electric Horse Engine The Electric Horse Engine is a 2D/3D game engine developed in Microsoft Visual C++ 2008 Express using DirectX 9.0. Requirements This engine needs to run on any Microsoft Windows system versions XP or newer. This engine needs to be able to accomodate any game type. This engine should be the only engine that the game needs. Components The engine will be made up of seperate components that will be integrated together. These are not modular components, they will all be compiled into a library to be statically linked to by the main game executable. The engine will consist of the following components: Windows Component - windows specific code for the game DirectX Component - Direct X for integration with the engine --Direct 3D - handles both 2d and 3d graphics, including all lighting, shaders and visual effects --Direct Input - in conjuction with the windows interface, handles buffered, unbuffered and text input, as well as mouse input --Direct Sound - handles 2D and 3D sound effects as well as background music Network Component - handles the network layer for local network and internet capability Physics Component - handles collision detection and reaction Particle Component - a 2d or 3d particle system Interface Component - input boxes, display labels, buttons and scrolling Windows Component This component will include the creation of a window using the Windows IDE. This will also handle the windows message pump, shielding the user from it. All windows messages will be hidden from the user, and a custom system of passing events will be implimented through this class. This will allow custom events to be fired and handled procedurally, as well as handle windows events that aren't handled by the windows components in a procedural manner. The standard windows message pump will be handled in a seperate thread that will be created automatically. This component will contain the following classes: ehWinWrap - contains all of the code to initialize and manage a window, with the minimum nummber of required variables ehWinEvents - contains a system to buffer events to be handled by the user. This will allow the user to process events procedurally ehWinKey - contains code to recieve buffered keyboard input for menus and text input, or anywhere the keyboard delay is desired DirectX Component This component will include integration of the three major components of DirectX: Direct3D, DirectInput and DirectSound. This will handle all of the basics of initializing these components and presenting them in a simplified manner. All graphics, both 2D and 3D will be simplified and presented to the user without any need for understanding of DirectX concepts. The graphics will also be automatically indexed to handle the reloading of textures and meshes should the application lose focus. The DirectInput section will present keyboard and mouse input through the custom even process of the Windows component. This, along with the ehWinKey class from the windows component will stream all user input through the ehWinEvents class. This component will contain the following classes: ehDirect3D - contains code for initializing a Direct3D system, with the minimum number of required variables ehDirectModel - contains code for housing model data including textures, bones and skin ehDirectSprite - contains code for housing a sprite entity for use in a 2D game or as part of a UI. ehDirectTexture - a class to handle the collection of textures being used ehDirectKey - contains code to initialize and handle direct input for immediate keyboard access ehDirectMouse - contains code to initialize and handle buffered mouse input through direct input ehDirectSound - contains code to initialize and handle direct sound for use with wav and mp3 formats in 3d dimension and flat Network Component This component will handle the network layer for direct peer to peer connections and multi-client to server connections. This will enable network use for LAN play, internet play through IP or internet play through a lobby. Network messages will be passed through the ehWinEvents class to the user. This component will contain the following classes: ehNetClient - network code for connecting to a server as the client ehNetServer - network code for receiving connections from clients Physics Component This component will handle the physics for 2D and 3D collisions, collision reaction based on material, and various other physical systems. This will handle the calculations for wind, gravity and collision reaction. This will also handle ragdoll and cloth effects for models that need it. This component will contain the following classes: ehPhysGravity - can be attached to any existing model or sprite, will process gravity to a specified point ehPhysWind - can be attached to any existing model or sprite, will process wind in a specified direction ehPhysCollide - given two model or sprite entities, will determine if they have collided, and provide rebound calculations based on materials of each ehPhysRagdoll - attached to an existing 3D model, will process ragdoll effects for that model ehPhysCloth - attached to an existing 3D model, will process cloth like effects for that model Particle Component This component will be a simple particle generator for 2d and 3d particle systems. This will enable the user to create particle systems, both affected and unaffected by the physics engine, of various types. This will allow custom particles to be used or default round particles to be used. This component will contain the following classes: ehPartNode-a single particle, generated and managed by an ehPartGenerator object ehPartGenerator-runs a particle effect based on several parameters Interface Component This component will recreate some of the windows interface components to make detecting user input easier. This will use the ehWinEvents class to tell the user when an interface object has been interacted with. This component will contain the following classes: ehIntButton ehIntCheck ehIntRadio ehIntInput ehIntList ehIntDrop Anyway, to all of you who took the time to read this and help me set myself on the right path I thank you. Any advice you have on any point of this please let me know. Thanks! [Edited by - EmpyrealHell on November 11, 2008 12:32:13 AM]

Share this post


Link to post
Share on other sites
A couple of comments: I don't see anything in there about game objects / entities, inter-object and intra-object communication, artificial intelligence, scene composition, visual partitioning, actual renderer design (plus sorting / render queues), or high-level code like the gameloop or handling of game states. Also, I'm not sure it's possible to create a generic engine that can handle any kind of game - and with your current description, people would still have to build their own engine on top of yours before they can make a game with it.

I think you will quickly run into these issues as you build games alongside the engine, though, which you are planning to do. That's a good idea anyway. What kind of games are you looking to build?

Share this post


Link to post
Share on other sites
Quote:
Original post by GuyWithBeard
Quote:
Original post by EmpyrealHell
blaah blaah blaah ... developed in Microsoft Visual C++ 6.0 ... blaah blaah blaah


Please don't do that. Here is better alternative. There is no reason why you should use 6.0, and a thousand reasons why you should not.


Ehh, I have VC6, 2005 express, AND 2008 express all installed on my computer right now... And I still use VC6.. So if that is what you want to use, then by all means.

If you wanted to be serious with it, then you probably should use the newest technology available, but since you are doing it for fun anyway, you may as well do it in an environment you like developing for.

Share this post


Link to post
Share on other sites
Quote:
Original post by lightbringer
A couple of comments: I don't see anything in there about game objects / entities, inter-object and intra-object communication, artificial intelligence, scene composition, visual partitioning, actual renderer design (plus sorting / render queues), or high-level code like the gameloop or handling of game states. Also, I'm not sure it's possible to create a generic engine that can handle any kind of game - and with your current description, people would still have to build their own engine on top of yours before they can make a game with it.

I think you will quickly run into these issues as you build games alongside the engine, though, which you are planning to do. That's a good idea anyway. What kind of games are you looking to build?


Good call on the game entities. I don't actually make the games with this thing, I work in a two man team and do the engine work, he makes cool stuff with it. The actual game part of it slipped my mind i guess.
As far as AI is concerned I don't know how to make that into an engine, I kinda figured that would have to be on a per project basis, unless you were thinking of putting basic AI stuff in there like pathfinding A* stuff.
For the rending design, visual partitioning stuff, I'll admit that I'm relatively new when it comes down to the 3D part, which is part of the reason for this project in the first place. I have an understanding of what they are and how they work, just no idea how to implement them, so any resources on that would be helpful.
Games states and gameloop I'm not sure on. I've always done my games procedurally. I just create a new thread after I show my window and run all of the game code there. I've tried doing the finite state machine thing, if that's what you're talking about, and I can't imagine that being the way most engines go, so again, resources on those topics would be super helpful.

The idea behind the generic engine was to be something that would be capable of handling single and multiplayer, 2 & 3D versions of games ranging from gradius to metriod to devil may cry to an RPG or an RTS. I realize that there are varying components that don't overlap in those genres, but the goal here was to make something of a backbone, that would handle all of the major components and leave the game developer to setup and use them to create the desired game. I'm not intending it to be an FPS engine, but give the user the option to import his world and character data, throw in some bullet entities and drop a camera at eye level to recreate that effect. I may be over ambitious in this respect and if I am I want to know so I know where I need to cut back and what I can realistically hope for.

concerning the games I plan to make I have 6 games designed already that will be reliant on this engine to see the light of day, a traditional japanese style RPG, gradius style space-flight game, action game, action-puzzle game (think Devil may cry), tactical RPG and an RTS. I have no delusions on time, I'm kinda thinking life's work level of project here, I mostly want to get the engine done so I can dink out small games for fun here and there and have it not take too much time.

Thanks for the input, greatly appreciate it.

Share this post


Link to post
Share on other sites
Hi,

Just one thing to add. You seem to have defined target platform specs and listed a few things you need. However, I think you miss one mandatory spec for your engine: what will be the target games your engine is designed for. This spec is the one from which you will be able to derive the engine development priority list.

Ghostly yours,
Red.

Share this post


Link to post
Share on other sites
Quote:
Original post by Red Ghost
I think you miss one mandatory spec for your engine: what will be the target games your engine is designed for.


Quote:
Original post by EmpyrealHel
This engine needs to be able to accomodate any game type.


I Don't think he did.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this