• Advertisement

Simple advice for a beginner game-developer

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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++.

Edited by Alberth

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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.  

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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++. 

Share this post


Link to post
Share on other sites

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

Edited by Mandelbrot
spell

Share this post


Link to post
Share on other sites

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?".

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

C++ vs C# depends mostly on what your current short term plans are. Technologies change all the time.

If you don't like C++ that much coming from Java, then it's understandable that you feel its usability limitations. Keep in mind that Java was developed much later than C++ to address some of its complexities. But on that note, C# was also built to be a better Java after Microsoft lost the rights to bundle Java with Visual Studio! So you will probably find C# much more appealing compared to C++ if you're coming from a Java background. As others said, Unity is one of the two main engines most devs use, so you'll have a lot of opportunities to employ that knowledge quickly.

Share this post


Link to post
Share on other sites

If you're interested in making games, use a game engine. If you're interested in making a game engine, start lower level. 

I think most AAA studios use their own engines probably written in C++. But C# is a perfectly fine choice. Download Unity and Visual Studio and mess around with it for a weekend. I'm an Engineer at Harebrained Schemes and we're a C#/Unity shop. 

- Eck

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Alexander Nazarov
      Hello. I'm newby in Unity and just start learning basics of this engine. I want to create a game like StackJump (links are below). And now I wondering what features do I have to use to create such my game. Should I use Physics engine or I can move objects changing transform manually in Update().
      If I should use Physics can you in several words direct me how can I implement and what I have to use. Just general info, no need for detailed description of developing process.
       
      Game in PlayMarket
      Video of the game
    • By Dave Haylett
      Hi all. My project is coming along wonderfully, and am starting to consider alpha deployment, and would like your advice.
      My project need access to 10,000 small PNG image files at runtime, each is only a few kilobytes each, which during development I used to load in directly from a fixed path on my HDD whenever one was needed (obviously not a solution for go-live), using something like this:
      img = new WriteableBitmap(new BitmapImage(new Uri(@screenshotsPath + filename)));
      The image would then be blitted onto a buffer screen, etc. etc. At a time, a few dozen would be being used.
      Now I'm thinking about deployment, and also when I produce an update to my app, there could be more images to add to the folders. So I'm considering the best way of a) deploying the images to the user as part of the project, and b) how to most easily handle updates to the app, whereby more images will be added.
      I have just experimented with adding them all as a Resource (!). This inflated the exe from 10mb to 100mb (not a major problem), increased the compile time from 3 secs to 30 secs (annoying), increased RAM usage from 500mb to 1.5gb (not a major problem either), but means that it solves my fixed directory issue, distribution issue, and update issue, simply by having the files all stuck into the executable. Here's the new code I'm using:
      img = BitmapFactory.FromResource("Shots/" + filename);
      The next thing I was going to try was to mark them as Content > Copy if Newer. This would resolve the executable size and RAM usage (and also the directory issue as well), however it seems that I'd need to highlight them all, and move them from Resource to Content. As an up-front job this isn't too bad, but as I add new images to the project, I'll need to go in and do this every time, which gets annoying, as the VS2015 default is Resource. Also, I'm not sure how this would work in terms of updates. Would something like ClickOnce deployment recognise new PNGs and install them to the users?
       
      I also have 3,000 ZIP files (~500kb each) which also need deploying and updating in the same way. These are currently read directly from my HDD until I can find a permanent solution for adding these to the project as well.
      Can anyone thing of a better way of doing what I'm trying to achieve?
      Thanks for any help folks.
       
    • By LifeArtist
      Good Evening,
      I want to make a 2D game which involves displaying some debug information. Especially for collision, enemy sights and so on ...
      First of I was thinking about all those shapes which I need will need for debugging purposes: circles, rectangles, lines, polygons.
      I am really stucked right now because of the fundamental question:
      Where do I store my vertices positions for each line (object)? Currently I am not using a model matrix because I am using orthographic projection and set the final position within the VBO. That means that if I add a new line I would have to expand the "points" array and re-upload (recall glBufferData) it every time. The other method would be to use a model matrix and a fixed vbo for a line but it would be also messy to exactly create a line from (0,0) to (100,20) calculating the rotation and scale to make it fit.
      If I proceed with option 1 "updating the array each frame" I was thinking of having 4 draw calls every frame for the lines vao, polygons vao and so on. 
      In addition to that I am planning to use some sort of ECS based architecture. So the other question would be:
      Should I treat those debug objects as entities/components?
      For me it would make sense to treat them as entities but that's creates a new issue with the previous array approach because it would have for example a transform and render component. A special render component for debug objects (no texture etc) ... For me the transform component is also just a matrix but how would I then define a line?
      Treating them as components would'nt be a good idea in my eyes because then I would always need an entity. Well entity is just an id !? So maybe its a component?
      Regards,
      LifeArtist
    • By nickyc95
      Hi.
      I'm kind of late to this party but I thought I would ask anyway as I haven't found a concrete answer.
       
      When creating a game engine, when should you choose one methodology over another (more specifically OOP and DOD)? Which areas benefit from DOD? Which areas benefit from OOP? Do people typically mix multiple methodologies throughout a project? I.e. certain sub-systems created in one, and others in the another?  
      DOD - Data Oriented Design
      OOP - Object Oriented Design
       
      Pretty simple
      Thanks
    • By Estra
      Memory Trees is a PC game and Life+Farming simulation game. Harvest Moon and Rune Factory , the game will be quite big. I believe that this will take a long time to finish
      Looking for
      Programmer
      1 experience using Unity/C++
      2 have a portfolio of Programmer
      3 like RPG game ( Rune rune factory / zelda series / FF series )
      4 Have responsibility + Time Management
      and friendly easy working with others Programmer willing to use Skype for communication with team please E-mail me if you're interested
      Split %: Revenue share. We can discuss. Fully Funded servers and contents
      and friendly easy working with others willing to use Skype for communication with team please E-mail me if you're interested
      we can talk more detail in Estherfanworld@gmail.com Don't comment here
      Thank you so much for reading
      More about our game
      Memory Trees : forget me not

      Thank you so much for reading
      Ps.Please make sure that you have unity skill and Have responsibility + Time Management,
      because If not it will waste time not one but both of us
       

  • Advertisement