Game Programming discussion thread
And actually, it seems that Microsoft has some really good tutorials set up for Visual Basic, C#, and C++. Not sure how advanced they get, but it's definitely enough to keep me busy for a couple weeks. Any tips on specific goals to try to achieve with my first project? Common beginner's blunders?
I am going to be updating the main page to include links to resources and tutorials. So maybe check back in 15 mins and it should be up on the first page.
i don't enjoy programming languages. i have made flash games. it's just alright for doing that. i made a simple batman quiz and a shooting target practice game. the target practice one took me a while to figure out how to make it. there were a lot of looking online for guides.
As for the speed of scripts and so on, tons of games use Lua, Unreal uses UnrealScript and so on, simply because they are easy to use. Yes, they are way slower than C++, but it doesn't matter, because the speed difference on modern PC's is negligible in most cases. Engines are written in the quicker languages, because they are the part that needs to be fast, but you don't have to worry about all that if you aren't making one. Honestly, if your 2D game is slow, it isn't the fault of language - it's your bad design that's slowing it down. It's much better to learn to write neat code in an easy-to-understand language, rather than making a mess with a complicated one. This is why people don't use assembly languages for many things - only the ones that really need to be fast.
@Venom2112: Absolutely agree with this, you do need maths for 3d programming, but it isn't overly difficult if you really enjoy it. All programming is maths heavy in one way or another.
I updated the main page to show all the links that people have put up here, so it's easier to access all the information in this thread. I'll try and keep the links updated .. so if any of you have any other links to share, go right ahead.
Also, for all the people trying out new stuff, if you get stuck, just give a shout out here and we'll try and get you out of your rut ! Happy coding people ..
Thanks to everyone for contributing :)
I don't know if this counts as a game programming query, rather more of a general programming one, but I'd really like to know how I should go about finding a loop invariant. I know what a loop invariant is, but I just have no idea how to spot one in the examples I've read or how to distinguish one in my own programs. Any enlightenment on it would be greatly appreciated :)
I would rather have this job then slave during crunch development cycles for less money and boat trips are awesome.
I'm kind of worried that people who study CS subjects that have the word "games" in it aren't actually interested in programming. If they just want to make games, they might be really disappointed when their done, especially as it's not easy to get a job in the games sector at all, let alone a good one. Also, they might find that it's not actually interesting to them. Not trying to put anyone off by saying this! I just think that if you want to be a games programmer you should be interested in programming in general.
This thread will probably end up being rather helpful to me.
Next year I'll be starting a Computer Science degree at a university in the UK. Between now and then I'm going to attempt some basic game programming to give me a head start :)
I'm planning, and hoping, to eventually get a job in the industry, fingers crossed I will eventually.
@Lumley: Before we starting talking, I demand to know which football club you swear your allegiance to ! If it's Chelsea, then I am afraid we will have to let our fists do the talking :P
Also, I was thinking, if any of you have any indie projects or anything at all you'd like to showcase, let me know and I'd put it up on the main page.
I'm intrigued by this thread just because there are people interested in making games here it seems. I don't know how relevant my own context is but I'm currently working on creating a 3D first-person game (first time I've ever done anything like this), though I've been thinking that I would probably make it in Source since I want to avoid having to create as many art assets as possible and since so many people already have access to it and so can easily play mods created with it. I'm only at the design stage of gradually constructing the design document after spending little bits of time on it for the past number of months and I'm guessing it could easily take the next 1-2 years to complete as long as I keep at it.
In case I run into issues later down the line which might require programming expertise that I don't have, I'll keep an eye on this thread or any similar ones that might spring up. If there's any threads out there on modding or even specific stuff on Source within the GB forums then I'd be interested in knowing - not my intention to post in the wrong place.
So what language does the source engine api support ? Are you working on C++ ?
P.S: On a side note, what the hell happened to Half life 2: Episode 3 ?? Source was probably the coolest game engine of it's time .. but I had heard rumors they are working on a new one.
I think C# is the way to go. It's the newer of the languages
& has already built on top of everything that has come before
it. I think Java is dead & C++ is great but still has its roots
stuck in UNIX, which isn't a bad thing if you already know
UNIX (or maybe do some perl programming for example).
But even so, most programmers are gonna write games
for the PC (to start) & for Microsoft for the most part.
My only problem with writing code is I don't have time to
play games. They're both very time consuming & the amount
of time, money & commitment to game writing is steep. I
remember coming back from summer break back in college
& seeing a fellow student had wrote a whole game of a
helicopter flying around the planet attacking stuff. He was an
Alpha Geek, however, highly intelligent over normal humans &
most of the rest of us in the same courses. What
I did in that same time frame was play Star Control 2 &
some other games & enjoy myself. I don't think that guy
ever became a game's programmer, but I'm sure he found
some kind of boring programming job in the private sector.
It's highly competitive though. Everyone has Masters degrees
& the folks in India can do it all for 25% of your salary. Except
outsourcing hasn't applied too strongly to games programming
yet. Game programming is still a Western industry...so far.
I can only program a little action script, yeah pathetic I know, flash is a pretty much a dying platform, I tried learning other stuff like c++, I actually programed a little using an open source engine called panda3D, which uses python, but didn't got too far on it, I guess it just isn't my thing, but I find programming specially in games(arguably one of the most complex kind of programing) fascinating.
" I think C# is the way to go. It's the newer of the languages & has already built on top of everything that has come before it. I think Java is dead & C++ is great but still has its roots stuck in UNIX, which isn't a bad thing if you already know UNIX (or maybe do some perl programming for example). But even so, most programmers are gonna write games for the PC (to start) & for Microsoft for the most part. "Do not listen to any of this.
Game programming is something I've been wanting to do, but I really want to get better at legitimate programming first before getting involved in stuff like that.
" @Lind_L_Taylor said:Fuck you! The company I work for just ported their" I think C# is the way to go. It's the newer of the languages & has already built on top of everything that has come before it. I think Java is dead & C++ is great but still has its roots stuck in UNIX, which isn't a bad thing if you already know UNIX (or maybe do some perl programming for example). But even so, most programmers are gonna write games for the PC (to start) & for Microsoft for the most part. "Do not listen to any of this. "
entire Enterprise product to C# (millions of lines of
code). I think the industry could be moving away
from C++, albeit the industry I'm talking about is
not the gaming industry.
C# is a great language and is very useful in cases of rapid application development. But it has much of the same problems as very high level languages like Java have .. it gets slower the more complicated your computation becomes. This is not really a fault of the program .. it's just that such high level languages give you so many generalized tools and libraries that it gets more and more difficult to optimize as your code drives the hardware harder and harder (since most of the code is pre written in such languages).
C++ is pretty hard at the start for this very specific reason .. lack of standardization, having to write a lot of code yourself (though with the inclusion of STL a lot of things have changed). In any case, as long as your code is well within your hardware configs, it is much easier to develop in C#, but most game companies try and push the console hardware to it's limits, and the only way they do it is by optimizing their code. Just think .. the PS3 and the Xbox hardwares haven't changed over all these years .. and yet games have been steadily getting better over the years. Why ? The only reason is tighter code, more tricks and hoops being run over .. in short .. optimization.
Most of the industry would use C# to probably create toolkits which are extensions that are then used to integrate within the main code framework written in C++. So it definitely has an application to both. But saying that C++ is useless is a pretty bold statement.
Having said that, as Beatrice Hall once said, I might not agree with what you say, but I will defend to death your right to say it ! :)
" @Lind_L_Taylor: All right. Before things get outta hand, I hope you calm down a little. It''s an internet forum for pete's sake .. and it's OK if someone disagrees with your opinion. C# is a great language and is very useful in cases of rapid application development. But it has much of the same problems as very high level languages like Java have .. it gets slower the more complicated your computation becomes. This is not really a fault of the program .. it's just that such high level languages give you so many generalized tools and libraries that it gets more and more difficult to optimize as your code drives the hardware harder and harder (since most of the code is pre written in such languages). C++ is pretty hard at the start for this very specific reason .. lack of standardization, having to write a lot of code yourself (though with the inclusion of STL a lot of things have changed). In any case, as long as your code is well within your hardware configs, it is much easier to develop in C#, but most game companies try and push the console hardware to it's limits, and the only way they do it is by optimizing their code. Just think .. the PS3 and the Xbox hardwares haven't changed over all these years .. and yet games have been steadily getting better over the years. Why ? The only reason is tighter code, more tricks and hoops being run over .. in short .. optimization. Most of the industry would use C# to probably create toolkits which are extensions that are then used to integrate within the main code framework written in C++. So it definitely has an application to both. But saying that C++ is useless is a pretty bold statement. Having said that, as Beatrice Hall once said, I might not agree with what you say, but I will defend to death your right to say it ! :) "
Yeah..looks like I was talking out of my ass. I went & reread Chapter 1
of my C# O'Reilly book. Although it claims C# is fast, I guess it doesn't
have the tweaks available. Microsoft is betting the farm on it though,
according to the book. Also, in most cases, if you want a faster experience
you just buy a bigger box. Except in the case of consoles. Perhaps
consoles have reached their limit, as I can already see some glitchy
framerate showing up in Halo:Reach & perhaps other newer games
as well.
Though you can tweak code in C++ to make it faster, doesn't that
also make it more difficult to read/understand? It'll get to the point
where only those that wrote it know what the hell is going on & new
comers will be looking at a mountain of confusion. Why not just use
C instead of C++? Seems that would be faster to rid yourself of the
OO overhead stuff.
Put this as a section on your front page so people know." Also, I was thinking, if any of you have any indie projects or anything at all you'd like to showcase, let me know and I'd put it up on the main page. "
If users post youtube clips of their work then I could make a blog linked to your site which archives them.
Like this.
Edit: That other thread I told you about was a bit to ambitious so I have left it for now lol
Code does have to be optimized, but it isn't necessary to write all of it in assembly. You need to balance readability, time and performance.
Also, C# was developed by Microsoft, so even though there are ways to run it on other operating systems, it will always have an emphasis on Windows. This just doesn't cut it for most projects - you need the code to be platform independent.
There is a new standart of C++ in development, currently called C++0x, but even though I am no expert, I think it won't solve the problems that are the reasons for people not wanting to use C++ in some cases. In most cases it adds even more features to the language, which will probably please the expert users that are making complex projects with C++ right now, but for newbies it might make the language even more intimidating, as it will get larger in scope.
Why not just use C instead of C++? Seems that would be faster to rid yourself of the OO overhead stuff. "
Correct me if I am wrong, but C is not really an Object oriented language. You don't have classes and objects in it and there is really no concept of data abstraction. And yes, you are right about the readability factor. Seeing a bunch of *myArray = (int*) what-the-hell-is-going-on; isn't exactly pretty, but once you get the hang of it, it's very very powerful. When you start working on more and more complicated projects, I am sure you'd be pleasantly surprised by how good tight code might run within a fraction of a second rather than say, ten of them. I just recently worked on some AI code that literally took 10 minutes to run, until I made changes in 4 lines of code, and now it completes within 10 seconds. Also, the C++ community has been working hard to make C++ more accesible. Things like smart pointers and more automatic error handling is being introduced in the new C++0x standar, so hopefully it makes it easier for newbies to start coding. (But to be honest, I don't think it's gonna be that much different that what it is right now .. unless you already know your stuff in C++). But anyways, bottomline is, C++ .. terrible at the start, but it's kinda worth the pain.
Coming back to C# though, if you really think about it, most of the functions can be overridden. So if you are a super geek who actually knows all the code that runs in the background, you can totally override most of the functions and write your own implementation. Except there are two roadblocks .. one, most people don't really program on that low a level. And two, I'm sure some of the code is final, as in, you can't override those sections of the source code.
@Joru: Yeah, I'm pretty stoked about the new C++0x, especially since they say that a better implementation of hashing is on it's way (and high time I say !), but I'm not entirely sure what other features are being included. In any case, can't be more mindfuck than right now right ? :P :P
Will set up a blog when people start sending stuff in :)
" @Lind_L_Taylor said:Right. C isn't an object oriented language, but that also means itWhy not just use C instead of C++? Seems that would be faster to rid yourself of the OO overhead stuff. "
Correct me if I am wrong, but C is not really an Object oriented language. You don't have classes and objects in it and there is really no concept of data abstraction. And yes, you are right about the readability factor. Seeing a bunch of *myArray = (int*) what-the-hell-is-going-on; isn't exactly pretty, but once you get the hang of it, it's very very powerful. When you start working on more and more complicated projects, I am sure you'd be pleasantly surprised by how good tight code might run within a fraction of a second rather than say, ten of them. I just recently worked on some AI code that literally took 10 minutes to run, until I made changes in 4 lines of code, and now it completes within 10 seconds. Also, the C++ community has been working hard to make C++ more accesible. Things like smart pointers and more automatic error handling is being introduced in the new C++0x standar, so hopefully it makes it easier for newbies to start coding. (But to be honest, I don't think it's gonna be that much different that what it is right now .. unless you already know your stuff in C++). But anyways, bottomline is, C++ .. terrible at the start, but it's kinda worth the pain.
Coming back to C# though, if you really think about it, most of the functions can be overridden. So if you are a super geek who actually knows all the code that runs in the background, you can totally override most of the functions and write your own implementation. Except there are two roadblocks .. one, most people don't really program on that low a level. And two, I'm sure some of the code is final, as in, you can't override those sections of the source code.
@Joru: Yeah, I'm pretty stoked about the new C++0x, especially since they say that a better implementation of hashing is on it's way (and high time I say !), but I'm not entirely sure what other features are being included. In any case, can't be more mindfuck than right now right ? :P :P "
removes some overhead which increases speed (although it has
been a while maybe the OO stuff isn't as bad now). I think I was looking
at some game programming books on books24x7 recently & they were
stating something about still using C even though it was a C++
compiler. lol. But anyway, I'm out of it. I studied OOP in
College & C/C++, although I really preferred Pascal to C++.
I hear one of the founders of C# invented Pascal. I'll probably
explore it, but I doubt I'll be writing anything complex. I'm on a
Mac so I should probably read up on some Cocoa as well or
"MonoMac" or just load up a w2k8 r2 vm with visual studio for
true c#.
And if you wanna see the sick progress I made during my tutorial-wandering in C#, check out my blog. (Note: I actually did a little more than that... but that's the only video I uploaded of my progress)
EDIT: Does anyone have any idea on how I can insert a image like the one below and continue wrapping my text around it ? Can't seem to figure out a way to do that ..

At the end of the day choosing between the C languages all comes down to the match of simplicity v control. While all the C languages have some form of control, having more of it means you have a better gauge as pertaining to performance. Especially in games where performance is absolutely key, i'd say it's up there with the gameplay if not more important and lower level languages give you that control. I mean:
- C is the least simple but probably the most powerful. This is due to the almost zero percent OO nature of the code and the functionality of the memory management but to people coming in recently C is the most hard to read and understand so takes more effort.
- C++ is almost the same as C in terms of both categories but becomes slightly easier to read and understand for newcomers. There is also way more graphical API support for C++ so when creating graphical interfaces etc this imo is the best choice.
- C# is a much bigger jump to simple than C to C++ is. C# is the the C languages equivalent of Java in that it uses a 'garbage collector' to manage memory and get rid of unrefenced parts of the code etc, so lack of control affects performance. The most easiest to read and understand and probably the most supported for newcomers.
- The wierd one is objective C (the iPhone uses it) in that it's like C# but it's almost impossible to read the way variables and methods are declared is probably the most wierd i've seen and i would not recommend this to people wanting to learn the fundamentals of programming. But integration in objective C is pretty cool.
Pretty nice summary. I totally agree with you about objective C. I've been programming for a pretty long time, and yet the first time I looked at it, I still was pretty confused. Unless a person really wants to develop for iPhone, they shouldn't go near it. Even if they do want to develop on the iPhone, they're still probably better off starting with C++ or C#.
If anyone is interested in the iPhone i feel you must first play with the interface builder before going anywhere near the code. This is because the Interface builder can put the relevant parts you create into the code for you and you can create the links i.e what you want to happen when you press a button, into a simple event.
@delski: Do you have any idea how to develop for the iPhone from a windows machine ? I have heard something about this software called "Hackintosh" but never got around to using it. I have an iPod touch and was wondering if I could put stuff on it like I can on an Android. My Prof was telling me about how variables are acquired or released in Objective C, which is the most confusing part but it kinda bounced off the top of my head. Why does Apple have to be so closed out from everything else .. uhhh .. it drives me crazy sometimes !!!
Also .. if you have any links to tutorials about Objective C .. or any pointers about iPhone development, leave a link here and I'll post it on the main page.
Also it's nowhere near as open as Android to even place apps that you created onto a touch/iPhone you need to pay the licence fee. This is not something where they want you to distribute apps at all without paying them.
This guys pretty good on the tutorial side, he runs all the way through from installing the programs needed to an app base (think theres about 30 tutorial vids from him):
http://www.youtube.com/watch?v=abcMmyhKCno
Theres seems to be loads on Youtube for developing simple applications for the iPhone.
I'd also recommend checking this book out:
http://www.amazon.co.uk/Yourself-iPhone-Application-Development-Yourself/dp/0672330849
It's fully coloured and pictured for what you need to do and it even goes into multi view apps etc, it's a bit hard to read at first but you get used to it.
Also let me run through quick what software you need, what you need to spend to distribute on the app store etc:
- XCODE development platform with a version of the iPhone SDK (You can get these by signing up free to the apple development program, The latest version of iOS is in beta so atm i'd recommend downloading iOS 4.1 SDK, which they tend to bundle with the version of XCODE that you need).
- Obviously as i said MAC OS Leopard or later so basically every MAC from say 2006/2007 is okay for developing for the iPhone.
- To distribute on the app store you need a licence, this costs 50 pounds a year, don't quote me but i think it's $90 for the year. This gives you access to placing any amount of apps onto the app store worldwide that go through the approval process.
Edit: Main page updated .. thanks man ! I appreciate the info ..
Basically what happens is only after you pay do you get a 'code signature' (Mac uses wierd keychain access this is detailed in the book as well as one some tutorials) to use within XCODE that you can apply to your compiled program. Much like creating debug and release versions of a program you can create a device version of a program to place onto your device (I assume this is to prevent you from just gathering an amount of iPhones and placing them on there through XCODE).
Then through your development portal you add devices that you can use for testing purposes, they call it 'Ad-Hoc' and you use the device ID for each device. You then have to recompile your program for this device ID so you can add it. It's really convoluted and closed off but this is Apple i guess.
Apple themselves got a pretty comprehensive site regarding iPhone programming and Objective C. I haven't read the entire thread so I don't know if anyone else posted it but if you're interested it's over here: http://developer.apple.com/devcenter/ios/index.action
Also, if I'm remembering correctly, you can develop apps without paying 90 bucks, but you're limited to running them under the iPhone emulator. Haven't got that far myself in my forays of iPhone gaming programming though. Still working on the basics of Objective C.
@Venom2112: You can probably use VM (Virtual Machine) software to run OSX in Windows and use that for iPhone development, but that propably has it's own limitations.
Also, I honestly don't think there is any reason to go the hard way when you're learning and not go for something simple like C# or Java. The things you are going to be writing when you're starting out aren't going to be that complicated that the speed of the language really affects it. They may not be as fast as C++ or C, but they were written by professionals who know how to optimise code much better than beginners do and you're probably going to make a mess of it if you start out with a difficult language.
For things with the console, exercises and so on, it's definitely worth learning C++ or the like. But if you want to make a game, never go over your head. If you're adamant about using C++, you should at least find a simple library to use. Also, regardless of what language you want to use, always read a lot about bad habits and things you shouldn't do in general. If you intend to write something fairly big (basically any game that isn't tictactoe or pong) you should know the kinks of the language, otherwise you'll write bad code that works slowly and begins to fall apart eventually.
Please Log In to post.
Log in to comment