Page 1 of 1
Programming language choice
Posted: 2008.11.01 (23:38)
by Luminaflare
What would be a good choice of programming language to code your own 2D game engine in?
Re: Programming language choice
Posted: 2008.11.01 (23:46)
by Exüberance
Well, if you just want a kind of rapid-devolopment kind of thing, I would recommend either Flash or Game Maker. Game Maker is more of a beginner language, but is EXTREMELY powerful and efficient (when you use code. The drag-and-drpo thing seems to give larger file sizes and loading time- probable because it's harder to compile that way), but doesn't have some more advanced things like error handling, and for some reason they decided to make array-handling functions difficult by making several different kinds of lists :/. it's also very limited as far as Object-Oriented Programming goes. You can access and change variables, but nto functions, in other instances, but you can't create Objects, and things like arrays are referenced in a kind of weird way.
If you have experience in Object-Oriented programming, you might want to consider Flash. It's similar to Java, and lets you create visual things very quickly. You can use both vectors and bitmaps, but it is limited in that you can't receive input from joysticks or gamepads, and writing to and reading from external files can be kind of tricky.
There's lots of great languages out there. C++ is a common language for programming games, but I would say Flash is probably a good place to start, or if you don't have much programming experience, you might want to start with something easier like Game Maker.
Re: Programming language choice
Posted: 2008.11.02 (01:36)
by smartalco
I'm going to agree with Exuberance (only I would definitely recommend Flash over Game Maker... just to be clear)
Re: Programming language choice
Posted: 2008.11.02 (01:56)
by mattk210
If you don't know the first thing about programming and don't really want to learn, go with game maker or multimedia fusion. The advantage of Game maker is that if you do get into programming properly, it is possible to make some fairly complex things using GML and you can have decent speed with ENIGMA.
If you are prepared to spend a few hours learning the basics of programming you'll want something a bit more logical, structured and better documented. Torque Game builder is very nice, but isn't that popular so you'll have trouble asking for help. Flash is very high-level so it's slow but is excellent at rendering vectors and has a lot of programming constructs that are very useful (like nested "movieclips"). There are some limitations like not being able to do file IO, but this can all be overcome by a flash wrapper of the likes of SWF studio. It's also multiplatform and can be embedded on a web page.
If you want to delve into real programming and graphics, C++ with DX/OpenGL is probably your best bet right now. It's very popular and has a lot of stuff written for it, and it's fast. Java is multiplatform and can be embedded online, but I don't have much to say about it because I've never really used it. Avoid BASIC variants like the plague.
I hear Raigan recommends processing, but I have no experience with that.
EDIT: I should also mention that flash is expensive, and GM, Java and C++/OGL are completely free (but you pay for special features in GM)
Re: Programming language choice
Posted: 2008.11.02 (04:43)
by Exüberance
EDIT: I should also mention that flash is expensive, and GM, Java and C++/OGL are completely free (but you pay for special features in GM)
Yeah, that's a good point too. GM is technically free, but you can't do anything usefull without upgrading for $20. As for Flash... well It's a programming language, vector drawing program, and animation in one, so it's pretty expensive. Plus they increase the price every version even though the barely add anything (with some notable exceptions- when they added AS 2 and AS 3... actually come to think of it Flash isn't that bad for updates. They actually add pretty useful stuff. Fireworks, on the other hand. No clue what they added in the new version. Didn't have the trial version long enough to find anything different from the last 2 versions.)
If you know all about pointers and memory and stuff, you should go for C++
If you've got some imperitive programming knowledge, but you've never done anything really major, I'd go for Flash
If I asked you what polymorphism is, and you responded a spell that turns people into sheep, I'd go with Game Maker.
Re: Programming language choice
Posted: 2008.11.02 (08:25)
by taaveti
You could try Euphoria or Python, if you want something a little heavier duty than Flash but don't want to go as far as Java or C. They're both pretty easy to learn, and they both take care of a lot of details for you.
Re: Programming language choice
Posted: 2008.11.02 (16:33)
by smartalco
I just remembered another little language thing I found a couple years ago that is fun to play around with and has a pretty low learning curve.
Processing
It is java based so it can use java code as well (teaches you a higher level language too, which is a plus).
Re: Programming language choice
Posted: 2008.11.03 (16:13)
by Luminaflare
Euphoria seems tempting. Opinions on it?
Re: Programming language choice
Posted: 2008.11.03 (19:18)
by scythe
Luminaflare wrote:Euphoria seems tempting. Opinions on it?
Well, it's interpreted, which means that in order for people to play your game, they have to download the interpreter. Other than that, it should work well enough; I don't know much about it to be honest.
Re: Programming language choice
Posted: 2008.11.03 (20:51)
by t̷s͢uk̕a͡t͜ư
scythe33 wrote:Luminaflare wrote:Euphoria seems tempting. Opinions on it?
Well, it's interpreted, which means that in order for people to play your game, they have to download the interpreter. Other than that, it should work well enough; I don't know much about it to be honest.
No, there are ways of compiling code that would otherwise be interpreted.
I mean, it basically bundles a mini-interpreter, unpacks the code, and interprets it, but it all looks and functions like a compiled binary.
Re: Programming language choice
Posted: 2008.11.04 (03:58)
by taaveti
I haven't really been up on the latest developments in Euphoria for a few years now, but back then you had to register (I don't remember the cost; I convinced my boss at the time that we should use it at work) in order to be able to make bound executables (as Tsukatu described). You can, however, freely distribute the interpreter, so you could distribute a package consisting of the source, the interpreter, and a shortcut/shell script/etc. which just does "exec ./ex myprog.ex". You'll run into the same issue with Python, or even with Java or Flash (although just about everyone has a JRE and Flash player installed nowadays).
That said, I still think it's definitely worth learning Euphoria. It does a good job of making certain challenging stuff much more accessible, so you can learn how to do it in other languages (probably 90% of my knowledge of Windows GUI programming came from dissecting David Cuny's win32lib for Euphoria).
Re: Programming language choice
Posted: 2008.11.13 (02:58)
by jean-luc
I've never done it myself, but I know that Python is very popular for rendering. examples I raise would be Phun (a 2D physics simulator) and Blender (an open source 3D rendering system competing with Autodesk's Maya/3ds Max). Python does seem to work great for simple projects up to projects of great complexity (like Blender).