PDA

View Full Version : ProgrammingLanguage


SylvanHistorian
04-23-2001, 07:35 AM
What programming languages are used for game programming?
C? C++? Java?
I just want to know.

Kintoun
04-23-2001, 02:22 PM
C++ core, sometimes a JAVA implementation or interface.

C++ is far superior to Java. HIEL C++!

Saint Faucet
04-23-2001, 03:18 PM
Game programming depends upon what language the developer wants to use or where the program/software will be used.

From what I've seen, most programmers tend to use either C or C++ for their game coding (though I have heard of a few using Visual Basic). Overall, C is most widespread in usage (though that's been slowly changing over to C++ the past few years, from what I understand).

Java can also be used, but I don't think it's been as extensive as C/C++. While it can pretty much be used on any platform (depending upon how you compile it), I believe it's mostly being used for internet-based applications rather than gaming (but I could be wrong).

A lot of ye olde MUDs use a language similar to C (not sure if it's a direct offshoot).

If you're programming for console systems, there's usually a specific language you have to use (which is normally a modification/expansion on one of the aforementioned languages).

If you're really interested in further exploring this topic, I suggest you head over to Amazon (http://www.amazon.com ) and type "game programming" into their search engine. It should bring up a huge list of book titles that may or may not help you on your way. I'm not a programmer, so others here may be able to better suggest specific titles to check out or you can try trusting the customer reviews under each item.

[Edited by Saint Faucet on 04-23-2001 at 04:21 PM]

UBIK
04-23-2001, 04:40 PM
just stay away from driectX it might be good and all, but it was made by the Devil!!!!! its really hard to program and in my oppinion, its for "Advanced" programmers.

Kintoun
04-23-2001, 05:46 PM
Hahha altho if you want to be a game programmer DirectX is a must, sorry. Well it's not really required for most jobs, but it's always listed as a "plus." And that should be to the applicant, that you better have some knowledge in that field.

SylvanHistorian
04-30-2001, 05:57 PM
Well, I hear that memory leak is one of main bugs in programs and that Java is more sophisticated than C and C++ in that it prevents memory leak.

In what point is C++ superior to Java?
Because it is more extensible?

And I'm interested in object oriented programming.
Is it main method used for game programming now? or not yet?
or never ever?

Kintoun
04-30-2001, 06:24 PM
OOP is awesome, and can be done with C++, but it's not as easy to do so. C++ is much much faster than Java. Java is a slow POS, heh. And the memory leak you are refering to is the programmers fault, not the language. Since Java has a built in (memory intensive I might add) garbage collection it makes up for any code which the programmer leaves unoptimized. If you are a supreme master at C++ then you can get it to leave no memory leaks, altho thats close to impossible.

Lordosis
04-30-2001, 06:53 PM
DirectX blows!! For Arcanity we are using OpenGL. If I had to use Direct3D, I would quit tomorrow and go get a job as a punching bag, it would be less painful. We are using directInput and sound since M$ doesn't give us much choice, but that's as far as we're going with it.

I wouldn't touch Java with a 10 foot pole, but some people are really into it. In fact, there is another MMORPG being developed entirely in Java. Arcanity is being written in a hybrid between C and C++. Basically, we use C++ but we're not very into object oriented programming, so our code ends up looking more like C code. OOP has its uses, and it sneaks in here and there. But in my opinion, it makes things unnecesarily complicated.

For anyone trying to learn how to program games, I recommend just trying to write one yourself. Most books I've read on game programming are useless. All you need to know is online. You'll need the OpenGL "red book" though, which happens to be free online as well.

Some online resources to check out are
http://www.gamedev.net
http://nehe.gamedev.net
http://www.opengl.org

There are lots of other sites out there. But be warned that most stuff you'll find online is useless; everyone thinks they are an expert and everyone KNOWS they are right.

Of course, you'll need a compiler. MS Visual Studio would be a good choice, because it's what most people seem to use. If you can get the student version, that's the way to go, it's much cheaper. Don't go hog wild and start learning Windows programming and MFC. Just download GLUT, which is very easy to use and is plenty good enough to write a simple game.

One final piece of advice: if you've never programmed much before, start with a 2D game. Something along the lines of Dragon Warrior would be perfect.

UBIK
04-30-2001, 07:08 PM
yup glut is really easy, especially when you actually read how to use it :)

UBIK
04-30-2001, 07:09 PM
speaking of which, i think im gonna change one of my projects to glut right now, just because all the windows mumbo jumbo i have to use is getting me mad >:(

Morte
04-30-2001, 07:19 PM
And then, there was Windows XP, which might not use DirectX at all, since it is build entirely from scratch, with the small exception that it uses the Windows NT4 kernel. It does look promising, by the way. It seems that Microsoft is actually trying to produce a customer friendly product.

Kintoun
05-01-2001, 06:58 PM
Ya don't say Morte....... ha M$, can't stand em, can't live without em tho...

Wow I'm shocked Rich... I thought all large scale projects were done in OOP. Ahh but thats right, your actual coding team is fairly small so don't have to break up tasks too much. But still modual design must be a real pain. Also what about future additions? If you don't use OOP how can you account for unseen additions and reusability in your code without editing huge chunks at a time. Isn't that saving you pain in the long run? Especially since your making a game that'll be added to more and more and more. In one way or another you have to be using OOP code. OOP code is a forced standard nowadays. If I tried to turn in code that wasn't OOP my professors would KILL me.

Lordosis
05-01-2001, 10:07 PM
Using classes, inheritance, and polymorphism all over the place doesn't necessarily make code any more extensible, resusable, or modular. It does bloat the code a bit, and IMHO actually makes it HARDER to change/add things to later because of all the restrictions you create for yourself. But that's just me.

Non-OOP does NOT imply non-modular. There are many ways to organize code. Our Arcanity code resembles very much the Quake 1 source code. I studied that code for a long time and I really like the way Carmack does things. He's very organized and his code is very modular, which might surpise you considering he is a hardcore C programmer. Our code is similar, but with some C++ thrown into the mix where it makes things easier. I use the STL extensively, for example.

I rewrote the core of Arcanity several times over the last year before I ended up with the Carmackian version that we will be releasing with. At one point last year, I was just like you, thinking OOP was the greatest thing since sliced bread. But when it came down to modifying and extending the code, all the OOP was really slowing me and the rest of the team down. We are MUCH more efficient now, and I don't think there is a single class or private data member left in all 20,000 lines or so of the Arcanity source.

Here's something to think about: When is the last time one of your professors actually wrote a working piece of code? Probably 20 years ago. Since then, they've been burying themselves in theory. Programming in the real world is nothing like programming in college. But don't get me started on college, I think it's probably the biggest waste of four years anybody has thought of so far. You'd be better off joining the Marines. At least you'd be ripped at the end of your 4 years. And you could have taught yourself more programming on your weekend passes than any professor is going to teach you in 4 years of college. Just so you know, I graduated from UCLA with a CS degree 2 years ago, so I'm not totally full of BS :)... Except for my BS in computer science, of course.

UBIK
05-01-2001, 10:18 PM
please! i say PLEASE! say you actually use comments unlike carmack! i read threw the quake 1 source, and my god, thats the worst commenting i've seen!

Kintoun
05-01-2001, 11:58 PM
http://members.chello.nl/~deleeuw3/sad.gif......schooled......

I guess thats why I am in college still and Rich is Lead Programmer, heh. Actually one of my professors that I really look up to codes constantly, but he taught a Java course and so I'm not sure what his outlook is on OOP programming.

College tho Rich, is the only route to real world experience that I'll have. Granted I agree that I could better spend 4 years learning my own code, and learn a LOT more. But oh man your missing out on the college bachelor lifestlye! WHOO HOO!! I only need a degree under my belt so that I'll get hired into a nicer job, and from there start learning my real world application and REAL skills. And of course I'll be paid more than the guy who came in off the street self-taught, in most cases at least.

[Edited by Kintoun on 05-02-2001 at 01:01 AM]

Foxnix
05-02-2001, 03:25 AM
Its an interesting debate about OOP versus not OOP. It basically comes down to this:

I have done several programming things and I am a die hard C/C++ programmer.

Basically OOP is really good when you have to model after the real world more. At the moment I am working on a Railway signalling interface for Signalling systems in UK, Spain and Australia and OOP is perfect for it as the various modules in the real world have teh neccesary properties to directly relate to the Objects in the code.

BUT, the system is not time critical in anyway and runs on a windows box (so not real time!!) this means the code can be less efficient and the extra overheads from making the objects can be easily carried.

My last project though was working on a test rig which runs through a contiuous steel casting plant, This was not really directly representative in the real world also because the system needed to be real time, it meant that using OOP tech was a big no go. The overheads involved in vectoring out into the various objects and back gave not only too much of a drain on the system (it needed to sit on a small EEPROM) but also due to the nature of the function calls to and from Objects it meant that the timing of various operations would have been very changable. In teh end we went for straight C with a Stage / Mode architecture which worked very well as we couldn't use a real time OS because one of the requirements was for a DOS OS.

So Having only ever done VGA "D games programming when I was Learning to program and not professionally my only addition would be that as in most games (of that type) the biggest effect on the game performance is the Erase Move Draw loop then I wouldnt use OOP as it would be too slow and where possible would probably drop in to Assembler. But like I say I have only done DOS based VGA 2D games.

Lordosis
05-02-2001, 09:35 AM
Ubik, I use slightly more comments than Carmack, but not too much. Just like him, I use comments where something crazy is going on in the code, but for the most part I leave the code to speak for itself. I can read my own code about as easily as I read English, so for the most part comments are redundant.

Kintoun, your professor sounds more down to earth than any I had. 99% of mine couldn't program their way out of a paper bag, but they could scribble formulas and spout theory all day long. I guess if you just want to get a routine programming job somewhere, you need a degree. But it's not helping me any, I could have started writing Arcanity years ago if I didn't waste 4 years at college :) And btw, if Brick House ever needs to hire another programmer, the last thing we would look at is his/her degree. I know PLENTY of people that have degrees in CS but can't program anything more complex than the Towers of Hanoi. All we care about is whether they can code, so we'd want to see past projects they've done. AND we'd hit them pretty hard with some serious programming problems in an interview. As for the lifestyle, well... I can't argue with you there. I pretty much missed out on all that, seeing as I've been with the same girl since high school.

Foxnix, you're exactly right. Sometimes a problem lends itself to OOP and it's the only reasonable way to solve the problem. But for better or worse, the more time critical the application is, the less chance you'll be using OOP. And games programming is pretty time cricial. It's just like recursion. You might be able to solve a problem faster using recusrion. But if you profile your code when you're done, you'll be embarrased to show your face in public... at least I would.

I'm not saying my opinion on OOP is more valid than anybody else's (even your professors'). I'm just saying than I'm way more productive and my code runs much faster when I don't worry about all that OOP mumbo jumbo. But there are a few people that I look up to as programmers that are pretty into OOP, Bernard Stroustrup (the creator of C++) being one of them. Some of the OOP people are getting more into generic programming (templates), which is supposed to be more efficient. But it takes more time to get familiar with than I have patience for.

Foxnix
05-02-2001, 09:54 AM
Hehe Rich, I love your comments on the qualifications of programmers.

I personally have no programming qualifications other than one for VBA (OMG hand me the sick bag) but after three years and some programming professionally I have found that there are a lot of degree people about who can't program for pudding but then also I have seen alot of un-qualified people who can't program for pudding either!

You are right in your approach to interviews thats what my company did mainly when hiring. The first company I ever had an interview with (for programming) also used this approach (thank god as I had no Qualifications and no experience only some example crap I made up myself) it works really well for both me and the employer as I found I in fact did know alot more about professional programming than I expected and also the employer got a feel for how I programmed and my ability.

Hmm all I need to do now is move to the US and badger you guys till you give me a job. Hehe Easy!

Kintoun
05-02-2001, 10:53 AM
Very educational Rich... I was going to post and ask for simple examples of when not to use OOP. But Foxnix did that nicely. I'm not standing up for OOP at all =). I just always enjoy debates as I end up learning more by taking a stance I may not even totally agree with myself, or have the knowledge to defend. Thx for the help Prof http://members.chello.nl/~deleeuw3/me.gif.

SylvanHistorian
05-10-2001, 02:17 AM
I'm reading Bjarne Stroustrup's The C++ Programming Language, about 10pages a day.
It will take more than 100 days to finish this massive volume at this rate.

It seems to me that too much features are integrated into C++.
How many programmers are there that have ever programmed using all those features, I wonder?
Or How many knows all of them?

C++ = C + object oriented programming;
Am I right?