Creating a Game Engine - Where to Start

Started by
10 comments, last by L. Spiro 11 years, 3 months ago

Hello,

I've been given a task to create a game engine, I am working on the graphics part of the engine. Now I don't know alot about creating an engine, I know what they do but thats about it.

Here is the scope of my problem.

I need to be able to allow a user to create objects to the screen in real-time, using input from the keyboard or mouse, either by typing command lines or clicking buttons, the user should then be able to place the objects where they desire by either being prompted to enter X,Y,Z cords or simply drag and drop (alot harder, will try to avoid that method).

I'm completely confused on even how to start this, I have fairly good knowledge when it comes to DirectX11 and I know how to create objects in a 3D space. But I have no idea how to do this, so I was wondering if someone could point in the right direction, what I should be looking at, I am constantly being told I should be using design patterns such as Factory Method or Service Locator, but I can't get my head round it. I guess what I am looking for is sample code of a working project which works similar to what I am trying to do, or UMLs which explain it better.

Any help would be appreciated, if my question is too bland please ask so I can help you help me..

Advertisement

So you area basically creating a scene editor?

My first comment is , if you are creating that, you are not creating a engine, but rather a editor. The engine part should be already done and it would simplify most of those operations.

So my first bet is to actually create something that renders your objects with hardcoded positions to the screen.

Then your editor would only , create, translate and rotate them around using your "engine" methods.

The factory Design pattern could help you in creating your objects, but its is not needed. Start simple.Get things done, then improve with your experience.

Check out my new blog: Morphexe

At the moment yeah, I have a system where I am able to hard code objects to the screen, adding in the coords (X,Y,Z) manually into the code I am able to create a scene, but this doesn't solve my problem. So whats my next move, how am I able to get this code to be more flexible so anybody can use the application to create what they want without knowing C++ or DirectX

Firstly ignore any advice you got related to patterns. That is general/overall advice and has nothing to do with getting started, nor anything to do with graphics. You can always find an excuse to use a pattern somewhere, but if and when you do it will be because you decided it was appropriate, not because someone told you do use a pattern and you went on a wild goose chase looking for where you can use them. They don’t work that way and it would be better to just forget about them and lighten your load for now.

How to start a graphics engine?

Create a window and a device.

Then create a 3D file format that allows you to load 3D objects.

Then create something that draws those objects.

Things get more open-ended around that point, so instead of continuing to list a step-by-step procedure it would be better if you came back with further questions at that time.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Firstly ignore any advice you got related to patterns. That is general/overall advice and has nothing to do with getting started, nor anything to do with graphics. You can always find an excuse to use a pattern somewhere, but if and when you do it will be because you decided it was appropriate, not because someone told you do use a pattern and you went on a wild goose chase looking for where you can use them. They don’t work that way and it would be better to just forget about them and lighten your load for now.

How to start a graphics engine?

Create a window and a device.

Then create a 3D file format that allows you to load 3D objects.

Then create something that draws those objects.

Things get more open-ended around that point, so instead of continuing to list a step-by-step procedure it would be better if you came back with further questions at that time.

L. Spiro

Ok, I have created a window, using hwnd, and Direct3D device aswell as a back buffer, what do you mean by a 3D File Format?

At the moment yeah, I have a system where I am able to hard code objects to the screen, adding in the coords (X,Y,Z) manually into the code I am able to create a scene
That would have been nice to know from the first post.

So whats my next move, how am I able to get this code to be more flexible so anybody can use the application to create what they want without knowing C++ or DirectX
By allowing them to select which 3D object they want to add to the scene. Probably by adding a Browse button.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Ok, I have created a window, using hwnd, and Direct3D device aswell as a back buffer, what do you mean by a 3D File Format?
If you want to load 3D objects, you will need to store the data inside of a file.
Make a file format that contains the 3D data for your models. Vertices, normals, materials, textures, etc.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Your question is really open right now, what do you mean by creating all they want?

Well thats a big question because you can't make a generic editor that will be used by everyone and to everyone needs, you need some sort of requirements. From your first post your requirements where: Create Objects, Translate and Rotate them in the world.

So start with that. You will need some sort of Scene Structure, do you have that? This would be where all the information of your scene is detailed, objects, positions, translations.

After that, you will need to decided what features you need, if your objects are sorted in list, you would need some sort of uniqueID, Name to distinguish them in the world.

After you have that, selecting a object would be a matter of requesting by that ID/Name, after that you could change your positions via other methods.

As I said, start simple, then keep adding features as you need it.

Check out my new blog: Morphexe

Ok, I have created a window, using hwnd, and Direct3D device aswell as a back buffer, what do you mean by a 3D File Format?
If you want to load 3D objects, you will need to store the data inside of a file.
Make a file format that contains the 3D data for your models. Vertices, normals, materials, textures, etc.

An easy format to work with is Wavefront OBJ (.obj)

All 3D modeling softwares export to this format.

I've worked with it using OpenGL, but since there are many open-source loaders for this format out there, translating it to DirectX specifications should be straightforward.

Programming is an art. Game programming is a masterpiece!

It should be mentioned that you should never load directly from .OBJ, .DAE, .FBX, etc. into your run-time. These formats should be converted to your own custom formats and loaded into your run-time with your own custom loader.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement