# Off-Topic Discussion > The Lounge > Tech Talk >  >  I want to start working on my own game...

## slayer

Right, so I want to make my own simple 3D engine and my own game...

Most of you are probably going to say "Use C++" and if that's the best thing to use, then I will.

But where do I start? Where do I use C++? Is there a base template on the internet I could use to start a game?

All help would be appreciated.

----------


## John11

The only game programming I've done is with OpenGL and C++.  It was for a computer graphics class.  My group made a very simple first person snowball throwing game that took place in a dungeon.  You might want to check out some OpenGL tutorials unless someone that has done more game programming else has some better ideas.

Keep in mind that even creating a simple 3d engine is no simple task.

----------


## Marvo



----------


## Ynot

You don't mention if you have any programming experience....
(I'm assuming not)

C or C++ is probably the best thing to learn
almost every other language out there bases itself on the syntax of C
learn C or C++, and other languages will be simple to pick up

Also, games (due to the need for speed) are almost always in C/C++

If you don't know C or C++, then starting with complicated games is probably not the best way to learn

First up is to learn the language

you'll need some references and tutorials, so have a browse through these
www.cprogramming.com
www.cplusplus.com

Get the basics of programming down

then make a really simple game
(hangman, snake, digdug, whatever)

Moving on to real, complicated games, can I suggest you start out modifying an existing game.
To jump straight in the deep end will leave you completely confused
and making your own game engine is probably out of the question (have you ever seen any? they make your head hurt)

Pick an open source game that you're interested in
then change it

After that, you can take an existing open source game engine, and make your own game using the engine

Open source is your friend
learn from what others have done

----------


## slayer

I'll probably go for the simple stuff, then work on editing Half-Life or something...

----------


## ninja9578

3D engines are easy, the problem comes from optimizing them.  Most games have millions of objects on the screen at once.  OpenGL can render then all, but it will take forever.  The "engine" actually sorts and clips the parts out that don't need to be drawn.  That's hard and requires you to know how to use and implement an Octree Data Structure, and BSP mapping.

C++ is a good language to learn, but there are some things in it that make it difficult to understand at first (pointers, virtual methods, polymorphism, mutlithreading)  Most programmers use smart pointers, but when working with graphics, that's impossible.  I recommend writing things like AI and such in C++, but using something a little more powerful than OpenGL for the actually graphics engine.  Dark SDK is a C++ wrapper around the Dark Basic engine.  I'm pretty sure that Dark SDK is free, and it's easy to use and does clipping and such for you.  The only problem is that it uses the some-what deprecated DirectX 9.

----------


## slayer

Please don't mention Dark Basic again ;__;

I had to use that in one of my classes and almost died from using that piece of crap...

----------


## ninja9578

I didn't.  Dark SDK is a C++ SDK (Software Development Kit)  From what I know it's API is very similar to OpenGL and DirectX (XRotate, XScale, XMatrix...)

----------


## arby

While these guys are suggesting more low level solutions, I'll show you your higher level options =P

If you want to use a C family language, you could always develop with C# and XNA (Microsoft's development platform that will make your game compatible with both PC and Xbox). C# tends to be much nicer to the starting developer with all the nice things like a expansive library, garbage collection, being mostly thread safe and stuff....

The platform I use the majority of the time is flash. You can pick up the trial from the adobe website if you want to try it. The language is quite newcomer friendly (as far as languages go) and the distributive ability of the finished product is what makes me use it.

Both those solutions are not nearly as efficient or powerful as C/C++ though, and only flash CS4 has hardware support for 3D. It really depends on what you want to make.

----------


## [SomeGuy]

> While these guys are suggesting more low level solutions, I'll show you your higher level options =P
> 
> If you want to use a C family language, you could always develop with C# and XNA (Microsoft's development platform that will make your game compatible with both PC and Xbox). C# tends to be much nicer to the starting developer with all the nice things like a expansive library, garbage collection, being mostly thread safe and stuff....



C# requires .NET framework, a heft file. Not reccomended.




> The platform I use the majority of the time is flash. You can pick up the trial from the adobe website if you want to try it. The language is quite newcomer friendly (as far as languages go) and the distributive ability of the finished product is what makes me use it.
> 
> Both those solutions are not nearly as efficient or powerful as C/C++ though, and only flash CS4 has hardware support for 3D. It really depends on what you want to make.



Flash is pretty win, I used to make stuff.

Did Adobe make AS4 for CS4? OR did they keep it at 3?

C/C++ is the best. Also, there is an engine called RealityFactor you might want to look at.

----------


## ninja9578

I recomend against flash, it doesn't have any hardware support, so it's slow.

----------


## [SomeGuy]

For a full 3D game, flash = fail. C++ would be good.

Oh, and my bad; it's Reality Factory. Link

----------


## GestaltAlteration

I'm right there with you, I would love to throw together some games three dimensional or something like a MUD.

In any case I'm starting down the road of learning C++ and thus far haven't gotten past "Hello, world!". It certainly isn't something you can get in a day. Wikiversity is a pretty good place to start learning.

----------


## [SomeGuy]

> I'm right there with you, I would love to throw together some games three dimensional or something like a MUD.
> 
> In any case I'm starting down the road of learning C++ and thus far haven't gotten past "Hello, world!". It certainly isn't something you can get in a day. Wikiversity is a pretty good place to start learning.



lulz I got to pointers in one night. i have other programming experience, so that's probably why. I could give you private lessons. You too slayer.

I should make a thread for that...too bad I'm not too far,but a study group would be cool. I'm doing that, later.

----------


## slayer

> I'm right there with you, I would love to throw together some games three dimensional or something like a MUD.
> 
> In any case I'm starting down the road of learning C++ and thus far haven't gotten past "Hello, world!". It certainly isn't something you can get in a day. Wikiversity is a pretty good place to start learning.



Well it seems someone is a Chaos;Head fan...


_Who's eye's are those eyes?_

----------


## GestaltAlteration

> lulz I got to pointers in one night. i have other programming experience, so that's probably why. I could give you private lessons. You too slayer.
> 
> I should make a thread for that...too bad I'm not too far,but a study group would be cool. I'm doing that, later.



Yeah I haven't been too on top of studying it, plus I was actually looking into C, though now I see I should just jump right into C++.

A study group sounds very cool. :3





> Well it seems someone is a Chaos;Head fan...
> 
> 
> _Who's eye's are those eyes?_



I told you I'd be taking this for my own once you changed signatures. You were forewarned!

EDIT: Good resource: http://en.wikiversity.org/wiki/C&#37;2B%2B

...

----------


## [SomeGuy]

Should we do the study group through email, or PM?

And slayer, you wanna be invloved?

----------


## GestaltAlteration

> Should we do the study group through email, or PM?
> 
> And slayer, you wanna be invloved?



We could all hijack a room in DV chat. Easiest and most responsive, then move on from there-- PMing questions or whatever.

----------


## ninja9578

Could of major C++ points that you will need to do a real game:

pointers (real pointers, not smart ones)
multithreading and mutex controls
inheritance / polymorphism
Callback functions
O3 optimization, code stripping

----------


## slayer

> We could all hijack a room in DV chat. Easiest and most responsive, then move on from there-- PMing questions or whatever.



We could get together and try to make our own game?

Would it be easier for us to mod a game like Half-Life? Or start something from scratch?

I want to make a fast first person shooter with awesome particle effects and stuff...what about you guys?

----------


## [SomeGuy]

I think start from scratch;more of a learning experience. And my computers suck, we could make it compatible for me lul.

----------


## slayer

lol...

Ok well if we are going to make a game, then we'll have to agree on what kind of game we're making.

Suggestions?

As I said, I wanted to make a fast fps game with some nice looking effects (I can photoshop things) for some laidback fun and casual gaming.

----------


## [SomeGuy]

> As I said, I wanted to make a fast fps game with some nice looking effects (I can photoshop things) for some laidback fun and casual gaming.



Add MMO, and a Bioshock theme;

You win.

----------


## GestaltAlteration

You could always just take Doom and use doombuilder, which allows you to do a ridiculous amount of stuff FPS-wise.

But half-life is good too.

Myself, I was just in it to learn basic C++, not to making games yet, reasons evident in ninja's post.

----------


## [SomeGuy]

Doom 3? Why don't you kill my computer...

OMG BIOSHOCK ON ThE DOOM 1 ENGINE.

Let's do this boys.

----------


## GestaltAlteration

> Doom 3? Why don't you kill my computer...
> 
> OMG BIOSHOCK ON ThE DOOM 1 ENGINE.
> 
> Let's do this boys.



Nah I meant Doom 1/2  :tongue2:  My computer sucks too.

----------


## slayer

Jeeze you guys...

I can run Portal, Left 4 Dead, and all Half-Life games on max settings no problem XD

----------


## [SomeGuy]

I can run...Doom 2 at full speed. Beat that.

----------


## slayer

I could probably run 1000 Doom 2's at full speed...

----------


## [SomeGuy]

How did you get this beast of a computer?

----------


## slayer

Eh it's not really a beast...

I would love to get a new computer. It's just that the graphics card is really really nice.

8800GTS 320MB got it off Ebay for less than $100 brand new :3

----------


## arby

> I'm right there with you, I would love to throw together some games three dimensional or something like a MUD.







> For a full 3D game, flash = fail. C++ would be good.







> I recomend against flash, it doesn't have any hardware support, so it's slow.



Pfffft, you 3D people

I'm a total 2D junkie ;P

----------


## GestaltAlteration

> Pfffft, you 3D people
> 
> I'm a total 2D junkie ;P



Well a MUD is not only 2D, it's purely text-based.  :tongue2: 

3D would be awesome, but I'm seeing it as a bit too ambitious at this point.

----------


## [SomeGuy]

You can easilly make that in cpp. a text based counterstrike...lul              go north             you got pwned by knife' nOOb.

----------


## arby

> You can easilly make that in cpp. a text based counterstrike...lul              go north             you got pwned by knife' nOOb.



XD

Include "reaction time answers" too

----------


## slayer

That'd be fun  :tongue2:

----------


## ninja9578

```
#include <iostream>
#include <unistd.h>
int main(){
   std::cout << "So how's the learning of C++ going?"  << '\n' << :D;
   sleep(5);
   return 0;
}
```

----------


## [SomeGuy]

Pretty good, I'm learning from cprogramming.com. I have fallen in love with this language, I just want to learn GUI programming too. How do people do that on Linux? I understand windows.h has things like MessageBox() and stuff, but for other platforms...?

Also, do you have any good guides for the windows.h too?

----------


## ninja9578

wxWidgets.  It's cross platform and soooooooo much easier to use than the windows API.  That's what I use at work.  Works on every major platform.

----------


## Ynot

wxWidgets is good

write once
compile on Gnome -> GTK+ widgets
compile on KDE -> QT widgets
compile on Mac -> Cocoa widgets
compile on Windows -> Win32 MFC

There's also Mozilla's Xulrunner
as used by Firefox and other Mozilla apps
same sort of thing as wxWidgets, but all the info for widget placement and operations are written in XML and interpreted on build

----------


## ninja9578

There are some differences, I've got a few preprocessor commands in my software

----------


## [SomeGuy]

Cool! I will definatley check out wxWidgets.

A few questions:
1. Do VC++ apps require .NET Framework?
2. Which versions of VC++ require .NET Framework?

----------


## ninja9578

You should never use Visual C++, outside of Microsoft, businesses don't use it so learning it would hinder you in the long run.  You want GNU C++.  You just have to set up .NET to use it.

----------


## [SomeGuy]

I'm on a linux machine though...I don't have the .NET Framework. And, I'm using g++ command line compiler, so I don't really need it. I'll stick with GEdit and that.

----------


## ninja9578

Oh, then you have to use GNU.  Make sure that you learn how to create a  make file.  When you have a project with hundreds of files in it, you can't be putting all of that into the command line  :tongue2:

----------


## [SomeGuy]

Yeah, I never got arounfd to learning Makefiles yet. They seem helpful, I'll look into them.

----------


## slayer

I think the first thing I'll learn how to do is create my own NPC in half-life.

I'm already learning how to model, and I've already made one player model (not finished though, I decided to start on a new one). I'm hoping it won't be too hard.

----------


## [SomeGuy]

Wait, aren't makefiles just shell scripts with a command line for compiling all the project files in it?

----------


## ninja9578

> I think the first thing I'll learn how to do is create my own NPC in half-life.
> 
> I'm already learning how to model, and I've already made one player model (not finished though, I decided to start on a new one). I'm hoping it won't be too hard.



Modeling is fun too.  I'm a very good modeler, I'm currently working on a game with a prebuilt engine so the only coding that I will be doing will be the AI, but all the models and textures will be custom  ::D: 





> Wait, aren't makefiles just shell scripts with a command line for compiling all the project files in it?



Yes, highly useful for very large projects, especially with large projects or lots of libraries.  I have my IDE create a makefile for me, but it's well over 200 lines of code, not something I'd want to put into the commandline every time that I want to compiler.

----------


## [SomeGuy]

Oh cool. What IDE do you use? And what do you normally program?

----------


## slayer

> Modeling is fun too.  I'm a very good modeler, I'm currently working on a game with a prebuilt engine so the only coding that I will be doing will be the AI, but all the models and textures will be custom



Well I'm having issues with animations...and I haven't even started the head yet  :Sad: 

Edit: Nevermind! Animations are coming along nicely!

----------


## ninja9578

> Well I'm having issues with animations...and I haven't even started the head yet 
> 
> Edit: Nevermind! Animations are coming along nicely!



Heads are hard.  Animations are cool.  Here's a tutorial that I wrote a while ago about cutscenes using Blender http://forum.thegamecreators.com/?m=...&t=141108&b=24





> Oh cool. What IDE do you use? And what do you normally program?



At work I use Dev-C++.  I should move over to wxDev-C++ because Dev-C++ is deprecated, I'll do it soon  :tongue2:

----------


## slayer

[quote=ninja9578;1061223]Heads are hard.  Animations are cool.  Here's a tutorial that I wrote a while ago about cutscenes using Blender http://forum.thegamecreators.com/?m=...&t=141108&b=24

I'm having a lot of issues with the uvmap...

I can make a uvmap, but my texture doesn't line up with the model at all. It's completely distorted and everything, even if I try to single out parts like the hands and stuff.

I'm using LithUnwrap

----------


## slayer

Well here's a screen shot of what I made  :tongue2:  I didn't bother making the head because I really wanted to try it out.

And it seems I've got some problems :/




But I'm very surprised with how fast it took to make this...I just need to figure a few more things out to get everything working, then I think when I get everything down, I'll make a Lucy player model :3

The left hand's fingers are messed up, and some of the triangles aren't showing up...I don't know why it's doing that...any suggestions?

----------


## ninja9578

Looks more like your normals are facing the wrong way, recalculate them.  The texture seems fine as the pants work right.

----------


## [SomeGuy]

> At work I use Dev-C++.  I should move over to wxDev-C++ because Dev-C++ is deprecated, I'll do it soon



Dev-C++ is deprecated?!? I didn't know! I like it a lot.

----------


## slayer

> Looks more like your normals are facing the wrong way, recalculate them.  The texture seems fine as the pants work right.



My uv map is what is really killing me...it doesn't work for crap.

None of the textures align up with whatever I'm trying to do...

----------


## ninja9578

You must be cutting it or skewing your textures improperly.  Post a copy of your texture, and your UV map.

Yes, De-vC++ has not been maintained for a few years.  Use wxDev-C+.  Same layout, better debugger and intergration with wxWidgets.

----------


## [SomeGuy]

Hmm...I will download. wxWidgets seems pretty easy. I saw a few tutorials.

----------

