Advertisement

(yet another) best language to code a game?

Started by January 07, 2016 07:02 PM
10 comments, last by Anri 8 years, 11 months ago

Whenever I search for an answer to this, I always get "what you're best at", Python, Java, C#, C++, as the main answers (C#, Python mentioned in this board's FAQ).

I program for a living and know many languages so don't mind learning more, so "what you're best at" isn't really an answer. The question here is more of which language is the best tool for the job, as in best libraries and performance.

Python has pygame which I hear mixed things about, the framerate, speed, and portability is sub-par (from what I hear), and filesize of the exe. But has a lot of useful libraries for sound, gfx, etc.

C# had XNA but it's discontinued and I can't find any tutorials or anything online. I think I found a resurrection movement around but I'm not really impressed. Plus, couldn't find any tutorials or anything which how to start a game in C#.

Java is the one i hear the most about probably because of its ease of use but I also hear things about performance and overly verbose coding. Plus for gfx you mainly have to use OpenGL which is a nightmare.

C++ is another one I'd consider but as a first time game project, maybe avoiding C++ would be better?

I'd like to stay away from engines like Unity3d or Flash, and hope to be able to code a platformer with some 3d movements to run on a PC system (not interested in mobile).

So out of these or others not listed, which is the best tool for the job? Fastest to write, easiest to maintain, lots of game related libs (maybe even physics?), good performance/filesize, etc. I know this is going to be opinionated, because probably there really is no best language. But I'd love to read what you guys think.

Python - best for scripting, not games

C++ - well, its a industry standard for a reason. Its fast, kinda hard to get the hang on for beginners but you have a programming background so i think learning it will be easy for you, allows you to do things that Java or Python for example wouldn't and its the best choice for 3D games (IMO) with libraries like SDL

Java - good for 2D games (IMO) and applications, easy to learn, easy to use, lots of libraries and tutorials but its a little bit slower than C++ and i wouldn't use it for 3D games

Advertisement

I think the answer, still, is to go with what you're comfortable with, if for no other reason than to eliminate the crossed wires of learning two things at once -- a new language, and a new (and very different) problem domain. Furthermore, games that push the performance envelope often lead programmers to bend the normal rules of good programming practice in whatever language, which can lead you to dark corners of this language that are going to be quite opaque if you're also learning that language just then, and also won't look like the "clean" example code you'll find in "normal" books and discussions in that language. If your game does not push the performance envelope, then you can just use "normal" coding idioms, but at that point its also probably true that any language you could reasonably choose is more than capable.

The pertinent part of your question is really about libraries and learning resources. C++, C#, Python, and Java all have plenty of libraries to give you what you need, and mostly (from the outside) those libraries will reflect the average complexity one would expect from the host language (they may be more complex than average libraries in their language, but relative to one another they are the same), and as well for performance. Just the usual considerations.

All things considered, my own choice would be C#, especially if I didn't already know C++ and especially if I *did* already know C#. I don't like Java as a language, period, but if it doesn't offend you as it does me, its libraries make it similarly suited for games as C#. For gaming libraries in C#, you have MonoGame (A well-maintained and expanded version of XNA 4, and is far from unimpressive if that's what you were talking about), and there are thin wrappers for Windows' gaming APIs through SharpDX, as well as other API interfaces for established game engines -- Plus, if you ever do pick up Unity3D, your enhanced C# skills are transferable.

throw table_exception("(? ???)? ? ???");

TL;DR

I'll say it even 100 times (I've been stating this my whole life).

Pick the best tool for the job, There is no such thing as "Best library". Each tool has its advantages and disadvantages over over tools.

Examine what you need and pick it up. (You won't use a hammer to saw wood just because they told you it's a good hammer).

--------------------

It's not about languages anymore but the tools each language provides. (Affected by the indurstry and communities, I'm speaking of my own experience with different tools).

Usually C++ is good for 3D games, using a high level library/game engine or plain openGL/DirectX. (Good for 2D also, but there are simpler tools).

The usage of C++ is mainly for real time performance, meaning, Performance is crucial (such as in high quality 3d games).

C#/Java is also good for 3D games, and sometimes simpler than C++. Most of the times the game is slower than it could be on C++. However with recent hardware it doesn't even matter.

For 2D I'd pick java or C# for their simplicity to code, maybe even a simple engine like Game maker.

Personally I'm not fond of scripting languages for games, I've always favorited low level tools therefore I won't be objective about it.

Python is great for scripting, the simplicity works well here, I'd keep it for small games or even just POCs.

+ I was not involved with python for much, Seek someone who actually wrote a full working game to get a good point of view on that one.

There's is no "Best library" for games, if the industry had one, You would not see so many engines and libraries around.

If your goal is to learn, go ahead and seek platforms and libraries with ALL languages.

The best learning is by self examining libraries and tools.

If your goal is to develop a commercial game, than you have a lot of planning to do.

First design your game, see what kind of elements do you need, what kind of graphical/processing capabilities you need to accomplish your goal,

then choose the right tool for it.


C# had XNA but it's discontinued and I can't find any tutorials or anything online.

Here's a XNA tutorial: http://xbox.create.msdn.com/en-US/education/tutorial/2dgame/getting_started

And all I did was google 'XNA tutorials'. Was there something specific you were looking for but didn't find?

Beginner in Game Development?  Read here. And read here.

 


C# had XNA but it's discontinued and I can't find any tutorials or anything online.

Here's a XNA tutorial: http://xbox.create.msdn.com/en-US/education/tutorial/2dgame/getting_started

And all I did was google 'XNA tutorials'. Was there something specific you were looking for but didn't find?

Microsoft doesn't support XNA anymore. Monogame is the way to go.

What will you make?
Advertisement


I'd like to stay away from engines like Unity3d or Flash, and hope to be able to code a platformer with some 3d movements to run on a PC system (not interested in mobile).

Why? (not a trick question)

Engines exist to make your life easier, and avoid writing the 5,000 lines of code needed to get a basic game up and running without an engine.

If your goal is to teach yourself low-level graphics programming, then by all means start from scratch. But if your goal is to build a game, then you are far better off using an engine from the outset.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

C++ is another one I'd consider but as a first time game project, maybe avoiding C++ would be better?

Why? Isn’t, “Doing a motivating new project in a new language,” the best way to learn a language?
Sure you have to spend 5 minutes making a Hello World first. And then off to games.

C++ is the industry standard. Take that for what you will based on what you plan to do industry-wise.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

C++ is another one I'd consider but as a first time game project, maybe avoiding C++ would be better?

Why? Isn’t, “Doing a motivating new project in a new language,” the best way to learn a language?
Sure you have to spend 5 minutes making a Hello World first. And then off to games.

C++ is the industry standard. Take that for what you will based on what you plan to do industry-wise.


L. Spiro

Lol are you serious?

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

Lol are you serious?

Did he not clearly say he has programming experience?

I was literally describing my personal experience, based off the fact that I also had prior experience programming, so yes, I am serious, and since I literally did it it is clearly quite possible (read: normal).


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement