Wednesday, April 18, 2012

Programming languages

So I've finally decided to go ahead and make a game. I have the concept, the basic UI, and functionality in mind. I'm now deciding which language to program it in, and that's where I could use your help in evaluating the pros and cons.

I have programming experience in C++, OpenGL, Matlab, html (if it counts), but I've played around with other languages like lisp, basic, etc. I can adapt to a new language. I did enjoy C++ most though for programming purposes.

I'm looking for something that would be fairly current, object-oriented, and wouldn't cost me too much to setup. In fact, if freely available, the better. I'll develop on PC, but it would be nice if what I make transfers to other platforms. I'm thinking either internet and/or iPad. iPod/smartphone would probably be too cluttered.

The game I have in mind needs enough space for buttons, needs to run in real-time, but the graphics are fairly simple. I don't have resources for an art team ;) Also, it needs to run simple physics which I can implement myself... but it needs to be fast enough for it.

Thanks in advance.|||For iPad you can only use objective C, which requires a license from apple and a mac to program on.

Otherwise use either java with AWT for graphics (not that hard, not that pretty) or C++ with directX or openGL for graphics (harder but prettier)|||Quote:






View Post

Otherwise use either java with AWT for graphics (not that hard, not that pretty) or C++ with directX or openGL for graphics (harder but prettier)




This, though depending on the application, you might want to check out Swing instead of AWT for Java.|||Quote:






View Post

check out Swing instead of AWT for Java.




Indeed, the drawing can also be done on a jPanel. I can even send you an example of that :p|||Objective C, is that very close to C++? I mean, if I wrote it C++ with OpenGL, can I assume it wouldn't be that hard to port it after?

Also, Java... what do you mean by "not that good of graphics". I really haven't heard of jpanel, swing, or awt... what are those and what's the pros and cons?|||Quote:






View Post

Objective C, is that very close to C++? I mean, if I wrote it C++ with OpenGL, can I assume it wouldn't be that hard to port it after?

Also, Java... what do you mean by "not that good of graphics". I really haven't heard of jpanel, swing, or awt... what are those and what's the pros and cons?




Objective C is what you'd call "C for Mac". I'm not very familiar with it, but code segments I've seen of it seemed completely different from C++.

Using Java while not being familiar with graphics designing means you'll be relying on the existing Java Libraries for the look and feel, which tends to be "Java-ish", and can be limiting at times. AWT and Swing are both GUI Libraries available for Java.

Here's a decent overview and comparison between the two:

http://edn.embarcadero.com/article/26970|||While you didn't list it and it's not that popular in the land of professional developers, I personally recommend C#. I'll list some pro's and cons here:

PROS

====
  • Incredibly easy syntax

  • Supported by Unity3D (Free license available - Mac; PC; Browser; Xbox; PS3; iPhone; iPod; iPad publishing available when the appropriate license is bought (Mac & Pc & Browser are free)

  • XNA is an easy DirectX wrapper made by Microsoft (creators of C#). Allows relatively cheap publishing on Zune and XBOX360

  • Easy to learn if you know C++

  • OO-Programming

  • No pointers like in C++

  • Unofficial MonoXNA gives support for Linux and MacOSX



CONS

====
  • Controlled by Microsoft

  • In essence not really cross-platform

  • Rarely used in game-development

  • MonoXNA is no longer supported iirc



C# was a great starter for me in game-development. Best thing is that it allows you to publish in Apple devices (through Unity3D, though). I use XNA and without any previous knowledge of programming, managed to create a very basic 2D level-editor (no level saving yet) in 2 days.

I would recommend C++ since you know that, though. It's used EVERYWHERE. And here's the best thing: the source engine uses it. And if anyone is mod-friendly, it's got to be Valve. If you're lucky, they'll see your project and who knows, you'll be working on Episode 3 sooner or later? :P|||Quote:






View Post

While you didn't list it and it's not that popular in the land of professional developers, I personally recommend C#.




I'd also say C#.

Although I have to admit I didn't yet try anything that rely depends on graphics, as a game would.

But it's easy to use, and you get the language and IDE for free (Visual C# express).

At leat part of the language is standardized, so if you keep to standard .Net classes, it would be (in theory) easy to port to a different platform.

The final program will need the .Net framework, though. Which may make it hard to port it, as the target platform needs the framework too. For Linux there is Mono, but I don't know how good it is beyond command line use.

(My program uses only the command line on Linux, I haven't had the chance to try the GUI.)

Aside from that, the eternal classic would be C or C++.

Either way, you'll likely depend on external libraries, limiting the portability.|||I'd say C++, C# or Java, in that order of preference. It basically boils down to what perks you want, different for each language.

C++:

* Blitheringly fast (if you care about such things)

* You already know it

* Tons and tons of free libraries written in C can be hooked into your C++ code easily

* Full DirectX access

C#:

* Garbage collection

* Neat-looking code (you want this when you look at it again for the first time in 3 years)

* XNA (you can theoretically use C++ with XNA as well but it's not officially supported)

Java:

* Garbage collection

* Platform independent

* Java3D

* Easy GUI creation


Quote:






View Post

No pointers like in C++




That's not a benefit. Also, use references.

No comments:

Post a Comment