Simple advice for a beginner game-developer

Started by
11 comments, last by Eck 6 years, 2 months ago

Hi!

As many beginners here, I want to ask a little bit subjective question. But first of all, I will share my story with you.

I used Java for something like 2 years now, I consider myself quite a proficient Java programmer. I've created a chess game using pure Java (probably the worst quality of code I've ever written tbh). Now, I'm looking to develop myself further. I've read a lot of articles about it, even asked a few questions by myself. But now, I'm even more confused than I was at the beginning. From many tips I got, I thought the best way for further development would be learning C++, then using SFML library (or something similar) for some time, and then at last learning C#/staying with C++ by using an engine like Unity or Unreal - I'm quite unsure with the choice in last step, but that's not the point now.

Currently, I'm learning C++. Honestly, I'm not feeling this language as much, as I feel Java (doing the same simple tasks in Java take me much less time than in C++). More honestly, I would abandon it and go straight to C#. Is it worth to lose my nerves for C++ these times? I'm aiming for professional career in future (so in about 5-6 years I guess). I know, that the best way of learning to make games is to make games etc, the language doesn't matter etc, you don't have to explain me this subject. Summarizing what I am actually up to, I want to know, if learning C++ is still a better idea than learning C# for game-dev nowadays?

I don't want to feel stupid in your eyes. I'm just feeling really confused and lost in tons of people own opinions and tips, that I had to ask more experienced developers.

Thanks for your answer and sorry for actually wasting your time reading all of this.

Advertisement

Knowing multiple languages isn't a bad thing and C++ is certainly used quite often in AAA development, among other things. Even for indie development Unreal and Unity tend to be the mainstay engines of the day and Unreal uses C++ for the code extendable portion of the engine while Unity offers C# for scripting.

Really I would base it on your goals. What are your goals? Do you plan to try and get into a job that will require C++? If so then you probably don't have much choice in the matter. If it doesn't matter and it is making you unhappy then you certainly don't HAVE to learn C++.

That said, reading over your response you make it sound like you are finding C++ either difficult to learn or that it just does everything in a more difficult way than Java did. But that's not really surprising, generally it -is- more work to do it in C++. C++ is arguably a lower level language than Java or C#, and misses a lot of abstractions and simplifications that those languages can offer because it is older, doesn't use a virtual machine and also was designed to map quite closely to assembly. It doesn't help that those other languages tend to have a much better standard library(though C++ is slowly improving on this with time.) You find yourself doing things manually quite often.

There's no magic trick, however, if you want to learn then language then you just have to dive in and use it even if it seems less than fun. Everyone else that has learned it basically had to deal with the same things you are.

C++ is fundamentally different from Java. Its aim is to enable you to get the best possible performance out of your system. It does that by giving you complete control of execution and memory. Java on the other hand aims to simplify programming as much as possible, it does that by taking away choices as much as possible. The result is that using C++ can give a much faster execution, since a JVM is never as smart as a smart developer.

From a Java perspective, your playing table has become much much larger, so indeed, it's hard if you find your world is a lot bigger than you ever imagined possible.

 

In my experience, when learning something new, don't try to relate it to something you already know. Try to forget everything you already know, and take the new thing starting from a blank sheet. In your situation, this holds even more, C++ is "bigger", it puts more cards onto the table. It's impossible to relate all those cards to the cards you have from Java knowledge, as there are C++ cards that are totally new, there is eg nothing in Java relates to "memory management" or "pointers" from C++.

If you take C++ from a blank sheet, you'll notice that the language is much more systematic, it just gives you all cards, and you can decide which cards you want to use (Java makes a lot of decisions for you there). For example, you have value variables for all types (Java only has the basic types as value type), you have reference variables for all types (Java only has objects as reference types), you have pointers for all types (don't exist at all in Java), templates work with all types (generics only work 1 level deep, and fail with arrays in Java). So there are more cards, but there are less exceptions.

Once you mostly understand how C++ work, you can faithfully try to relate Java and C++ to each other, and make up your mind how one relates to the other. To me, Java is the little nanny sister of C++, but ymmv.

What you get in any case, is a deeper understanding of how a computer actually works. (C++ is hiding very little there.) That understanding will be beneficial to anything that you might do in the future.

 

As for your other considerations, C# is much closer to Java, so likely you'll have an easier time learning that. On the other hand, it has evolved much more rapidly than Java in the past decades, and also has many new features, as well as concepts that are traditionally found in languages like C++.

 

Game engines are pretty much tied to a single programming language (as they are basically large frame works written in that language). Unity is tightly connected with C#, and Unreal with C++.

Thank you for your answer, I really appreciate that. You helped me a lot, I have thought it over and I gained more motivation. I have to work more, while I still have some time. Once again, thanks a lot. 

If you are going to learn C++ take the red pill and forget everything you learned in the matrix(kidding).  C++ was the first language I learned in college and I am actually now learning Java.  The thing with C++ is it really is kind of a ground up language.  C++'s intent in it's early days was to extend C to allow programmers to 'create' a greater level of abstraction.  Where as Java was meant to provide programmers with a greater degree of abstraction.   

I know C++ can be frustrating, but it is a worthwhile journey.  I would focus more on understanding the advantages of the language rather than practical applications at first.  To be honest there are a lot of how's and why's that were hidden behind a layer of abstraction provided by Java that can be frustrating when moving to a lower level language.  The biggest problem most students and independent learners have with C++ is you feel so incompetent for so long and when it finally starts to click it seems like you always run into some complexity that make things more difficult that they "should" be.    If you examine C++ without preconception about how much code a performing a task should take or how complex a task should be to code.  I think you will find a rich and rewarding experience that will leave you with a greater sense of how programs actually work.  In short it can help make  you a better programmer with a broader view.  

BTW I would give the same advice to C and C++ programmers.  Try the higher level languages it gives you different perspective.  My most recent project at work I wrote in Python rather than C as would be normal.  There were little heart emoji's that came off the keyboard as I typed.  Writing in Python I felt more like a wizard than a programmer.  

The Quarry Works Creed

We who shape mere stone must always envision cathedrals

I learned C++ first, I loved C++ for many years.  I still imagine someday I might use it again.  However, if you aren't falling in love with C++ and you do like Java .. then really you might not want to use C++.  The main reason I don't recommend C++ to anyone who isn't trying to land a job in the game industry right away is this - ALMOST NOBODY doing indie work or hobbie work uses C++, EXCEPT people who use C++ already (either at work, or when they learned it in school).  C++ is just too hard a language for random people with almost no programming experience to self-teach (not talking about you here, talking about the random other internet people you might want to work it).  Random internet projects use C# most often (unity), and then languages like python, Java, or even javascript.  The smaller, newer languages are also easier not just because they are actually easier, but because the people who use them follow more similar coding style and practices (C++ development has grown over roughly 30 years! during that time practices have changed many times ... so most shops don't code their setups like each other - unless using the same game engine) .. while in languages like Java, C# and python, there we are mostly coding in either the original language style still, or in some case the second style.  You probably didn't know this, but the company I worked at doing C++ in 2001, wouldn't even be able to make sense out of a c++ project written in C++11 idioms.

If you like python style and want to do 2d only .. give it a try.  If you prefer Java/C# style and want to do both 2D and 3D then give Unity/C# a try.

On 1/27/2018 at 4:27 PM, Monualen said:

I'm aiming for professional career in future (so in about 5-6 years I guess).

Of course it all depends on what your goals are, but given your stated goals and the time frame you have to work with, I'd say... stick with C++.  I understand that it can be frustrating coming from Java.  In order to fully get C++ you have a lot of stuff to unlearn and even more to learn new.  But, you're learning those things for a reason... because C++ is more closely linked to how the hardware actually works.  So to some extent there's a lot of complexity there because there has to be.    And of course there's also a lot of complexity because the language has been growing over the decades.  But, that's something you just have to adapt to over time as you learn and master the language.

 

I know, that the best way of learning to make games is to make games etc, the language doesn't matter etc, you don't have to explain me this subject. Summarizing what I am actually up to, I want to know, if learning C++ is still a better idea than learning C# for game-dev nowadays?

"The language doesn't matter" is a fallacy, as demonstrated by this very thread.  That's like saying that the building materials dont matter when you're building a house.  Of course it matters.  If you want to eventually work on professional games, then you'll almost certainly need C++, unless your goal is to just work on a small subset of those games like the tools or scripting or whatever.  And if you want to work on the engine tech, then you'll definitely need C++. 

I do not program, but will pursue this topic for some help as soon as I formulate the comment. But I have been around chess engines for a long time. I have heard and believe chess engines are at the forefront of AI. More than a few of these have included source code. The current strongest engine in the world, for some time, "Stockfish", has source in C++. Anything by H.G. Muller will be an education in minimalist and master programming in C (http://home.hccnet.nl/h.g.muller/max-src2.html). A chess engine needs speed and that means Assembly. I worked closely with him a while back developing the world's only advanced Chess program (or chess program of any kind) for the blind and those who can not use a mouse, "Winboard 4.5 Accessible Chess" (GNU3, w/src http://ftp.gnu.org/gnu/xboard/ https://sourceforge.net/projects/winboard45forja/?source=directory). Best Regards

stockfish-8-win.zip

stockfish-8-mac.zip

stockfish-8-linux.zip

C++ is not as important to games development as it once was, but its still a language you don't want to ignore.  Mobile programming has basically added Java to the languages you should know thanks to Android.

Consider sticking with Java or indeed switch to C#( they are very similar ), but do put aside some time to learn either C or C++ so you at least remain familiar with the "classically compiled" languages.  I find knowing C and Java to be a strong programming backbone as you have the structured-compiled style of C in contrast with the OOP concepts of Java.  C is ideal for practicing mastery of a computer( short of assembly ), whereas Java has its focus on building complex software projects with objects.  It is then, that one asks "is there a language that gives me the control of C but the power of Java?" and thats when C++ says to Python, "...hold my beer."  At first you are surprised hes a tough-customer, but your experience with C and Java allow you to not take the bait...

You could just learn C++ and forget C, but its that little harder to appreciate C++ without knowing why it came about, and C is a great language in its own right.  But if you have working experience of why C++ came to be, you wont fight it as much.  You'll even appreciate the role many other languages play in the grand scheme of things, rather than carry on wondering "which language should I use?".

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

I'm in the same boat. I learned about 2 years of Java and then stopped programming for a couple years. I was in car accidents and had to drop out. I realized my thinking skills decreased dramatically and I wanted to start programming again. I picked up Java, but wanted more of a challenge. I started c++, which now my school which starts this year will also go into C++. However, I transitioned to Unity because I wanted a wider range of topics to learn. I'm seeing a lot of jobs outside of gamedev that look for C#. The thing is, Java+ C++ + C# are all Object Oriented. I think that just having that 5-6 years of experience with a portfolio to show for it will be plenty for a recruiter to notice and accept you.

TLDR; Keep coding. They are all OOP and you'll get better + experience. Start building a portfolio anyway you can and you will improve overall.

Just a beginner programmer trying to make it through to game dev on Twitch.tv/Jacob_McG

This topic is closed to new replies.

Advertisement