0
101 Aug 18, 2009 at 19:01

For the first time hear I am here , I want to say “HY ALL” and I salute all of you.

I am a student at a school in romania, my level of programming algorithms in the field I can say it is at an advanced level although I have never made a game using SDK/OpenGl/Direct3D/etc. although I heard a lot about them.

I want to make my license for the university in a “3D project “, if you ask why now I will have to answer as Luffy from “One Piece” : “ BECAUSE !”, funny but the truth is that from now on I want to know all about this interesting and captiveithing “ WORLD “ not only for the license but as for the future wen i wood like to working in a company that develops games / animation / etc.

The problem is that I want to learn to make a 3D graphics engine to learn to use graphics card drivers and more.

So what I want from you all is advice and examples for how to begin to build a graphics engine from 0 .

Please tel me what i need after i installd VC++ 8.0 and SDK.

Sorry for my BAD English.

#### 31 Replies

Please log in or register to post a reply.

0
102 Aug 18, 2009 at 19:54

first thing a beginner needs, and probably the MAIN thing he/she needs is the instinct of heavy, persistent and constant researching.

0
101 Aug 18, 2009 at 20:09

Of course, there are plenty of books, but your access to them may be limited.

Old, but good:

http://www.flipcode.com/archives/Elements_Of_A_Game_Engine.shtml

Try looking at the source code for open-source 3D engines like OGRE, Horde3D, Sauerbraten, or games like Quake. Don’t try to understand the nitty-gritty of each line, but rather see the overall code structure. It may be enough to go to docs. Frequent the forums for those packages and ask questions. The developers may answer.

Lastly, google, google, google.

0
102 Aug 18, 2009 at 21:33

try this link as well:
http://nehe.gamedev.net (opengl, c++)

you may like to research xna as well:
http://creators.xna.com (xna, direct3d, c#)

0
101 Aug 19, 2009 at 09:31

Interesting / exciting …
But after I read a large majority of the tutorials / info on how to do graphics engines , I have reached a conclusion that it is not what I was thinking it to be …
I was thinking that OpenGL/XNA/Direct3D will use the files directly as direct 3D shapes with color and … rather than simple images after transforming each one in “mash” / “map” / etc , not to mention there would be vectors with polygons , im not saying that there not cool and all but its not what i was thinking.
I remember when I first learned how to use the classes from MFC where I found a class that loads super fast image almost instantly, but processing each and every pixel it lasted a long/long/long time.
But when I upload images with my one class it took a lot of time but when I processd each pixel it did not take as long as id did with the other class from MFC and I reached a conclusion: that the class that was loading the files is not itself a class but a DLL and when I started studying the forms of existing DLL members , I realized that that bookstores MFC Classs of them were actually using ASM librarys.
The problem now is this: when you want to make a game of a “high caliber” sorry from my words, what I meant is for example the games that will be realist in 2010/2011 : “ Blade and Soul “/” TERA “(Lineage 3 code stolen from NCsoft) /” C9 “/ etc . these games in my opinion I dont think they have the same processing engine of OpenGL/Direct3D although some of there librarys may stile be there meaning that not only they restructured the graphic engine but also the transfer data between “<=> RAM <=> CPU <=> RAM ( 3D Card) <=> CPU (3D Card )<=>” specifying a new type of game that none of as can imagine it.

But I want to learn to program at this level because I have some “interesting” ideas I could create.
Sow what i want is some 1 telling me what i need to do in order to understand game programing at that level meaning reading files and settings up date from disk directly to the RAM of graphics card or normal RAM and using CPU only for algorithms and stuff .

Sorry form my English…

0
104 Aug 19, 2009 at 10:27

first thing you do is get a triangle rendering on the screen, once you can handle that you can make a bunch of triangles (which would be a mesh) then make it so the camera cant pass through the triangles (collision detection)

you have to make small demos before you can make a finished game, even tho i probably know you want the game right now, but you have to be patient. You probably are SURE that you can finish a game RIGHT NOW!!!!
But im sorry to say its just not possible first time.

To get good enough to make a real decent game takes years of hardworking self education.

Start with something small, my first game i pulled off a basic fps, but i had troubles getting the character to walk (walking models are harder than cars to get going) and it had tonnes of bugs.

I remember when I put it together I had a basic understanding of how dooms engine worked so I just went from there.

The project was a complete disaster! Im planning on coding much more different now I have a bit more experience.

Im coding my new engine all with interpeted plugins for the ai, and the main infastructure of the engine is just for displaying triangular models, and the plugins make the game behave and make everything animate.

Your first projects cannot be good for anything except educational purposes, no matter how smart you think you are, your probably not smarter than me. ;)

Oh yeh, without artists that are actually fully decent at fine art (im talking real special guys) then your graphics will suck donkey balls.

Just make sure you work this out, engines like crytech are made by guys that might as well be geniuses, making a full engine with all those features is NOT FOR A BEGINNER TO EVEN ATTEMPT.

0
101 Aug 19, 2009 at 12:42

You simply cannot go from not understanding what a game engine is to making, and managing, a “high caliber” 3D MMO by 2010. It just won’t happen.

Many, if not all, games are written as multiple layers over either DirectX or OpenGL. For example, a game may be a middleware layer consisting of multiple interacting components and libraries, over OGRE (a 3D rendering library), which itself interacts with DirectX, which itself interacts with lower-level OS functions.

It doesn’t mean coding a big game can’t happen later, but you are being very unrealistic about the complexity of the task.

You really need to read up on how games are made from a top-level view. Forget DLLs for a couple of days and get the big picture…

0
102 Aug 19, 2009 at 14:27

If you want to create something with limited time and budget, you have three choices:
- Creating a really simple game from scratch (e.g. tic-tac-toe)
- Creating a simple game using an engine (e.g. a space shooter using Torque)
- Modding an existing game (e.g. turn Unreal into a racing game)

Personally I find creating a mod a rewarding first experience with game development. It involves far less programming than starting from scratch: most things can be done with a scripting language. But you’ll be able to create something exciting and you get a lot of insight into game development.

0
101 Aug 19, 2009 at 14:41

If you want to use DirectX I would get:

Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach

or

Introduction to 3D Game Programming with Direct3D 10.0

and work from there. I’m not sure how far you will get but it’s a good starting point and you will learn a lot. I’m sure there are equivilently good OpenGL books if that’s your focus. In my view it doesn’t hurt to try something complex even if you fail becuase at least you get experience doing it.

0
101 Aug 19, 2009 at 16:15

I understand what you all are saying about creating a game or treying to do the engine itself .

Question :
1 ) If i want to join the NCSoft company what do i need to do , or a similar company for example thats in MMORPG game developing ?? Although im almost a beginner at this , and i have 1 more year of university “ + “ i want to do my Master in Game developing and 3D animation . ??

2 ) This is a long project for at list 3 years . I want do create my one Graphics System , what i mean my one OpenGL/Direct3D but different with something of my one ideas , after that i want to do a engine with it . The Question is : Where do i find infos on this mater , and how do i use the RAM / CPU of the Graphics Card ( ATI / NVIDIA /etc. ) directly ??

3 ) This a sort time project . I want to make a game but i do not have any ideas what to do but i need to finis it in less then 6 MONTHS . The Question hear is : Pls give me some ideas on the game and from where do i start coding ??

PS.: ROUNCER : Yes im a bit lazy but im not that stupid neither .

0
101 Aug 19, 2009 at 16:54

2) Hardware banging is illegal on most operating systems and the type of code is different from one card to the next. That’s why device drivers are used and OpenGL and DirectX are the interfaces to those drivers. One application programming interface for 3d graphics that didn’t cach on, Glide, was used by Voodoo graphics cards.

One thing you’ll need to know to understand how at least OpenGL works is to download Mesa from http://www.mesa3d.org/ and look at that. You’ll need to know really good linear algebra (also known as matrix math).

0
101 Aug 19, 2009 at 17:31

@Zyus

The Question is : Where do i find infos on this mater , and how do i use the RAM / CPU of the Graphics Card ( ATI / NVIDIA /etc. ) directly ??

I’m sure the information is out there but if you want to do game programming that’s the last place you want to start (or finish). That’s mainly for writing drivers. Writing a game that bypasses DirectX or OpenGL is slightly more fun than being hit by a tactical nuke. I wouldn’t recommend it. Your game will be out of date in no time and the support will be a nightmare. If you want to program games, stick to DirectX or OpenGL at minimum, or you can use an existing game engine of your choice. DirectX and OpenGL have plenty of lower level functions that let you do a vast amount of customization. You also have the shader languages. You really shouldn’t have to go any lower than that.

I used to write low level graphics routines for very old graphics cards years ago. I had to write every pixel to the screen. It has it’s charms but the time for that has come and gone unless you are doing something extremely specialized and have very good reason for doing it.

0
101 Aug 19, 2009 at 18:57

@Zyus

If i want to join the NCSoft company what do i need to do , or a similar company for example thats in MMORPG game developing ??

You have to:

1. get a degree in software development or computer graphic design depending on what part of a game design team you want to join (coder vs. artist). You can get a general CS/Art degree or a “game development school” degree. It’s debatable as to what would serve you better. I favor the latter because it’s generalist, once you join a company there’s still plenty to learn, and it’s reusable in other industries. Some prefer the focus and networking of the latter.
2. build a portfolio in that field. Either software prototypes, or digital assets in graphics.

@Zyus

This is a long project for at list 3 years . I want do create my one Graphics System , what i mean my one OpenGL/Direct3D but different with something of my one ideas , after that i want to do a engine with it . The Question is : Where do i find infos on this mater , and how do i use the RAM / CPU of the Graphics Card ( ATI / NVIDIA /etc. ) directly ??

You want to write a drop-in replacement for Directx/OpenGL?!? Good lord, why? I want to drive to work, but I am not going to build an alternative rubber making factory, then build a tire, then build a car.

You are probably looking at the industry romantically, and are mesmerized by everything that goes on in it, so naturally you want to know about it all. But, it’s a huge field!

Ask yourself: “Ten years from now, I will be most happy if I am doing _______.”

What is is? Writing WDDM or WDDM-like code? Writng an engine that game developers use? Writing a game?

You can’t master all those levels.
@Zyus

3 ) This a sort time project . I want to make a game but i do not have any ideas what to do but i need to finis it in less then 6 MONTHS . The Question hear is : Pls give me some ideas on the game and from where do i start coding ??

If you have a fixed six months, consider using an existing 2D engine and make a good, simple 2D game.

0
101 Aug 19, 2009 at 20:49

@Zyus

2 ) This is a long project for at list 3 years . I want do create my one Graphics System , what i mean my one OpenGL/Direct3D but different with something of my one ideas , after that i want to do a engine with it . The Question is : Where do i find infos on this mater , and how do i use the RAM / CPU of the Graphics Card ( ATI / NVIDIA /etc. ) directly ??

Good lord indeed. I’m all for writing your own engine, it’s a great learning experience… but writing your own API? Thats going a little too far. If you had 20 years to do this project, then maybe… but even that’s pushing it.

0
101 Aug 19, 2009 at 20:59

Thank you alphadog for the good advice given on the first question.
As for the second Question i guess all three of you are totaly and otherly correct , i do not think il become driver developer but a engine writer if it will be the case although i love to do every little thing my self .

I guess i cant do all of them sow il stick with writing a game for my license exam , but i do not know what game i cant writer down in this 6 months sow that i can get a nice mark for my work and finding a job in this domain with the game il be making .

And for the Question that alphadog sayd to ask myself :”Ten years from now, I will be most happy if I am doing GAME DEVELOPING FOR A MMORPG COMPANY.” the problem is that i do not know if there are any MMORPG companys hear in Romania although i doubt it , any way it dose not matter thats what i want to do and that is what il do .

0
101 Aug 20, 2009 at 00:27

If that is the case, forget developing the new DirectX (I think most would agree here) and forget developing a game engine (some won’t agree, but if anything, at least prioritize making a game versus making a game engine, which could take you 6 months to “get it right”).

Get a 2D library (since you are studying C++, I’d recommend SDL, SFML, Haaf’s or PTK) and build a game.

As for what kind of game, does it have to be original? Try picking your favorite boardgame or card game. Do a side-scroller. Doesn’t matter. The idea is not to make a game that will make you rich. The idea is to make all your initial mistakes on throwaway games.

0
101 Aug 20, 2009 at 07:06

Alphadog to create a game in 6 months i thought i can do a simple 3D game with collision detection ( 2 types : 1) one object colliding with an other object , 2) hit {damage} to an object ) / character creation {3DMax or something} / polygons of an object to be between maxim and minim / sound and virtual effects / last but not list the map can be created bay any one . Sow i guess thats all you need to create your on Q2 from scratch .
Sow what do you think alphadoq about my idea ??? What do i need to do in “ + “ or “ - “ to what i sayd ??

0
104 Aug 20, 2009 at 07:52

If i was going to make a game for the first time, id probably start off with a world like wolfenstien, made out of cubes with simple texturing to make a doungeon. Im sure you could probably finish that.

Then you could try to add the monsters, but that would be tricky.

0
101 Aug 20, 2009 at 09:51

After reading a lot of the forum topics and trying to understand it all i come 2 a conclusion and that is : i cant say i`l make a game at this time and with the knowledge that i have now, sow first i need to gather up a lot knowledge in one of this domains : OpenGl/DirectX . But i do not know with what to start and what is easy to understand at the beginning of the “road”.

Sow PLS/PLS/PLS help me start to walking on the “road” and say what is bather and easy to start off with OpenGL or DirectX .

0
104 Aug 20, 2009 at 11:25

I use Direct X.

open gl is used by lots of people too, i like it i had a small glance myself, but they both DO THE SAME THING MAN.

If you finish something, post it up here and be proud of it, even if it only looks like PS1.

0
101 Aug 20, 2009 at 11:51

If you want to start at 3D, rouncer’s idea of a minimalist Doom clone would *maybe* be easy enough to do in six months.

As for the DirectX/OpenGL duo, I would say that it’s more practical to start with DirectX, but this is one of those debates where it doesn’t matter. What you learn with one is largely transferable to the other.

Actually, if you are really intent on making a game, the first thing you should probably learn the API of whatever first game engine you use…

0
101 Aug 20, 2009 at 16:51

I installed DirectX (SDK) and have some examples but I do not know with what to start off with and where to fined nice tutorials , Videos if possible .

Something similar to : http://nehe.gamedev.net .

0
101 Aug 20, 2009 at 18:08

For DirectX I would again seriously recommend:

Introduction to 3D Game Programming with DriectX 9.0c A Shader Approach

Assuming you can get your hands on it. I don’t recommend books lightly. There are a lot of crappy authors but Frank Luna isn’t one of them. This book takes you though step by step and is a good starting point. You can probably find the information around on the web but in a good book you have it well organized and laid out in a logical fashion. It will save you a lot of time and in my view it’s a good investment. You can also download the sample programs which again will give you a big leg up.

0
117 Aug 20, 2009 at 19:01

http://scientificninja.com/advice/write-games-not-engines - read this first before you start developing an engine.

I think I’m being a little like paradox right now to this article - I write engines (yeah and other people develop games under it), but don’t do this when you begin programming. Designing good engine is often even harder than designing good game, especially if you need something general.

#OpenGL/D3D topic (I hope this won’t end in flamewar … I don’t wanna write this) - both apis do the same thing, and most likely if you learn one then using other one is very easy. They’re both on same level now (from time to time one has advantage over other, but that is always maximally for few months). Which one you choose is just on you, I won’t recommend any of them (know both, both are very good) - it’s the matter if you like writing with GL more or writing with D3D more - that’s all.

Good lord indeed. I’m all for writing your own engine, it’s a great learning experience… but writing your own API? Thats going a little too far. If you had 20 years to do this project, then maybe… but even that’s pushing it.

20 years wtf? … Damn I feel old now :-/
Anyway, rahter not try to create your own api (or rather not when you’re beginning with 3D), it’s really lots of studying and when you also work along with that it’s really long-term work - I’m writing my real time ray tracing library for pretty long time and it is usable, not finished (hope to finish it when Larabee comes :D … joking … it’s my hobby project and it still needs lot of time to be in state when it’s finished, if it ever be finished - there is never enough technologies to be implemented + I do some research on it, so let’s say I have hobby for LOT of time)

0
101 Aug 20, 2009 at 21:47

@Vilem Otte

http://scientificninja.com/advice/write-games-not-engines - read this first before you start developing an engine.

Bahhh! I came here to escape gamedev.net and its (cough!) mods and now it’s following me :) In any case I think people can and should make their own informed decisions on if they need or want to write a game engine or not. There are no hard and fast rules. I think there are good points on both sides, not the least of which is the knowledge and experience gained.

0
117 Aug 20, 2009 at 22:03

Bahhh! I came here to escape gamedev.net and its (cough!) mods and now it’s following me

Sorry, I said that just because the article is well known and imnsho if someone wants to write engine then he should.
As I said I’m very good case on this, I read this article - it is not that bad, also it miss many important things and opinions (like that designing an engine is not-that easy, but that’s not my point right now) … I actually never wrote any bigger game and also I’m an engine developer/programmer (I was and I will be … I like and enjoy this work).
All I said is that writing an engine is often harder than writing game.

I pointed out the article because it might help one to decide what to write in the beginning, personally I’m not sympatic with scientific ninjas opinions here (I was pointed several times on this article too - though my answer was always “I’m actually (game)engine programmer (well in fact I programm other stuff than engines too), I’m not game developer - thus I won’t write games, I will write engines.”

0
101 Aug 21, 2009 at 00:12

@Vilem Otte

Sorry, I said that just because the article is well known and imnsho ….

No big deal I was mostly joking :D I just got tired of being told what the “correct” opinion was. I don’t mind arguments, even heated ones. However when it comes to the point your posts are being deleted for any excuse or the mods themselves start to get rude (in fact the only people who were ever rude to me there WERE the mods), I draw the line. It’s like they are a bunch of teenagers who suddenly got a little power being mods and damned if they aren’t going to use it. There was also have the infamous rating system which again, if you disagreed with the mods your rating would drop like a rock. Ok well now I’m off topic :)

0
101 Aug 21, 2009 at 01:11

Spiking of game engines , wen you want to do a collision detection or a moving object that needs to detect something in game or from the keyboard do you create a special “thread” for that , and return the math value in the main project ????????????

0
101 Aug 21, 2009 at 01:43

@Zyus

Spiking of game engines , wen you want to do a collision detection or a moving object that needs to detect something in game or from the keyboard do you create a special “thread” for that , and return the math value in the main project ????????????

I don’t personally use a separate thread for collision detection. I like to keep threads to a minimum. There are valid reasons for using threads. If you have a multiple cores then you will need extra threads to make use of them. Also using threads makes some jobs easier. However in my opinion they are often over used. There is overhead associated with them and there are synchronization issues which can get to be a nightmare if your threading model is designed incorrectly. In any case threads and collision detection are somewhat separate issues.

3D collision detection can be tricky. The basic algorithms aren’t so bad. It’s the special cases and rounding errors that can kill you. I did my own but you can always download a physics engine if you want to save yourself some trouble.

0
117 Aug 21, 2009 at 10:59

I’d advice to use NVidia PhysX, in my opinion very good physics engine that saves you (as mentioned) lots of trouble.

On the other hand it is a challange - implementing your own collision detection algorithm.
Although then comes rigid body simulation and such stuff and you probably would switch to:
a) some physics engine (NVidia PhysX, Intel Havok, Open Dynamics Engine, an others)
b) write collision detection and physics simulation on GPU (I think that NVidia PhysX supports it, but just on NVidia GPUs, although doing this on GPU is very fast … now with CUDA and OpenCL it’s even easier and less trickier to do this)
c) write your own physics (this on the other side is much more work, although you can view lots of open-source physics engines for samples - that might help)

About me - I use NVidia PhysX and some tricks from my older one (GPU Navier-stokes for fluid dynamics, few tricky things for grass physics, and so).

#Threading topic - if you wish to you threads, then you can … although I think that 1 thread can take care of whole game, but I use more threads - sometimes their synchronization might become a little nightmare, it really needs very good designing of engin and of course use threads just where they are needed (in my case as much as possible for ray tracing in real time + one or two for physics + game).

0
101 Aug 21, 2009 at 12:29

@Zyus

Spiking of game engines , wen you want to do a collision detection or a moving object that needs to detect something in game or from the keyboard do you create a special “thread” for that , and return the math value in the main project ????????????

(Try to start new topics when your questions are unrelated to the first.)

Most game engines provide varying collision detection systems. Sometimes, the basic ones in most game engine packages are not enough for advanced needs. Rendering engines usually do not provide any.

As for threading, basically you can’t just spin off threads willy-nilly and without thought. There are lots of repercussions. First, you want to manage overhead of threading versus amount of time processing. You want to be aware of your resources and prevent race or deadlock conditions. You have to set up thread pools and determine best settings. You have to worry about re-entrancy, context, etc, etc, etc. It definitely complicates code.

0
101 Aug 21, 2009 at 14:23

A few more things since you said you were interested in MMORPGs. Online games typically don’t have really complex collision detection. The client often only has to check for its one avatar and that’s often done with a single bounding ellipsoid and the mesh. One reason is that online games have network communication time and a complex collision model would quickly put clients out of sync. Also MOBs really don’t need collision detection because they are controlled by pathing, so assuming the pathing is correct the MOBs will stay where they are supposed to. There are still line of sight calculations and so forth but those are relatively easy once you get the ellipsoid to mesh collision working.

The hardest part about that is keeping your ellipsoid out of the mesh. This can be tricky because of cumulative rounding errors during the collision response phase. Say you are sliding along a wall. If you get a little closer every step because of a rounding error it’s easy to end up in the wall. One solution is to back off some buffer distance when you hit something. However one problem with that is if you back off at a highly oblique angle you might still be close to the plane you just hit. Also you can’t back off perpendicular to the plane because it can push you into another plane so to be safe you have to use the path you just took.

A second issue is multi-plane collisions. For instance if you are traveling up a small valley formed by two planes, the collision response is not directed by a single plane but the combination of both planes. There are cases where you might even have three, four or more planes to contend with. In that case you need to select the path of least resistance relative to your force vector.

In my case I had the added complexity of a round world. On occasion I have to stand my avatar upright because as he travels he is slowly rotating. That means I have to maintain some tiny slop zone so his head doesn’t slip into a wall. The smaller the world vs the size of the avatar the problem gets worse and I need a bigger buffer zone.

My final solution that covered everything turned about to be non obvious. I copied the basic collision code from a paper but by the time I was done I had rewritten all of it because there were so many little details that weren’t covered. If you look around on web forums you will sometimes find discussions about many of these issues. I really did not find a single source that covered everything I needed to know. My friend who plays WoW even told me that after one recent update they had changed something it the collision detection and he would get stuck on small ridges sometimes. I’m not sure if they fixed it but if a mature program like WoW can have issues you can imagine there are a lot of details to cover.