Game Programming Guide For The Newbie


#21

Thanks Kid Mesh and all others who posted other books and useful resources.

I have a question for anyone who has the time to answer it. I have set my sights on games programming, I know its something I would love to do. I am still young, so I have plenty of time to fit in language learning etc. A while back, I started playing around with VB. After a while of this, I felt it wasnt getting me where I wanted, and as C++ is the industry standard, I started learning it instead. My question is: Is it neccesary to learn a language before C++, like VB or something along those lines, or is it best to dive right in and get started?


#22

I’d say just dive right in. And focus a lot of effort early on in the area of object oriented programming, and once you start understanding that part, put some time into object oriented modelling, the Unified Modelling Language, and software development and QA processes.

C++ isn’t an easy language to learn, but if you get yourself a good solid grasp of object-oriented programming BEFORE you start digging into the language internals, you’ll write better code.

Rational Unified Process is a good one to learn, it’s the industry standard… and anyone who tells you that it doesn’t work for game development likely doesn’t know what it is. I’ve read a fair number of post-mortems in Game Developer in which the writer stated that either they were glad for process because it saved them, or that they wished they had one because the experience was miserable, and the project nearly failed.

Game Developer magazine is well worth getting.


#23

so what is teh future of gaming? i am learning c++ right now… no matter what… but by teh timei am older… will there a be a programming language i need that is coming ahead of c++ or something?


#24

C++ seems to be the just of it right now, and you can bridge the gap with other source codes for other game engines, (from what I’ve learned thus far, of course there’s more information with this commment) I did, once again, luck up on a PS2 development kit, which in developing games for it is using linux and programming C++ and Assembly, I highly recommend getting The Complete Reference of C++ fourth edition, which is a great book and huge information resource, plus a C++ Primer is needed as well, there was another book I needed to get that had low level techniques of programming in C++, and I’ll have to find that one again, but after awhile programming becomes fun if you do it right, and practise good code, creating PC games is a great start, for creating games 2D and 3D and always check www.gamedev.net for further information and resource and community, I’m psycho, I do it all, programming, 3D artwork, games, what ever you want, skill level is another issue, but time will tell, :D!!


#25

Re: SystemAI.

My friend, if you know C++ - then the next “big thing” will be a breeze in the wind for you. C++( short of machine code and assembly ) is quite arguably the most complex of all the programming langauges, and whatever comes next…

Before C++, many considered assembly to be the best way to achieve the fastest code and so many had to go out of their way to understand Assembly for “cutting edge”. But as computers got faster, C++ seemed to be easier to understand and even though Assembly code was still faster - the speed gained from the extra work of coding in Assembly was now in question - possibly due to the power of the C++ language.

So leaping over to C++ from Assembly would be easy. What took 5 lines of assembly code to perform a task, could now be done in C++ in 1 line of code. And with the extra CPU and memory muscle - you could stick two fingers up at optimisation!

Now we face a new era - C++ is starting to be surpassed( only just, mind you ) by other languages. The greatest example of this would be Java.

Though not quite as flexible as C++( to the best of my knowledge of Java, it has limited support of pointers…), Java has reduced many headaches in the memory-management department - something that has plagued C++ programmers since it’s creation. And some of the games are very impressive…

But still - we now come to our point! Assembly was closer to machine code than C++. C++ is closer to machine code than Java. And I wouldn’t be surprised if Java is closer to machine code than…well, whatever comes next! But you have to recognise that the closer you program to machine code - the better you understand how a “computer ticks”.

So by learning C++, its a smart bet that you know more about “whats going on under the hood” than the guy/gal learning Java( or whatever!).

That also explains why its a smart move( in most cases ) to employ a programmer who understands Assembly AND C++ over the other one who only understands C++…


#26

Boone- Interesting points. It will be interesting to see if the fancy new higher-level languages will become the dominant platforms for next gen software development. For now, I’m sticking to C++ but I have little doubt that it will be the last major language I will need to know. Thanks for the insight :slight_smile:


#27

Re: Kiaran.

You’re most welcome.

I remember a while back when I came across the cute Dark BASIC language. Like it said on the tin - I was able to write a 3D game in 30 minutes! With that kind of power I almost threw my C++ out the window - but something terrible struck me…

I had practically no access to structures or pointers!

After working myself into a corner - I immediately ran back to C++ for these features, accepting the responsiblity once again for doing my own memory management. Despite the hard work ahead, I could atleast program my way out of that corner…

So whatever the next language is going to be, it must be flexible and powerful enough to allow the programmer to handle any programming assignment.


#28

Ic… thanks alot!! Man… all teh programmers and 3d artists ive talked to always seem to have “intelligent” things to say… Thanks


#29

OK guys - I’m probably the oldest guy in this forum - been lurking for a while. I’m a retired teacher (58 yo). I’ve taught programminng in HS before. So I can do C++, Vis Basic, and Java. Not sure if anyone is doing C# for games? I don’t know C# but have it. After I retired I did some subbing and did a game design - even to the point of drawing levels on paper and a bit of storyboarding - I’m into 3D Graphics at the moment and have high end 3D aps. I ran my concept by some teens I was subbing for (just a regulart class - not programming) and they thought the idea was kewl.

So my question is: - I’ve looked at the 3D Game Studio site as well as the Torque engine site. I know NOTHING about game engines. I kind of understand what they are talking about but don’t really know what they “look” like. Like how do you tie the programming in to them.

I think the basic Torque engine is about $100 USD and the most reasonable 3D Game Studio package is $200 (They have a cheaper but really weak looking package).

I’m also not sure how animation you do in a 3D package hooks into a game engine.

So my question is:

Which is better for me? I know this has been asked a lot but, perhaps, knowing my background could give someone an idea as to which package might be better. 3D Game Studio looks like it might be easier as it LOOKS like it relieves you of SOME of the programming.

Hehe and before someone asks - No, I’m not so old that I did Assembler (Thank God!!)

Jim


#30

Not yet, but since DirectX is now fully managed and running on .NET, there’s not going to be much
reason not to, other than a lack of experience on the part of most current developers.

I’m also not sure how animation you do in a 3D package hooks into a game engine.

In most cases, you create and export some file format that the game engine’s development tools
understand, and it loads the animation data as well as geometry from the file. Some game
development tools can read formats like dotXSI or FBX, which is good if you happen to use a tool
that can export one of those, but that’s less common. For HalfLife2 you can get a plugin for XSI
that exports Valve’s file format, so that you can load the asset data into Valve’s Hammer tool,
which basically started out as a level editor on steroids, and has evolved considerably since.

Unfortunately, I don’t yet have any direct experience with either game engine you’re looking at,
so I can’t give you and specific feedback regarding either one. I’ve been looking at both of
them myself :slight_smile:


#31

Hi Boone- I tried out your little video game. Pretty cool. I didn’t make it very far though. Kinda difficult.


#32

Re: JJ54.

Its a pleasure to converse with a respectable programmer such as yourself!:beer:I am going to dispel the myth behind “Game engines” for you…ready for this?

THEY ARE NOTHING BUT REUSABLE CODE. :scream:

In otherwords, they are simply a load of function calls that you probably bundle into a nice C++ class for convienice. The ideal game engine would be one that is program independant( doesn’t rely on the current project’s globals etc), and so forth.

For this topic, I would strongly suggest asking the rather decent guys’n’gals over at www.gamedev.net - they deal with this topic for breakfast every morning! :thumbsup:


#33

Re: Kiaran.

“I didn’t make it very far though. Kinda difficult.”

WHY DOES EVERYBODY SAY THAT? :cry:

Re: System_AI.

Don’t worry - I ain’t got a damn clue what I’m talking about half the time! :thumbsup:


#34

Thanks Thalaxis and Boone.

I guess the bottom line would be whether 3D game Studio or Torque has the better set of functions then. This info really helped a lot. I wish their websites made it clearer exactly how you work with it.

I use Cinema 4D and LightWave and I think that at least Cinema can deal with FBX format so I’m kewl there. Another thing I don’t quite get in this area is: Once you create an animation for a character, how do you work with it. I mean, if it were a football type game, I guess you could have your player do his little touchdown dance in the end zone but I’m sure there must be a way to connect an animation to the game plot - as in reacting to clollision, advancing into a strike, reacting to a situation that might occur from some unexpected AI event. I have SO many questions and SO much ignorance!

I really thought the beginning of this thread was great. Since I’m fairly sure many if not most of the people here are young and many in school - they may not wanna hear about the math part but when you need math to do something - guess what - you just plow right in because it has a purpose for you and isn’t some kind of abstract stuff.

I really think teaching game programming in schools could cover a lot of the regular school curiculum: Math: used to tell the math teachers to stress Cartesian coordinattes as well as the Z axis just for starters - Social Studies (Stuff like “Civilization”) - English (Documentation, Design and plot) - Science (Physics). I tried to work with other teachers when I did this but I’m not sure they “got it”. I didn’t teach game programming (Obviously) but I think if I could do it again, I’d try to teach game programming. Programming classses are geared toward business application. That means databases, networking and security. But ALL those are needed in games as nearly as I can tell. So it could be covered in a much more “fun” way.

OK I’ll get off my soap box!! Any educators out there??

Jim


#35

Re: JJ54.

Dear God, the maths part was the most frightning part for me - I felt like I’d been trapped in a giant spider’s web! :scream: The trouble started when I had to figure out the intersection of two lines… :sad:

Hmmm…if I had developed my own 3D engine, I suppose I would make a system of “interupts”( :shrug: ) that would recieve…

struct input{
int Animation_index; // which of the animations to start playing…
3D_POINT position; // where in the 3D world to place the animation…
3D_POINT &track; // Just in case the animation’s position follows the position of something that is actually changing - sigh - position every frame…
};

…this is just a basic example, but once your game code has done its logic etc, your setup with the 3D engine would basically have this info used as parameters. The 3D engine will most likely take care of the animation for you with a call to the engine’s “update” function or whatever…

But the fact of the matter is that 3D engines can differ from each other, so this example could be completely out of the window! :banghead:


#36

I think it varies from engine to engine, but the general idea AFAIK (I’m new at game programming, so
I could be easily be quite off base on this), is to basically connect a behavior (e.g. an animation)
to an event, like a touchdown in this case.

How you go about doing that will vary greatly; in simpler engines you’d have to write a script and
register it as a callback with some event handler, and use the script to trigger the animation. In
others, you have a graphical system that allows you to define behaviors and assign them to
events, and then use scripts to implement stuff that isn’t pre-built for you.

Boone:
I think that an interrupt-based approach would be less efficient than an event-driven one; in an event-
driven system, you’d just register a callback with an event handler, and when an event happens,
the event handler calls the appropriate function to do whatever it is you wanted it to do.


#37

You guys have been most helpful!! At least now I hace a clue.:wise:

So much of the discussion on this forum doesn’t seem “programming” related. But these responses connect with me. Whether using interrupt or event driven may depend on the game engine’s capabilities I guess.

Still need to figure out which engine though. The 3D Game Studio site mentions a “physics object” I believe and you only have one unless you buy the $800 version:eek: . And I’m not quite sure what that would mean. Any idea guys?

The one I was considering was $200 if I recall correctly.

Jim


#38

I’m a Torque user, and for the convient price (100USD) it’s well worth it, Torque is used and created by independant developers and is always updated source code, torque’s source code is similiar to C++ and has individual features related to it’s code, in the Book 3D programming all in one by Kenny Finney (a must have) that guides you step by step thru the whole process, the community is becoming huge and there’s always new features added, get the book because they give you a free trial version of Torque along with you first 3D game tutorials, there are serveral procedures for creating 3D games in the engine and there’s a article of a guy who used the torque engine for his 3D virtual presentation, the article is on the website and his name is Bendik Stang, the article is called Game Engines features and Possibilities, he explains all the game engines and compares them in a chart of what there capabilities are and prices and why he chose Torque, he also created his own code for a Fx Grass replicator which is just as good as the grass effects created in Metal Gear Solid 3, don’t take my word for it, see it your self,
From there it’s based on what 3D modeling software your comfortable with and they have plugins (if I can say that) for Maya, 3D studio Max, Lightwave 3D and Blender plus more to come, search the site throughly, and you can view some of the stuff that other indie gamers have created, and play the games as well, Good Luck :D!!


#39

And don’t forget – Blender has a game engine complete with development tools also –
and the price is right! :slight_smile:


#40

Wow, this is a great post for those looking to start programming

This thread should become a sticky.