PDA

Click to See Complete Forum and Search --> : C++ and computer/console games?


Fat_N_Furry
Jan 15th, 2003, 10:00 AM
Somewhere I heard that C++ can be used to develop computer and/or console games. Is this true?


Thanks!
R1(k

CornedBee
Jan 15th, 2003, 05:18 PM
That depends whether you consider Quake, Half-Life, Unreal, Age of Empires, StarCraft, WarCraft and nearly every other entertainment app you see on the shelves for more than $10 to be games.

Fat_N_Furry
Jan 15th, 2003, 07:26 PM
Yeah - I want to be able to make a game similar to those. I love games like that. I also want to make games for consoles such as Gamecube, Playstation 2, and the XBOX. Can that be done via C++?


Thanks!
R1(k

Zaei
Jan 15th, 2003, 08:03 PM
Originally posted by Fat_N_Furry
Yeah - I want to be able to make a game similar to those. I love games like that. I also want to make games for consoles such as Gamecube, Playstation 2, and the XBOX. Can that be done via C++?


Thanks!
R1(k
C++, and about 10,000 dollars for the dev kit for whichever console you want to write for.

Z.

Fat_N_Furry
Jan 15th, 2003, 10:30 PM
Dang. That sucks. 10 grand. I can't believe that. I'm just a kid! :( What about computer games? Can C++ do that, too? Are there any special fees that I have to pay for a dev kit or anything?

Also - where can I get dev kits for gamecube? I want to ogle and drool over them.


Thanks for your help,
R1(k

CornedBee
Jan 16th, 2003, 08:16 AM
You order the dev kits directly from the manufacturers of the console. Nintendo, Sony, Microsoft, whatever.

For the computer you only need a compiler any probably some media SDK (DirectX or OpenGL), both of which you can download from the internet.

And good programming skills.

JoshT
Jan 16th, 2003, 10:40 AM
You might want to look into the Linux hacks for the various consoles - not necessarily to program a Linux game, but to look at the way people have gotten around the dev kits, etc.

Fat_N_Furry
Jan 16th, 2003, 11:36 AM
Thankyou so much, guys. I just need to ask you one more question. Where can I read up on all this stuff?

By the way - I thought we weren't allowed to talk about hacks and stuff on here. :confused:

Hehe as for the good programming skills, I'm a total newbie, but I guess that's what highschool and college are for, right? I just got a book on C++ the other day titled "Practical C++". I actually did VB for a long time until I found out that C++ does games. I was (and still am) deeply into Flash MX, but it seems Flash only does very basic games as far as I've seen.


Thankyou very much!
R1(k

McCain
Jan 16th, 2003, 03:17 PM
You know you can make games in VB as well, right?
But it is still a good idea to learn c++ ;)

Fat_N_Furry
Jan 16th, 2003, 10:17 PM
I can make games in VB? How does this work? I haven't seen anything in any book in C++ or VB (.NET or 6) that I've had that says I can make games. Does the dev kit change the language or add features so as to aid in making games? If you know of some good documentation on making console games, that would be quite useful as well.


R1(k

CornedBee
Jan 17th, 2003, 04:15 AM
Most normal books don't mention games. There are specific books for that.
There aren't any changes to the languages. You just use other parts of the API (when using BitBlt) or a different API (DirectX, OpenGL).

I think Josh uses the real meaning of hacks here, not the public degraded one. Breaking into computers is cracking, hacking is brilliant programming and a hack is therefore a brilliant piece of code. In that case it's code that simulates the console.

Flash indeed can make only very basic games. The problem is mainly one of performance.
VB 6 has less performance problems as it can nearly directly access DirectX which does most of the work of graphics. But game logic is still not that fast.
Same goes for the .Net languages, only that their access to DirectX is not documented yet.
C++ finally has real direct access to the graphics libraries and is the fastest in execution. This is why most commerciall games are done in C or C++.

JoshT
Jan 17th, 2003, 10:08 AM
Originally posted by CornedBee

I think Josh uses the real meaning of hacks here, not the public degraded one. Breaking into computers is cracking, hacking is brilliant programming and a hack is therefore a brilliant piece of code. In that case it's code that simulates the console.


Yes, I mean hack in the old school programming sense, not anything illegal or malicious. Ex: There's a cross-compiler for the Hitachi chip the Sega Dreamcast uses for Linux, so you can compile your own Dreamcast Linux versions on a Linux PC, then burn it to CD and run Linux on your Dreamcast - you can look into these types of tools to see the boot process of a dreamcast, etc.

Fat_N_Furry
Jan 17th, 2003, 10:29 AM
This is great! Tell me if I'm misinterpreting you, but the impression I get is that you're saying that there's a way to develop console games for free if I do it in linux? That's awesome, because my grandpa has been teaching me linux! Right now I have Cygwin, but last Monday, I decided to get the real thing! My uncle, who has broadband, is downloading all the discs for me straight off the site at the rate of one per night. :D

Where do I find these hacks? Do they have them for all the systems? (Gamecube, Playstation 2, XBOX, Dreamcast, etc.)


Thankyou! :D
Rick

JoshT
Jan 17th, 2003, 01:45 PM
Well, not exactly - you make the game for Linux and then run Linux on the console - what I'm saying is that if you really want to get into it, you can look into how they got Linux to run on the console to try to make a native console game (no need for the OS). Do a Google search for Linux and the name of the console to find lots of good info - there's a couple of Linux Dreamcast ports, and Sony officially has a Red HAt Linux distro for PS2 you can buy, and I'm sure due to the Xbox's PCi-ishness and spite for Microsoft, people are porting Linux to it.

Fat_N_Furry
Jan 17th, 2003, 04:12 PM
Alright. Thanks for the info, guys! I now have a better understanding of what consoles really are - they're just computers with a special OS. Now I'll be able to find lots of information about them.


Thanks!
R1(k

ChuckB
Jan 17th, 2003, 09:41 PM
Hi,
I began learning C++ last summer and started exploring using OpenGL and GLUT with the Dev-C++ IDE to build programs. It was all free. This was very nice. :-) I wrote my first 3D game this past Christmas. It wasn't the greatest...but it was all mine. :-)

I am trying to modularize my game engine now. Here is what I can tell you from experience.

FORGET about game programming for the next 12 months. Don't dwell on it. Keep it in the distance as a motivator. Study, read, program C++ until you get sick of it. Learn the standard template library (STL)....not just the basic C++ you get in most basic books. Write hundreds of small programs to do little things. Keep a journal of useful tidbits of code. Write console (DOS looking windows) programs (no graphics). Avoid Microsoft MFC stuff initially until you get the pure ANSI C++ stuff down. Don't get distracted by OpenGL or DirectX. Stay focused... :-)

Now, as you slowly become an expert in C++, begin working on your algebra and trig. Start reading about matrices and various math operations. Write programs in C++ to support these concepts. Keep the notes in your journal.

When you become a very, very good programmer in C++ and you have this basic 2D/3D math under your belt...dig into DirectX, OpenGL, SDL, etc. You'll be able to accelerate and an incredible speed and will not be handicapped by lack of C++ knowledge and math.

Google search will take you to the very best experts in the world and their respective tutorials and source code...the world awaits you. :-)

You seem to be young so you got the time to learn this stuff the right way.

Wish you the best...
ChuckB

Fat_N_Furry
Jan 17th, 2003, 10:18 PM
Thanks, dude. You sounded like a wisened old master with your advice. :D This is all so weird because my grandpa has been coming over once a week and teaching me trig, and as for a school course, I'm going to go back to learning algebra next year. I had a tough time with it last year, so we (my parents and I) decided to have me take consumer math, and circle back to algebra.

LOL I said I only had one more question a few times, but I guess I still have more:


- What is the standard template library, and what does it do?

- By Dos-looking windows, do you mean like command prompts, (like TCSH and BASH) or windows such as Netscape Navigator, or Internet Explorer or word processors?

- What is "ANSI C++"?

- I guess you really shouldn't explain OpenGL, DirectX, or SDL if they're too terribly interresting because it will just draw me off track.


Thankyou for your advice!
Rick

CornedBee
Jan 18th, 2003, 08:41 AM
Originally posted by Fat_N_Furry
- What is the standard template library, and what does it do?
The standard template library (STL) is a part of the standard C++ library. The standard C++ library is a set of classes that aid you when programming. It contains a string class, a complex number class, the iostream library (for console and file input/output and string formatting) and the STL, a set of classes that act as containers for objects: dynamically sizing arrays and such, and a large number of algorithms to perform on these containers (sorting, searching, ...). Then there are a few other utility classes.
The real measure of how well you know C++ is usually how well you know the library - the language itself doesn't have that many features.

- By Dos-looking windows, do you mean like command prompts, (like TCSH and BASH) or windows such as Netscape Navigator, or Internet Explorer or word processors?
By Dos-looking I suppose he was referring to windows console applications. These are apps that run on the command prompt, be it DOS, the windows command interpreter (command.com or cmd.exe) or any UNIX shell.

- What is "ANSI C++"?
The C++ language and the standard C++ library are standardized by the ANSI and ISO groups. ANSI C++ means using only this part of C++, no other libraries or APIs. Since the standard C++ library has no means of doing anything graphical that means that ANSI C++ apps are limited to console apps (see above). Any use of any graphical output (native APIs like GTK+, WinAPI, XLib, Cocoa etc. or direct hardware access APIs like OpenGL or DirectX) means going away from pure ANSI C++.

Fat_N_Furry
Jan 18th, 2003, 10:28 AM
Alright. Thanks for the information, CornedBee. The book I got (Practical Visual C++ 6) doesn't really go over command prompt apps and such. It mainly goes over the Microsoft MFC stuff that I'm supposed to avoid. Does anybody know of any books that I should get to learn stuff like this?

Appreciate it!
Rick

CornedBee
Jan 18th, 2003, 12:27 PM
General books. Stay away from books that mention Visual C++ in the title.

The really good book I used is only available in German.

DarkMoose
Jan 18th, 2003, 09:47 PM
before you start working on yer first person shooter, rpg, and/or 3D platform, might i suggest learning what a UDT or for loop is? ... and maybe a couple months of practise with C++ or VB..
Now, i tell people on this board to do what I did, which was jumping headfirst into my own RPG game engine in VB, but what i didn't tell them was that I had a visual basic class and my own personal study of it for a year before :\

Osiris
Jan 19th, 2003, 05:37 PM
if you are a newbie(like me), you should practice making windows.
make a window with a textbox.
make a window with a command button.
make a window with text(sort of like labels).

that way you will play around with the WinProc so you can
understand it better. That's what I've done so far , hehehe :D
So now what I need to do now is make a Window w/o a Titlebar,
so what I have to do is search the Internet more, or if I'm lucky
some1 will post it here :p
Don't lose interest on the subject though, if you feel akward when
you are reading it, take a break, but go back to it or search for a
much clearer source, because thats what happened to me and I
didn't want to get near Win32 programming...

I was scared :(

Fat_N_Furry
Jan 21st, 2003, 12:13 PM
I actually understand the coding structure pretty well. Here's a for loop:


for (i=0; i++; i<10) {
printf(i);
}

If condition:

if (variable = value) {
//Do stuff
} elseif (variable = value) {
//Do other stuff
} else {
//Do OTHER stuff...
}


As for UDT... :confused:

CornedBee, you said to get some general books. I don't quite understand what you mean.

As for making MFC windows, I actually know how to do that pretty much. Just not how to get information such as what's in a text box or to change a label's text or stuff like that.


Later,
Rick

Darkwraith
Jan 21st, 2003, 02:39 PM
A good general book for C++ would be something like the "Teach yourself C++ in 21 Days" books that you find a lot.

I find that those really help for the basic C++ and console applications.

For Win32 programming though, I suggest any book created by Andre LaMothe. They explain a lot of concepts in a way that is enteraining.

CornedBee
Jan 22nd, 2003, 04:39 AM
But LaMothe's books are mainly for game programming and touch Win32 only as much as is needed.
For Win32, Petzold's Programming Windows is still the best.

Fat_N_Furry
Jan 22nd, 2003, 05:33 PM
Alright. Thanks, guys. I'll see if I can get my parents to sponsor me for those books. :)


Later,
Rick

Emo
Jan 23rd, 2003, 04:27 PM
Hey CornedBee, what do you think about the book "C++ Programming" by Bjarne Stroustrup?

Link here (http://www.amazon.com/exec/obidos/tg/detail/-/0201700735/qid=1043360660/sr=1-1/ref=sr_1_1/103-5068736-3999854?v=glance&s=books)

I bought that book about 2 years ago when I was a complete newbie in programming and I was just starting out C++... and if you know the book, it's for advanced programmers so to this day it hasnt helped me a bit :rolleyes:

I just wanted to know your oppinion on it...

thanks
-Emo

CornedBee
Jan 23rd, 2003, 09:28 PM
Well, Bjarne Stroustrup is the original creator of C++, so he ought to know much about the language.

Myself, I don't own this book. I've got a very complete reference on C++ already in my own language (German) which is not a translation from English. While it is probably not as complete as Stroustrup's book I don't think the difference is great enough to justify buying another book.

I believe it to be a great book for everyone who wants to make the leap from C++ intermediate to expert. But my memory of the posts here proves that it is not good for C++ beginners as they are likely to be confused by the rather technical language of the book.

Darkwraith
Jan 23rd, 2003, 10:18 PM
Just a general question.

C++ is really not architecture neutral and I would like to develop games over many platforms, but I do not think that Linux will allow me to use DirectX. Is there a game developers kit for Linux?

ChuckB
Jan 23rd, 2003, 10:45 PM
CornedBee,

Genau! Stroustrup ist sehr schwierig!! Dein Buch auf deutsch ist wahrscheinlich besser als Stroustrup in englisch. ;-)

Darkwraith,
I am not sure what you mean when you say 'C++ is not really architecture neutral'. It is my understanding that an ANSI C++ program can be compiled by an ANSI C++ 100% compliant compiler for Windows, Unix, Linux, Mac, etc. Correct me if I am wrong....

I am trying to use 100% C++ for my coding for discipline sake. I notice most C++ books combine C stuff with their material. It works...but on the newer compilers, they tend to be less tolerant of C references (i.e. GCC 3.2). I tried this new compiler with Dev-C++ 5 IDE and my C++ program choked...there are somethings that are not quite compliant so I must learn to fix them.

What I use for cross platform graphics is OpenGL and GLUT. Supposedly, my code, when compiled, will run on Linux as well as Windows. DirectX is not supported by Linux or Mac so I am focused upon OpenGL.

You know, it is a real challenge to write C++ code that will run just on the several varieties of Win Operating Systems. I had a program that ran on Win95, Win98, ME and Win2K...but not XP. I had some memory problems in my code...rewrote that section, and now it works on the major Window OS's. :-)


lighthouse3d.com was where I got started with GLUT and OpenGL...the tutorials were simple with great explanations and source code. This forum helped me with my weak C++ knowledge and gametutorials.com helped me with game concepts....the list goes on.

Regards,
ChuckB

Emo
Jan 23rd, 2003, 11:12 PM
Thanks for the Reply CornedBee...

the thing is that right now I'm taking a beginning class in College on C (not C++) because it's a required class if I want to take C++...

I just wanted to know if this book is going to help me later on when I move to C...

but man..from now on, I'll have a LOT of questions about C on this forum :D

-Emo

Darkwraith
Jan 23rd, 2003, 11:19 PM
Usually the PLs that base that are implemented using the complier model (like C++) cannot be ran (the executable) on other platforms (unlike Java.)

However, I think I might have been a little vague in my previous post, so sorry about the confusion. Thanks for the info though. :)

Zaei
Jan 23rd, 2003, 11:58 PM
You cant take an executable from one operating system to another. However, if the code is written correctly, you can re-compile to the new format with little or (preferably) no changes.

Java is a scripting language. As long as a virtual machine exists for the target platform, the bytecode will run.

Z.

sql_lall
Jan 24th, 2003, 01:23 AM
Ok, just two things:

1) To make games (very basic ones at that) for PS2, there is a program YaBasic, which is similar to QBasic. It is on a PS2 cd, so you put the cd in the PS2, run YaBasic and type the commands in using controller/keyboard, and run it. However you cannot compile unfortunately, but yuo can run any game from YaBasic.

2) The best book i have found, which i am using now, is called something like "Game Programming in Direct X 8.0" which is all about using directX in C++. It gives you all the code and explains each bit, AND mssdk comes with it, which is really helpful.

CornedBee
Jan 24th, 2003, 06:22 AM
My worst buy was probably "Beginning Direct3D Game Programming". It's one of those:
"Here's a framework that hides startup stuff from you. Now do this, this and this and you have a textured mesh. Now you can program with Direct3D."

I hated it.


the thing is that right now I'm taking a beginning class in College on C (not C++) because it's a required class if I want to take C++...


Whoever decided that C should be required for C++ should be shot.

Zaei
Jan 24th, 2003, 11:40 AM
Originally posted by CornedBee
Whoever decided that C should be required for C++ should be shot.
Two of my friends are Computer Science Majors at one of the "better" comp sci schools are here... when I heard that the first semester comp sci class was C, and the second was C++, I just laughed at them.

Z.

JoshT
Jan 24th, 2003, 02:22 PM
Originally posted by Zaei
Two of my friends are Computer Science Majors at one of the "better" comp sci schools are here... when I heard that the first semester comp sci class was C, and the second was C++, I just laughed at them.

Z.

When I went to college they made us take two courses in Eiffel before getting into C++. I wound up switching from Comp Sci to MIS...

Darkwraith
Jan 24th, 2003, 08:01 PM
I'm going to have to agree with CornedBee on this one. Teaching C to beginning C++ students is not really a very good idea.

When you do that, you enforce a non-object oriented approach upon students. They then do not use the full power of C++. Also, some of C's syntax is odd and should not be used in C++.

Zaffir
Jan 24th, 2003, 08:58 PM
If you wanna try your hand at programming for consoles, try the Dreamcast. There's tons of info on it - and even 100% legal LIB files. Check out www.dcemulation.com for more info.

RabidChimp
Feb 2nd, 2003, 09:14 AM
Whats the difference between MFC and Win32. Can anyone post a very small sample of what MFC code looks like, and a small sample of what Win32 code looks like?


Thanks

Darkwraith
Feb 2nd, 2003, 06:56 PM
Check out the MFC or Win32 forum.

http://www.vbforums.com/showthread.php?threadid=225966&goto=newpost[URL=http://www.vbforums.com/showthread.php?threadid=225966&goto=newpost]