Archived

This topic is now archived and is closed to further replies.

TheDentist

"Game programming all in one"

Recommended Posts

Has anyone tries to use the "Game programming all in one" book and didn''t use a version of microsoft visual c++? i.e. Borland''s C++. I''ve use borland''s for like 4 months and learned the interface ( not really programming though ). The book teaches through microsoft and so I went to it. Now I feel like shooting myself in the face. Any advice? Is it to hard to learn in a compiler if the writer refrences the keyboard shortcuts and things like that in another compiler? P.S. any comments on the book I have chosen?

Share this post


Link to post
Share on other sites
Well that book is ok for beginners but i found it only teaches basic stuff so i would suggest you get a book on C++(or Visual C++) and learn that first. Then you should get a book on game programming(if you wan to start with 2d(which i suggest)go with "Trick Of the Game Programmer Gurus", if 3D then go with "Zen Of Direct3D"). As for the compiler if you can i would go with Visual C++ pro or higher(do not get standerd becusae the compile is not optomizised) becuase it is much easier to use that.

Share this post


Link to post
Share on other sites
quote:
Original post by liquid_ice_programmer
As for the compiler if you can i would go with Visual C++ pro or higher(do not get standerd becusae the compile is not optomizised) becuase it is much easier to use that.

And of course, optimization really matters for a beginner. I''m sure it''s worth the $1,000 price tag.

Share this post


Link to post
Share on other sites
No, no, no, you will not need the expensive compiler. You are learning and will not require compiler optimisation, since learning to code a game is what you are attempting at present.

To optimise your code manually will also be a great learing curve for you, since that is part of what game programming is.

The usual stuff goes here for a signature.

Share this post


Link to post
Share on other sites
Calm down. I know how you feel. After trying to adapt code for Dev C++, it gets hard. Your best bet would be to go to the top brass. Contact the company. Ask them what to do. Or, try to adapt. If you do need help, I am available by e-mail.

Scott

Share this post


Link to post
Share on other sites
Scott, Can you clarify something? you said " Ask them what to do. Or, try to adapt. " Do different compilers use different commands? Like - I''m using #include <iostream> in Microsoft, but I remember using #include stdio in Borlands. I''m I reading your sentence wrong?

P.S. Thanks for the help everyone.

Share this post


Link to post
Share on other sites
I thought stdio.h was the C io header file, and iostream was for c++



     Hope is the first step on the road to disappointment

[edited by - tstrimp on April 30, 2003 12:19:27 PM]

Share this post


Link to post
Share on other sites
TheDentist

Different Compilers have different ideas on what is "standard"

This code doesn't work on MSVC 6.0, but it does on BC and DEV-C

for(int i=0; i<5; i++);
for(int i=0; i<5; i++);


Even though that is the standard, MSVC doesn't like it

Each compiler has "tricks" to get code to run correctly. My suggestion, is to go to some university store, and get the educational discount on MSVC++, since its only about 50 bucks more than the learning edition.

(note, added verson number, thanks Yann L.)


[edited by - dede on May 1, 2003 10:31:11 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by dede
TheDentist

This code doesn''t work on MSVC, but it does on BC and DEV-C

for(int i=0; i<5; i++);
for(int i=0; i<5; i++);




What part of that code doesn''t work? I compiled an ran it fine on VC++ 7.0



     Hope is the first step on the road to disappointment

Share this post


Link to post
Share on other sites
quote:

Even though that is the standard, MSVC doesn't like it


Blame MS (as usual). They fixed the bug in 7.0, fortunately.

Anyway, if you are a beginner and buy a book teaching a language using a certain compiler, then make sure to have that development environment. Otherwise you're making it much more difficult and confusing than it actually is, how can you concentrate on learning C++, if you constantly need to translate the compiler shortcuts, commands and menu points ?

Of course, the other alternative (the one I would strongly recommend), is to buy a compiler independent C/C++ book.

quote:

What part of that code doesn't work?


VC6 scopes the 'int i' not into the for block (as specified by the standard), but into the block being one hierarchy up. Resulting in a double declaration of the same variable name, which is incorrect behaviour.


[edited by - Yann L on April 30, 2003 12:52:13 PM]

Share this post


Link to post
Share on other sites
I have the game programming all in one book, and it is the biggest waste of trees in the world. that book is the most shittiest, convoluted "game engine" in the world. there are much easier ways of going about things, and the author avoids this and goes around his ass to get to his thumb. my advice to you:

Read the book to see how other people do it, and then throw it away.

----------------------
i code therefore i am.

Aero DX - Coming to a bored Monitor near you!

Share this post


Link to post
Share on other sites
quote:
Original post by Yann L
VC6 scopes the ''int i'' not into the for block (as specified by the standard), but into the block being one hierarchy up. Resulting in a double declaration of the same variable name, which is incorrect behaviour.


Its a nasty one, and caught me out a couple of times. I now put:

#define for if(true) for

to get proper scoping. Shocked me when i put that in and broke some code - someone had actually relied on the buggy behaviour to make a function work o_O

Share this post


Link to post
Share on other sites
quote:
Original post by OrangyTang
#define for if(true) for


Correct me if I'm wrong, but doesn't this "fix" correct one error while creating another?

The "correct" behavior is


for(int i=0;; );
//i can be accessed here

//< code code code >

//to here
for(int i=0;; ); //i is a totally new variable
//new i can be accessed here to the end of this function



So it would be equivelant to
{int i; //for(int i=0;; );


}
{int i;//for(int i=0;; );


}//end of the function

[edited by - dede on May 5, 2003 5:54:28 PM]

Share this post


Link to post
Share on other sites
If you wnat a Compiler, and you go to College, My opinion if you buy a compiler, get the Student edition, depending on where you go, you can get a Good discount on the Visual Editions.


NeFrUgLe

Share this post


Link to post
Share on other sites