Go Back   OnRPG Free MMORPG Forums > Other > Game Archive > Games Database > Development > General Programming

 
 
LinkBack Thread Tools Display Modes
Old 01-04-2007, 04:29 AM   #1 (permalink)
500+ Posts????
 
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
Default Setting up for programming. Help!

Alright, I'm getting started in the whole C++ thing, though I never wanted to. I have programming experience, but its mostly just in scripting languages and online programming (Java, PHP, etc). I also know VB (6.0 and .Net). I understand the syntax of C++ and have written some very basic and dull programs (all those dumb little computing things that run in a DOS prompt window...yipee).

Anyway, I'm trying to get my computer setup to start working with C++ and DirectX game programming. This is where I get lost.

I need to install the Windows Platform SDK (to develop 32 bit windows applications...apparently). So! There are a few options on the site, but I don't know which applies to me. Do I need the AMD64, the ia64 or the x86 SDK? And what do any of those mean anyway?

See, I'm a very visual person, so the straight, obscure syntax world of C++ has always confused me. I don't get polymorphism or dynamic memory. Namespaces annoy the crap out of me and I don't fully understand their usefullness unless you're switching namespaces for different phases of the game (start menu, main game, combat, etc) and then, couldn't you just use the same namespace? Cuz from what I can tell, all they do is allow you to use repeating variable names (or variable "identifiers" as the arrogant tutorial writers seem to call them).

I mainly just don't get the landscape of a C++ program. For instance, the Header files. Aren't they the same as the source code file? Just groups of functions that you call when their needed? And, if so, couldn't you just create those in the main code? Granted, this makes the code not very portable, but am I misunderstanding their purpose?

So, if anyone has some advice for me, I'd really appreciate it. And if possible, try to just help me understand, don't just post links to C++ tutorials. I'm fairly certain I've read them all (not literally) and they either assume you already know C or C++ or you know nothing. I'm somewhere in the middle and can't find anything useful.

So, help? Or, if you want to save me the trouble and volunteer as a coder for me, that'd work too :smile:
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats."
~ Howard Aiken
Khanstruct is offline  
Old 01-04-2007, 09:21 PM   #2 (permalink)
McFox Sandwich
 
Join Date: Jul 2006
Posts: 463
Reputation: 10
Default

Well first I say use OpenGL. Its better and works with all O.S.'s as DirectX only works with windows. - correct me if Im wrong-

For the "using name space" that saves you from using that same name again like this.
Code:
using namespace std;
int main ()
 cout <<"Hi"; /* That is where std will come in.
                       sorry this is a little sloppy and incomplete */
as oppesed to doing this
Code:
int main ()
  std::cout <<"this is more annoying";
Header files -when created- will go in your project tree. if you didnt know the preproccsesser (#include <filename>) then thats what you could do to add your own custom header files exept it would be <filename.h>.
Cj Shadows is offline  
Old 01-04-2007, 10:23 PM   #3 (permalink)
Crumbly, but Good
 
Eriond's Avatar
 
Join Date: May 2006
Location: Montreal
Posts: 1,645
Reputation: 67
Send a message via MSN to Eriond
Default

Quote:
Originally Posted by Khanstruct View Post
Alright, I'm getting started in the whole C++ thing, though I never wanted to. I have programming experience, but its mostly just in scripting languages and online programming (Java, PHP, etc). I also know VB (6.0 and .Net). I understand the syntax of C++ and have written some very basic and dull programs (all those dumb little computing things that run in a DOS prompt window...yipee).

Anyway, I'm trying to get my computer setup to start working with C++ and DirectX game programming. This is where I get lost.

I need to install the Windows Platform SDK (to develop 32 bit windows applications...apparently). So! There are a few options on the site, but I don't know which applies to me. Do I need the AMD64, the ia64 or the x86 SDK? And what do any of those mean anyway?

See, I'm a very visual person, so the straight, obscure syntax world of C++ has always confused me. I don't get polymorphism or dynamic memory. Namespaces annoy the crap out of me and I don't fully understand their usefullness unless you're switching namespaces for different phases of the game (start menu, main game, combat, etc) and then, couldn't you just use the same namespace? Cuz from what I can tell, all they do is allow you to use repeating variable names (or variable "identifiers" as the arrogant tutorial writers seem to call them).

I mainly just don't get the landscape of a C++ program. For instance, the Header files. Aren't they the same as the source code file? Just groups of functions that you call when their needed? And, if so, couldn't you just create those in the main code? Granted, this makes the code not very portable, but am I misunderstanding their purpose?

So, if anyone has some advice for me, I'd really appreciate it. And if possible, try to just help me understand, don't just post links to C++ tutorials. I'm fairly certain I've read them all (not literally) and they either assume you already know C or C++ or you know nothing. I'm somewhere in the middle and can't find anything useful.

So, help? Or, if you want to save me the trouble and volunteer as a coder for me, that'd work too :smile:
I wouldn't reccommend jumping to DX right away. Infact, me being myself, I wouldn't reccomend DX at all, I'd go for OpenGL. (just because it's Microsoft unilaterally controlling DX, and it's only for Windows) But before you do that, you should probably learn something a little simpler like SDL or the windowing API of the system you're on. (I'm assuming yours is Win32)

As for the Windows SDK, yes you do need it, especially if you want DX applications. Basically, if you're under a 32-bit processor, then you probably want the x86 version. If you've got a 64-bit, you need to know whether it's Intel or AMC and download the appropriate version.

Header files are damn useful, becuase you can choose to include them in multiple files, so that you don't have to keep re-writing the same code over and over again. (E.G. defining types, prototypes, global variables)

Soo, yeah. Don't jump to DX right away, try learning some Win32... which I leanred from here:

http://www.winprog.org/tutorial/
__________________
Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame
Eriond is online now  
Old 01-04-2007, 11:58 PM   #4 (permalink)
500+ Posts????
 
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
Default

Thanks for the great replies. I understand the reason to use OpenGL. The reason I was looking at DX is because it handles everything (input, sound, etc) instead of just graphics, and it would be faster to learn that (I assume) than OpenGL, plus other libraries for the other aspects.

I have studied OpenGL a bit. I have the books Beginning C++ Game Programming and Beginning OpenGL. I understodd the basics of it, but it doesn't seem to sink in (as soon as I close the book, I'm lost again).

Still, I've just discovered ClanLib, which is a library specifically designed for creating games in C++ and it uses OpenGL, so I may be using that, which will help with my OpenGL as well. But ClanLib also has functions for animation, sound, input, font handling, networking, etc. Still, I know most of this is over my head, but it looks like as good a place to start as any.

My biggest issue, it seems, is the basic landscape of C++. I understand the code. I understand writing header files that can be included, etc. But I don't understand simple things like where these files physically go. Do they need to be open in the dev environment when you compile the code or will the include <filename.h> line automatically search the projects root folder? Like ClanLib, I downloaded it and extracted the files into folders on my desktop. Now, I'm looking at the stack of files in one hand and my Dev-C++ folder in the other, wondering where to put everything to make it work. In fact, I can't run a single one of those files without getting the "Directory does not exist" error.

I've installed the x86 SDK, so thats one obstacle I'm over. I also installed VS 2005 Express, but I hate it, so I think I'm sticking with Dev-C++. Is that a wise choice or should I give VS another shot... I couldn't even figure out how to compile (though I only spent about 5 minutes looking).

Again, thatnks for the replies guys, hopefully I'll be on my way soon.

Oh, also, I'll be getting a shiny new comp with my tax returns and I'll be setting it up from the start to be a programming/gaming machine, so I may be asking for some more advice on simply the best setup later.
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats."
~ Howard Aiken
Khanstruct is offline  
Old 01-05-2007, 02:03 AM   #5 (permalink)
McFox Sandwich
 
Join Date: Jul 2006
Posts: 463
Reputation: 10
Default

Dev-C++ is awsome! I also suggest that when you learn a lesson, make a bunch of codes and go over what they do, ever if they are the same ones. Thats what I do.

When you compile a project you compile EVERYTHING in that project, so if the header file is in the project then it should compile
Cj Shadows is offline  
Old 01-05-2007, 06:07 AM   #6 (permalink)
500+ Posts????
 
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
Default

Alright, re-reading my C++ book, I've come to the realization that I'm just kicking a dead horse. While I do still need to fully grasp the concepts of dynamic memory and polymorphism, there's really very little about the basic code I don't know. So, it looks like I'm going to have to just take the plunge and try my hand and creating graphical games.

My game has also been pre-produced to death. Heck, I've designed web pages with neat little clickable flow charts and mouse over notes. All this, while waiting for a programmer to come along and decide that they wanted to work on the project with us. So, if I have to do this myself, I guess I have no choice.

I still consider myself well within the realm of "beginner programmer", and yes, I'm about to begin work on an MMORPG. I know, this is the fool's hope and downfall of every would-be creator, but I've been dancing around it and making silly little calculation programs and indy games long enough.

I finally got the core and display headers from ClanLib to work in Dev-C++ (though I haven't used any of their functions yet). And really, I don't know why I'm posting this little rant. Kinda intimidating standing on the brink I guess. You guys have been a lot of help. Thanks. I'm sure I'll be posting regularly as I stumble into the first few functions, so wish me luck. I'll see you soon. 2
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats."
~ Howard Aiken
Khanstruct is offline  
Old 01-05-2007, 07:42 AM   #7 (permalink)
Crumbly, but Good
 
Eriond's Avatar
 
Join Date: May 2006
Location: Montreal
Posts: 1,645
Reputation: 67
Send a message via MSN to Eriond
Default

Quote:
Originally Posted by Khanstruct View Post
Thanks for the great replies. I understand the reason to use OpenGL. The reason I was looking at DX is because it handles everything (input, sound, etc) instead of just graphics, and it would be faster to learn that (I assume) than OpenGL, plus other libraries for the other aspects.

I have studied OpenGL a bit. I have the books Beginning C++ Game Programming and Beginning OpenGL. I understodd the basics of it, but it doesn't seem to sink in (as soon as I close the book, I'm lost again).

Still, I've just discovered ClanLib, which is a library specifically designed for creating games in C++ and it uses OpenGL, so I may be using that, which will help with my OpenGL as well. But ClanLib also has functions for animation, sound, input, font handling, networking, etc. Still, I know most of this is over my head, but it looks like as good a place to start as any.

My biggest issue, it seems, is the basic landscape of C++. I understand the code. I understand writing header files that can be included, etc. But I don't understand simple things like where these files physically go. Do they need to be open in the dev environment when you compile the code or will the include <filename.h> line automatically search the projects root folder? Like ClanLib, I downloaded it and extracted the files into folders on my desktop. Now, I'm looking at the stack of files in one hand and my Dev-C++ folder in the other, wondering where to put everything to make it work. In fact, I can't run a single one of those files without getting the "Directory does not exist" error.

I've installed the x86 SDK, so thats one obstacle I'm over. I also installed VS 2005 Express, but I hate it, so I think I'm sticking with Dev-C++. Is that a wise choice or should I give VS another shot... I couldn't even figure out how to compile (though I only spent about 5 minutes looking).

Again, thatnks for the replies guys, hopefully I'll be on my way soon.

Oh, also, I'll be getting a shiny new comp with my tax returns and I'll be setting it up from the start to be a programming/gaming machine, so I may be asking for some more advice on simply the best setup later.
Well apparently the MSVC++ is the one you're supposed to use, and I've heard that Dev-C++ isn't terribly good, but it's what I use, just because I'm so damn used to it, and alos that I'm sick of MSVC++s bullshit. So I'd say go with Dev-C++
__________________
Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame
Eriond is online now  
Old 01-06-2007, 07:55 AM   #8 (permalink)
500+ Posts????
 
Join Date: Dec 2006
Location: WI, USA
Posts: 515
Reputation: 0
Default

Whoa, apparently ol' Khanstruct has to slow down. I just found some open source code for a 3d RTS. Granted, while I could make more sense of it than I could have a year ago, I was entirely lost... and I think that was after the guys first "test" function. This just gets more depressing every minute.

Still! I did what anyone would do in my situation. I e-mailed the guy and asked if he wanted to code for me. :smile:

Still, I noticed that his code seems to use scopes within scopes. Is that even possible? I wasn't aware that you could nest namespaces? Here's an example:

void Tank::CIPosMgr::Create(Tank *Base)
{
CIPosMgr::Base = Base;
}

Now, from my vague understanding "::" is a scope that directs to a namespace. On top of all this, the code begins with "namespace IGAME" note; not "using namespace", just "namespace"

Now granted, the code was a bit clunky and the game takes forever to load, and after playing it for 5 seconds I got a "s**t happens" error (without the censor-friendly astrisks), so maybe this guy isn't the best example, but could someone explain that little code bit for me.

I'm guessing it means that there's a function called create (in this case, creating a tank at the location of a base) The Create function is being called from another function "CIPosMgr" (I'm assuming a position manager) and the position manager is being called from the tank... function? Why would there be a function called tank that returns void? Wouldn't tank be an object and the create function return a value? The base=base... I have no idea. My god this is discouraging.

Granted, this just proves I'm nowhere near beginning my own game, but if someone could explain this bit for me, it may help give me some insight once again.

Thanks
__________________
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats."
~ Howard Aiken

Last edited by Khanstruct; 01-06-2007 at 08:00 AM.
Khanstruct is offline  
Old 01-07-2007, 04:19 AM   #9 (permalink)
Dante’s Inferno
 
naruto1327's Avatar
 
Join Date: May 2006
Location: OLD PROFILE. NEW: NOODLEPOWA
Posts: 608
Reputation: 10
Send a message via AIM to naruto1327 Send a message via MSN to naruto1327 Send a message via Yahoo to naruto1327
Default

Quote:
Originally Posted by Khanstruct View Post
I have studied OpenGL a bit. I have the books Beginning C++ Game Programming and Beginning OpenGL. I understodd the basics of it, but it doesn't seem to sink in (as soon as I close the book, I'm lost again).
That is exactly what happened to me, I read hours and hours and, once I close the book, I forget everything I've just read. Then, I start to do those little basic C++ programs that run in the MSDOS window and the things that I've read just start kicking into my head. I recommend not reading too much, I wrecked my eyes .
naruto1327 is offline  
Old 01-07-2007, 09:43 PM   #10 (permalink)
Crumbly, but Good
 
Eriond's Avatar
 
Join Date: May 2006
Location: Montreal
Posts: 1,645
Reputation: 67
Send a message via MSN to Eriond
Default

Quote:
Originally Posted by Khanstruct View Post
Whoa, apparently ol' Khanstruct has to slow down. I just found some open source code for a 3d RTS. Granted, while I could make more sense of it than I could have a year ago, I was entirely lost... and I think that was after the guys first "test" function. This just gets more depressing every minute.

Still! I did what anyone would do in my situation. I e-mailed the guy and asked if he wanted to code for me. :smile:

Still, I noticed that his code seems to use scopes within scopes. Is that even possible? I wasn't aware that you could nest namespaces? Here's an example:

void Tank::CIPosMgr::Create(Tank *Base)
{
CIPosMgr::Base = Base;
}

Now, from my vague understanding "::" is a scope that directs to a namespace. On top of all this, the code begins with "namespace IGAME" note; not "using namespace", just "namespace"

Now granted, the code was a bit clunky and the game takes forever to load, and after playing it for 5 seconds I got a "s**t happens" error (without the censor-friendly astrisks), so maybe this guy isn't the best example, but could someone explain that little code bit for me.

I'm guessing it means that there's a function called create (in this case, creating a tank at the location of a base) The Create function is being called from another function "CIPosMgr" (I'm assuming a position manager) and the position manager is being called from the tank... function? Why would there be a function called tank that returns void? Wouldn't tank be an object and the create function return a value? The base=base... I have no idea. My god this is discouraging.

Granted, this just proves I'm nowhere near beginning my own game, but if someone could explain this bit for me, it may help give me some insight once again.

Thanks
Well, uh, you see, that's not a namespace. The :: is also used, in C++ to denote class functions, something I guess you haven't come up against yet. Classes are so damn useful, they're used in everything, so you're going to have to learn them before you start looking at source code. (Well, most C++ source code anyway)

Basically, there's a class called tank. A class is kind of like a struct, except that it also has functions in it. Basically, the create function is returning void because it's modifying a value inside the class itself, no other information is needed, all that's being transfered is the address of Base to this tank's Base variable.

Sorry, if I'm not being clear. But reading up on classes will definetly help you understand this example.
__________________
Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame
Eriond is online now  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:08 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0
OnRPG, Copyright ©2003-2011, Game Entertainment Enterprises