Help me choose between these programming languages for game dev

Started by
30 comments, last by Brain 4 years, 10 months ago

I am planning on getting into programming as a hobby, mainly for programming and developing games. I do have some knowledge of programming already and have dabbled in LUA scripting language when I used to play World of Warcraft making my own addons. As of right now, I wouldn't even know where to start to create a game, other than learning a programming language like Python, Java, or C++.

If I were to use an engine to create games, it would probably be Unity, in which I know I would have to learn C#. I don't mind a challenge and I like to make things on my own so I can say "I made that myself". Right now I'm torn between C++, Java, and C# (for Unity). My first game will be something simple, but I plan to later create a game that can be at least 2-5 player co-operative online. 

Would C++ be a good choice in this case? I know I will probably have to learn more than 1 language to make a decent game, but right now I just want to decide on my first language. This will be self taught and I will be a solo developer. And just for clarification, I'm not going to try and make a AAA game by myself, let alone a game like Call of Duty or something. Simplistic 3D graphics with good game mechanics is what I have in mind.

I do plan to create programs/apps in the future but I want game programming to be the determining factor for my first language. And if I do pick C++, is it going to be much harder to make the game online as it would be in Java? From what I've read, Java is the goto for online/multiplatform everything.

Advertisement

If it is something simple, than why not a scripting language and a game engine in the beginning, just to get off the ground and see the concepts of game programming ? The concepts don't change that much if i am not mistaken, regardless of the language or API. If you're already glancing towards C++ maybe choose one of the open source engines to study what others do ? Of course, you're confined to what the engine offers in functionality, but i read the limit is pretty high, at least for the standard "templates" people use ...

But that's just a random thought of mine. Maybe there is no "do this, don't do that" advice, just start, fail, start again, party succeed .. and so on. It is a dynamic process ?

Hello,

Lua and Python are quite close to each other, with Lua being very minimalistic and a bit odd at some points. Python is much richer, and aimed at doing real work. It's a very well designed language, highly recommended to learn.

Java and C# are also quite close, with Java the much older language. C# was designed as "a better java", and that worked pretty well. C# borrows a lot of ideas and concepts from Java, so if you know one of the languages, the other one is not too difficult.

All 4 languages are quite close to each other in how they handle values and variables, in particular objects. So with your Lua experience, any of the above languages will be fine for you.

C++ is a different animal. It's designed to give you full control over everything. The language assumes you know what you're doing and allows anything you want. It won't stop you from making errors or shooting yourself in your foot. The idea is that a human can outsmart a compiler, so a human should decide how the program should work. It's a powerful but complex language, generally not recommended to learn as first language.

Looking at the landscape, I think C# will be the best option for you. It gives you access to Unity (although you can of course ignore that ? ), and a switch to Java or Python will be easy. Save C++ until you are comfortable writing somewhat larger programs.

 

As for multi-player, the deciding factor is the complexity that you get when not everybody is at the same place. You get time-delays between different players due to finite network speed that must be dealt with.

Java is likely popular as it has always been a network-oriented language, it has the largest number of programmers, and it's not a difficult language. Programming language is however not the decisive factor in being able to write a multi-player game.

4 minutes ago, Alberth said:

C++ is a different animal. It's designed to give you full control over everything. The language assumes you know what you're doing and allows anything you want. It won't stop you from making errors or shooting yourself in your foot. The idea is that a human can outsmart a compiler, so a human should decide how the program should work. It's a powerful but complex language, generally not recommended to learn as first language.

this->IsSoTrue() --- :p

With C++ you have full control over your whole computer. I find it extremely rewarding if you know what you are doing. But until you get to a point, where you can claim that you have a good understanding of the language, it will take you probably 2+ years of programming and learning. In the beginning, the level of pain is quite high. And it does not get better very fast. But as I said, once you get to the point, where you really know what you are doing, it is a great language.

So if you "just" want to make a game without spending a lot of time learning before you can even start making a game, Unity with C# is probably the better solution for you. But if you really want to know the low-level stuff and get control over everything ---> C++

Another thing that might help you is reading the Book "Game engine architecture" by Jason Gregory. He was part of the team that made "The last of us". He talks about everything you need to know to make a good game engine. It will certainly help you figure out, how much detail you want to program yourself. This will make the language decision easier for you.

 

Greetings

 

 

Thanks for all of the informative replies. As it stands right now, I have it narrowed to c# with unity or c++. I will look into that book, "Game engine architecture", and check back here to help make my final decision.

I know that C++ is very demanding and hard not to fool up. People say it's like juggling hand grenades, and I'm sure it's not much of an exaggeration. Call me crazy, but that makes me want to learn C++ even more. I've always been a bit of a perfectionist, and performance would be my main goal for any program/game I make. In saying that, if I choose C++ I'm aware that I could end up with a slower program due to memory leaks or bad memory management due to being a rookie, as opposed to a memory managed language. Maybe I really want to learn C++ but am afraid and want someone to talk me out of it and go with Unity/C# lol....

Should it tickle overly, a possible start, though not the latest version:, might be

https://www.learncpp.com/

?

 

27 minutes ago, michael1987 said:

Call me crazy, but that makes me want to learn C++ even more. I've always been a bit of a perfectionist, and performance would be my main goal for any program/game I make. In saying that, if I choose C++ I'm aware that I could end up with a slower program due to memory leaks or bad memory management due to being a rookie,

Then go for it. Nothing wrong with taking the long, but rewarding path. But make sure to get a good and up-to-date book.  It should cover C++14 or even better C++17. You can also try some internet tutorials, but there are so many and they are not really up to date.

Very important is, that you get yourself a good IDE (Visual Studio, QTCreator, Codeblocks). It will make your life much easier. Things I would also recommend (and what each good book should mention) is using git (GitHub) and CMake.

Ahh... and in advance: If you get to the chapters about pointers and dynamic memory: Keep in mind, that there are new and delete operators, but try to avoid them as hell and check the alternatives ;)

Greetings

I just want to say C++ isn't so bad.  I really don't understand the fear around it.  I think the main problem is it's taught wrong.  If you lean the basics first and then add in the more advanced stuff as you go, you'll be fine. I would learn C first.  Write some console programs to get used to it. Then add in classes and inheritance, then templates and finally the standard library.  Some people will tell you to jump right into "modern" C++ but I think that's where a lot of the problems come up. While that may be OK for some, many people will end up not understanding the basics of the langues and that gets you into trouble. 

When I learned C++ in the late 80s nobody was afraid of it. Most programmers I knew, already knew C and/or Fortran. C++ was just another language. Really, it still is. It's just a bit bigger now so you have to learn it in a few steps.

I'm not saying you  should lean it rather than C# or Java. If you decide to go that rout, that's fine. But don't let people scare you away from C++ if you want to learn it.  The stuff I'm working would be really hard if not impossible to do in other languages for various technical reasons.  While C++ may not be the most convenient language all the time, it doesn't put road blocks in your way.

12 hours ago, michael1987 said:

I've always been a bit of a perfectionist, and performance would be my main goal for any program/game I make.

You get by far most of the performance by writing a good structured program that effectively covers all the cases. You can do that in any language, where the languages "with roadblocks" help you steering in the right direction.

Then, you get the best performance by not optimizing about 97% of the code. That last 3% where you should optimize (locally) where you gain some performance. The biggest problem is finding/knowing where that 3% is in the code.

Note that it's not language A or language B. All languages are similar, just different in some aspects of it. Once you know one language, you can transfer most of that knowledge straight into the next language, you just have to compensate for the differences between both languages.

3 hours ago, Alberth said:

You get by far most of the performance by writing a good structured program that effectively covers all the cases. You can do that in any language, ...

1

Agreed. Most performance killers are language independent, and especially a beginner won't be able to utilize the possible speedups C++ offers. It is the same story for Vulkan and OpenGL. It is possible to write faster code in some situations with C++/Vulkan, but that does not mean that YOU CAN achieve that. You need to know a lot about the details.

However, the thing is, if you start with C++ (or any other language that gives you full control -> C , Fortran, and all the languages I don't know), you are more often confronted with issues that more or less force you to understand what you are doing and by understanding stuff, you are capable to optimize it to some degree. If you are forced to use a garbage collection memory system and there is no way around that, why bother with object lifetime issues? The only thing you might learn is how to utilize garbage collection for maximum efficiency, but not about more efficient memory systems. Doesn't mean that it is necessary. I just want to point out, that you probably MIGHT learn more, if you take the more challenging path. But as I said in my previous post, you should be certain about the things you want to achieve. If your goal is to "just" make a game, use as much language and tool support as you can get, which means, C++ won't be my first choice. ;) On the other hand, if you want the learn all the little details, C++ won't get in your way by forcing you to take a certain direction.

3 hours ago, Alberth said:

...where the languages "with roadblocks" help you steering in the right direction. 

I would rather say "steering into a possible direction". Personally, I don't like being forced to take a certain direction. I really HATE that Python forces me to format the code in a specific way. But I also know people who like that a programming language takes decisions from you since it often comes with the benefit that there are fewer things you need to code yourself (fewer things you can mess up). In the end, it is just a tradeoff of how much control you are willing to sacrifice to speed up program development. The extreme cases are coding everything yourself with C/C++ or using a toolbox like Unity. Your choice ;) --- But keep in mind: More control is not equal to better/faster code. That depends totally on your capabilities and willingness to dig deeper.

 

12 hours ago, Gnollrunner said:

I just want to say C++ isn't so bad.  I really don't understand the fear around it.

It's not about fear. It is more about that there might be easier ways to achieve your goals. Nothing wrong about choosing C++ as the first language.

 

12 hours ago, Gnollrunner said:

Some people will tell you to jump right into "modern" C++ but I think that's where a lot of the problems come up. While that may be OK for some, many people will end up not understanding the basics of the langues and that gets you into trouble. 

Well, it depends. In my point of using the latest standards will make a lot of stuff easier. I mean, that's the whole point of the latest standards. Make things better. Template metaprogramming got so much easier and understandable since you can mix it with constant expressions. The biggest problem is probably this:

 

13 hours ago, Gnollrunner said:

I think the main problem is it's taught wrong. 

 

Unfortunately, there is not the right way to teach stuff, since each person learns differently. Well, in the end, it is not impossible to learn C++ and everyone who goes that route has to find its own path. I mean, I was capable of learning it, so it can't be too hard:)

Greetings

This topic is closed to new replies.

Advertisement