The Language of Game Development

YicklePigeon

New member
Jan 3, 2012
34
0
0
Scrumpmonkey said:
Python is indeed a great place to start, a few friends of mine who have gone on to do well in computing started using python back when we were 14. I only ever got to a level where i could make the basic calculator demos and the like but i feel like if i ever did feel like getting more into coding i have at least a slight basis.

Being British i have of course used BBC Basic (which is actually a bit shite)
I too learned BBC BASIC and followed programming listings from old copies of The Micro User that my father had lent me. Heck, even my Mum sat in front of the ol' Model B copying listings over...ah happy days! :)

--

Moving on though, if there's one thing I learned back when I was 16 (14 years ago...gah! The light in my hand will be flashing at any moment!) was if you're going to learn how to code, you're going to have to do it yourself. Schools and other places of education are always behind, both due to the time it takes to include a new curriculum/additional material and that the teachers are usually not expert enough in more than one compiled language. Indeed, if you asked them to list examples of interpreted/just-in-time/fully compiled languages? There is a good chance that they'd look at you blankly/mock as to why anyone would need to know such a thing/rush to Google/Wikipedia for salvation. Few would be mature-minded enough to put you at ease one way or the other.

When I was 26, I went into higher education to study computing, figuring there would be gaps in my knowledge (that I would be blind to) and that a course would fill. I was wrong, on both counts at both the foundation and undergraduate level. As a class, we taken six months just to do a simple Java program using strings and hard-coded places to put a person's name, whereas in 12 hours spread over a few days or a full week? You could have written an entire text adventure engine in C# for free with 3D Buzz.

If anything though, I would advise a school/college-leaver to learn as many languages as possible (check job listings as to what's expected) and qualification-wise the Microsoft Certified Solutions Developer track or other private equivalent. That and book learning, a dual-monitor setup and a touch-typing class! Why the touch-typing? Well, the number of people learning to code that I've met, who had to keep looking for a particular key/the hunt 'n' peck/two-finger typing...yeah, not ideal when you should be thinking in terms of programming syntax rather than "Dude! Where's the ampersand?!".

As for C++? Part of me wants to throw people in at the deep-end, if only for psychological scarring to occur and for students to see just how difficult high-level programming is and where they are on the road to learning all this stuff, as too many students that I've met simply have no idea as to what's truly difficult (apart from what they're trying to learn at that point in time).
 

92Sierra

New member
Oct 12, 2009
30
0
0
This is a welcome edition to the Escapist! Please write more programming posts! A series even!
As a new programmer learning Java, I have to put it up there with one of the easier languages to learn (Javascript being even easier). Too, based off how every Java book and tutorial assumes you know C, it has to be easy to move to C if necessary.
 

Kargathia

New member
Jul 16, 2009
1,657
0
0
MmmFiber said:
Python is a great place to start learning the basic concepts behind programming. And, C# definitely hits the sweet-spot. I've been using C# for a while now, and it is great. C# is fairly quick, easy to read, fast to write, and not old enough to have over 9000 deprecated classes/methods.
As an ICT student, I was started out on C#, and can agree on this. It's clean, readable, has lots of support, and is well-suited for the relatively compact programs you'll be writing the first year or so.

Beyond that the main focus of the curriculum is not coding, but Software Engineering - all the work you do on your software before you even open Visual Studio (or whatever else you work with).
 

fractal_butterfly

New member
Sep 4, 2010
160
0
0
I myself had the following path in learning programming:

Q-Basic
Visual Basic
Some dabbling in HTML and CSS
C++, but did not get the hang of it at that time
Java (here I learned Object Oriented Programming)
C++ again (fought myself through a guide for programming games with C++ and DirectX, this time I succeeded)
ActionScript, JavaScript
Again HTML, CSS, mixed with PHP and SQL
Python (it was really easy, I just learned it as a side effect from one course at my university and even wrote my Bachelor thesis in it)
ProLog (but only basics, never really programmed something in it, was more something like "Look what freakish stuff is out there!")
C# and ASP.Net (I learned this solely for a new job, and quickly got a hang of it because of the similarities to Java and C++)

Bottomline: once you have learned enough programming languages, it is really easy to pick up new ones. The differences become more and more negligible. I agree that you should start with something easy, like JavaScript or Python (besser pick Python, it is really easy and you can do a ton of stuff with it, but JavaScript is useful for several things, like web development, and also Unity 3D). But you should switch to a higher, strongly typed programming language as soon as you can (like Java, C# or C++). If you start serious programming projects, you will need this, or your project will become a mess.
 

Hagi

New member
Apr 10, 2011
2,741
0
0
Retsam19 said:
As a programmer (though admittedly not a game programmer); I'd actually tenatively put Javascript as my top language to learn. It's got a lot of the benefits of python, that it's a language that's fairly simple, doesn't have a lot of the baggage that C++ family languages do, but it's much closer to those languages than, say, python. Also, it's literally impossible to more convenient language, right now. Press F12 (Cmd-option-J for mac users), type "alert('Hello World')", and boom, you're programming in Javascript. (And then please forget that alert exists and never type it again, but that's a tangent)
Javascript is definitely fun but it's also one of the very, very few prototype-based languages which means that unlike pretty much every single language mentioned here it's not class-based.

As such while Javascript is a great and fun language, which with nodejs has evolved much beyond the web, once you get in-depth it doesn't carry over nearly as well to other languages.

On the surface you won't even notice the difference exists. Hell, a lot of programmers, even those using javascript regularly, don't even know it's prototype-based, let alone what that exactly means.

So as long as you stay near the surface javascript is awesome for learning. Once you get more in-depth whatever you learn pretty much applies only to Javascript because deep-down it's a different type of language (which, to make things even more confusing is later compiled to a class-based representation of it's prototype-based self since as it turns out class-based is much faster).
 

Whoracle

New member
Jan 7, 2008
241
0
0
One thing to note in regards to JavaScript: It has a few REALLY weird quirks, most notably that INTs are really FLOATs, internally. Usually that's no problem, but it gets iffy if you implement crypto (which you shouldn't) or get to the borders of a specific field (statistics generally, but I guess it's going to haunt us once WebGL really takes off).

What I like about python is that it teaches you the paradigms of programming without the syntax problems of C or the needless verbosity of Java. No fuzzing about that one ; you forgot, and less of dependency hell than for example eclipse based projects. At least for now.

Also, there are static analysis tools for python. A quick google search comes up with pylint, pychecker and pyflakes. Don't know how they hold up.

Only downside is that python isn't strongly typed. But neither is it weakly typed. It has this weird limbo where a variable can be any type, until you first assing something to it, then it's forever cast as that type. Dunno how you'd call that, "semi-strongly typed"?
 

Starker

New member
Mar 17, 2011
47
0
0
Retsam19 said:
But the best is that html is one of the easiest ways to put together a decent user interface, which is one of the trickier problems in programming (creator of minecraft [https://twitter.com/notch/status/466240151761715200] tweeted earlier today roughly compared it to kissing poisonous snakes), but a critical hurdle to game programming. (Unless you're making a text adventure game)
Decent text adventure interfaces are actually not as easy to make as it would seem. A text prompt (with its promise of unlimited possibilities and failure to deliver on it) is inherently scary for new players and there's not a lot you can do to make it seem more friendly (although even a few basic things like hotkeys, autocompletion, hyperlinks and command history help a lot). Text adventures have come a really long way since the 80s, but the user interface is still far from being a "solved problem".


Also, venomous snakes are way scarier than poisonous snakes.
 

rembrandtqeinstein

New member
Sep 4, 2009
2,173
0
0
Once you've been in the programming game long enough you realize that the language doesn't matter. The most important thing is planning a solid structure for your application (game or whatever) then you can translate that to any language.

More important than the language is the programmers experience and ability to translate requirements into code.

Nowadays its easier than ever to get stated in game development. Download Unity (or any number of engines) and follow one of the innumerable step-by-step tutorials. And repeat that until you are comfortable enough with your engine to try a couple of proof of concepts.

Here is one thing I've learned after failing for 3ish years of failing to create a commercial game. Making games is easy, making products is hard. But I've learned a lot about development in general.

This is the closest I came to a commercial release:



You can play it here if you are willing to risk a windows installer

https://dl.dropboxusercontent.com/u/221516245/valance1.0.0.22/Valance-Default-1.0.0.22.exe

hmm doesn't appear that I can post a screenshot, here is the link to the screenshot I guess

http://postimg.org/image/9tg0j6qin/
 

Retsam19

New member
Dec 6, 2010
60
0
0
92Sierra said:
This is a welcome edition to the Escapist! Please write more programming posts! A series even!
As a new programmer learning Java, I have to put it up there with one of the easier languages to learn (Javascript being even easier). Too, based off how every Java book and tutorial assumes you know C, it has to be easy to move to C if necessary.
I'm not sure Shamus reads the escapist comments for his posts here, but he definitely reads comments on his blog if you wanted to post that same comment here [http://www.shamusyoung.com/twentysidedtale/?p=23076#comments]. A lot of his regular blog readers are hoping Shamus will start doing more programming stuff on the Escapist, but in the mean time he has several programming series posted on the blog. (And he's just in the last week started a new one)
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
Arnoxthe1 said:
Tiamat666 said:
For me, bytecode languages with just-in-time compilation like Java... I will not bother with C or C++ because as a hobbyist game programmer there is no way I will need the kind of performance
You know, that's what Notch thought when he made Minecraft. 'I'm not doing anything serious. I'll just write this in Java.' And to this day, we are still paying the price for it with EXCESSIVE amounts of load on the processor and almost nothing on the graphics card.

Just saiyan. You never know what could happen. Best to learn something like C++ for anything big at all you might want to do.
I'm not very familiar with Minecraft internals, but I wouldn't find it surprising that a voxel based game like Minecraft should put more stress on the CPU than on the graphics card. You only have to look at Minecraft to see why. There are considerably less polygons on screen than on a AAA title, but you have all that underlying voxel processing going on, of which there are a lot, in Minecraft probably hundreds of thousands.

Studies have found however that just-in-time compiled languages like Java in most cases come close to the performance of C++, and in rare cases even exceed it. I am certain that with today's hardware the skill of the programmer and the algorithms used are more significant to performance than the programming language.
 

Darkness665

New member
Dec 21, 2010
193
0
0
I've read your code Shamus. You are a C programmer that uses C++. I have little tolerance for C++ and its idiotic idioms.

I am a C programmer that uses assembler. Just for comparison. ;-)
 

someonehairy-ish

New member
Mar 15, 2009
1,949
0
0
I sometimes work with a friend of mine to do game design competitions, e.g. Ludum Dare; I handle the art and he handles the code. But it would be really nice if I could at least code well enough to make my own prototypes.

So, it looks like I should be learning Python then?

Does anyone know of any good (preferably free) resources to start learning it?
 

geizr

New member
Oct 9, 2008
850
0
0
I would have to disagree with the bit about starting in Python. I would recommend starting in C and then split to either Python or C++. The reason is that starting in Python (or even JAVA, for that matter), one tends to pick up a lot of bad habits and lazy styles that will absolutely destroy you in C (and C++), if you ever have to go backwards into C for performance reasons. The C programming language (as well as the C++ programming language) will gladly let you spin a phenomenally long and massively thick rope of the finest material with which to hang yourself, and the primary things that will destroy you will be the lack of understanding and facility with pointers and memory handling, particularly avoiding array overruns (you know all those buffer-overrun vulnerabilities? failure to check pointers and allocation bounds), memory leaks, and attempts to write or read unallocated memory. Also, pointer dereferencing will be a major problem. Learning to set deallocated pointers to NULL (not 0, because there is no guarantee that NULL and 0 will remain the same in the language) and check for NULL (again, not 0) pointers can often save a lot of grief in these regards. If you learn how to deal with pointers and memory management early, then when you transition to Python and C++, those issues will be second nature to you, and you will be better prepared to deal with the particular subtleties that Python and C++ offer regarding memory (especially C++, where you need to understand hidden constructor calls, which can suck the life out of your code's performance).

ADDENDUM: Yes, I admit, starting in C is the harder road, but I think putting the pain upfront will serve one better down the long road as you learn what to do, what not to do, and what things to look for. You gain a more detailed perspective, in my opinion, of the nature and behavior of the code, especially once you realize that many of the higher-level scripting languages, like Python (C++ is not a scripting language, just to be clear), are just calls to underlying C code.
 

geizr

New member
Oct 9, 2008
850
0
0
TiberiusEsuriens said:
A big problem with a lot of people in the software engineering industry is that they tunnel vision. All too often people dedicate their entire work lives to learning "that one language which they will use forever." However, the industry evolves and the desired languages change more often than most want to admit.

If you want to get into software (be it gaming, financial, or any other field) the most import thing you can do is learn concepts, not languages. Once you've 'learned' one language, you can pick up most others because they all share concepts. Just like games, languages are typically built off of each other. It can be more beneficial just to pick a language that approaches the most programming concepts and practices.

Would rather know how to expertly craft a screw or a nail, or would you rather know what screws, nails, timbers, and shingles are and how to combine them to make a house?
As a further addendum to my earlier post, I have to agree with this statement. This is a very key element that is missed by the "fad" of learning a programming language. The programming language is nothing but a means to tell the computer what you want it to do. It's more important to learn the logical and mathematical constructions and conceptualization that goes into being able to break a complete operation down into a series of logical steps, i.e. the algorithm. Once you learn how to do this, it doesn't matter what language you deal with; they'll all look the same. Learning the language just becomes an exercise in semantics and syntax. So, even before one starts with the programming language, one needs to learn to think in algorithms and operations. From there, one can then move into interacting logical constructs, i.e. objects.
 

Colt47

New member
Oct 31, 2012
1,065
0
0
The only disadvantage to starting in python is that it's somewhat hard to debug a problem due to variables being dynamically assigned. Forward declarations of variables helps immensely with narrowing down type cast issues. This has become glaringly apparent in my work when I tried building a program using the A* algorithm.
 

Scars Unseen

^ ^ v v < > < > B A
May 7, 2009
3,028
0
0
I started out coding by looking at the source code for Gorillas in QBasic. I'm not very practiced at programming, mostly having made a few helpful programs(and one text based adventure game) on my old TI-83 calculator. I've recently started picking up Common Lisp after having picked up an interest from reading XKCD comics. I could recommend Land of Lisp for that, as it teaches the language by having you make several small games.
 

Tamayo

New member
May 16, 2014
40
0
0
Ah, hi.

Let me reiterate the suggestion of Python; it was explicitly designed to be a good first language, and it has lots of useful libraries with beautifully-written source code to read. It is one of the very few languages that Lisp enthusiasts will grudgingly admit to being almost okay.

(Or, you could learn Lisp. Not exactly an ideal language for game design, but the absolute best language ever to learn computer science. Pshaww, nah, too many parentheses, you say. Well ... um ...)

But, you say, Python is slow (sadly, it is, but computers these days are really really fast) and Lisp is weird. You want a proper compiled language that runs at most an order of magnitude more slowly than tuned C code, and you want it to be robust and scalable and all those nice things. You also want it to be able to communicate with those complicated game engines written in C and assembly language without too much hassle. Then, sir or madam, you should be using Haskell.

... what?

Yes. Remember that from your boss' point of view, programmer productivity is far more important than code execution speed. Haskell is even more terse and powerful than Python. In particular, Haskell and other pure functional languages are really the only effective way to take advantage of multi-core processors, unless your name is John Carmack; taming massive parallelism is mind-blowingly difficult in any imperative language but in Haskell, your compiler does almost all of the hard work for you.

Also significantly, Haskell is fairly easy to learn as a first language. In fact, if you adopt Haskell or Scheme or SML or Common Lisp or perhaps even Scala before you get down to the metal in C, you will be a better programmer. Declarative languages such as these teach you how to think about data and algorithms rather than states and procedures, and you will have fewer bugs in the programs you write in any language.
 

Tarfeather

New member
May 1, 2013
128
0
0
What a disappointing bullshit article. It's like Shamus doesn't realize that the game industry is already filled to the brim, and even professional programmers would have a hard time finding a job there. Telling complete amateurs "It's okay, you can start off by doing this and that" is just dishonest.
 

Scars Unseen

^ ^ v v < > < > B A
May 7, 2009
3,028
0
0
Tarfeather said:
What a disappointing bullshit article. It's like Shamus doesn't realize that the game industry is already filled to the brim, and even professional programmers would have a hard time finding a job there. Telling complete amateurs "It's okay, you can start off by doing this and that" is just dishonest.
Yeah, I mean if you want to join a development studio, you're pretty much going to have to learn whatever language they're using anyway, so what's the point in pondering whether a language if effective for you personally or not? It's not like you can just go out and make a game independently.

Wait.

Tamayo said:
(Or, you could learn Lisp. Not exactly an ideal language for game design, but the absolute best language ever to learn computer science. Pshaww, nah, too many parentheses, you say. Well ... um ...)
It's not a commonly used language, true, but nothing about it is particularly bad for the purpose of games programming(and apparently Jak and Daxter was partially programmed in a custom dialect of Lisp). It's a multi-paradigm language that can do pretty much anything any other language can do(though obviously not as efficiently as a low level language), and in the hands of someone competent in the language, often in less lines of code than in other languages.

As for the parentheses, yeah, they take some getting used to, but I don't find them any more or less annoying than semicolons or whatever other punctuation or syntax might be peculiar to any given language. The biggest thing I can say against learning Common Lisp is that any given company you might want to get hired by probably isn't using it. But for personal use? I'm liking it alright so far.