• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
MzDay

What programming language should i go with? (C++,C# or java?)

12 posts in this topic

Title^.

 

I basically have the same knowledge on all of the above and i wanted to know what should i learn and keep going with?

 

my goal is to create games and someday build (maybe) an engine for myself.

 

i think i want to use OpenGL for that and i figured that if all of these languages have opengl library (now all of them the same i know)

i should go with one of them.

 

what is the best choice to go with?

C++ is pretty hard to learn but i can handle it. (pretty fast too from what i understand)

C# is really easy and i can easily learn that language but it's not as quick as C++ and i dont know if the openTK (or what's it called) is the same as opengl openal.. (same function's)

Java same as C# but i dont really like that language i dont know way lol

 

 

thanks! smile.png


EDIT: update on comment 10 :) thanks.

Edited by MzDay
0

Share this post


Link to post
Share on other sites

This would fit better in the For Beginners section. To answer your question, use whichever language you want. [url=http://www.gamefromscratch.com/post/2011/08/04/I-want-to-be-a-game-developer.aspx]This article[/url]  talks about C++, Java, C#, and Python. If you don't like using Java then you really won't want to learn game programming in Java because you'll get bored and discouraged. Pick whichever language you want and start game programming in it. As a beginner there is no "best choice" really.

1

Share this post


Link to post
Share on other sites

I had the same question a few years ago. I chose C#. 

 

C# has allowed me to leverage that knowledge to expand my portfolio into many areas of .NET development, and most recently cross platform mobile development with the Xamarin tools. Sometimes I wish I would have stuck with C++ because I see a lot of big things being done in C++, and most game related jobs I see are asking for C++ skills. On the flip side, Unity uses C#, which is great for me and its a viable option for game development so do I really need C++? 

 

If you want to roll your own engine, than you would probably want to learn C++. I don't think any decision will hurt you, but it may lead you somewhere else. 

 

To summarize, I chose C# because it has application in many areas that I was interested in: ASP.NET Web, .NET desktop applications (WPF, etc) and Unity3d. It also has let me be able to use the Xamarin tools for mobile development and not have to learn a whole new syntax of Objective-C or Java. Also, I found C# to be easier to pick up and get things done without having to worry too much about all sorts of nightmares that C++ can introduce that are challenging for a beginner in programming, heck they are challenging for veterans too! Good luck on your journey!

Edited by tharealjohn
2

Share this post


Link to post
Share on other sites
Most of game code should be writen with script language, like java, lua, python, c# for unity3d. It's no need to work with native code if you are using a good engine, like unity3d.

The only reasons to adopt c++, I think, are to replace some slow code, to call native api, and to reuse old but useful code base.
2

Share this post


Link to post
Share on other sites

The question of "what language" has no real best answer, and it's largely due to the number of parameters involved and what you most care about.  This is why wikipedia uses tables for all its comparison stuff.  Tom Sloper talks a bit about decision tables (or something like that) in his site to illustrate the same concept.  Some basic characteristics:

 

C++ has the best library support for gamedev tasks, bar none.  If there's something you need, there's probably at least 20 libraries for it in C++, and most of them are actually worth a damn.

 

C# and Java are both MUCH easier to use (not just learn) than C++, and you WILL be more productive on a language level.  You may take some level of productivity hit trying to work around the GC, but that depends a lot on use case.

 

Java is more mature and widely supported than C# over different platforms.  Mono is around most relevant platforms now anyway, but it's less ubiquitous than a JVM runtime.  C++ is technically more supported than both, but that runs aground with the whole productivity issue.

 

Then there's a giant infinite continuum of interop choices between two or more languages, and they carry their own benefits and drawbacks.

 

Ask yourself a few things:


1.  How (logically) complex is my game?  A game with a lot of complex logic (think RPGs and Simulations) at multiple layers of play often benefits from a higher level scripting language.  Whether that's interop with a lower-level engine (with the scripting being "game logic") or just straight making a game in python for example depends on other factors.  Unity uses C# for scripting along with other stuff precisely because it's more "scripty" than C++.

 

2.  How (computationally) complex is my game?  Python does not perform well.  Neither does any other scripting language.  When you put your languages choices into this question, the same thing applies:  Java and C# are generally slower than C++ when both are written properly (and more importantly, idiomatically).  I've seen benchmarks where Java is as fast or slightly faster than C/C++, but it is MUCH harder, and the productivity dimension totally flips on its head.  If you need fancy physics or otherwise complex algorithms (and an indie CAN make a game that is computationally demanding), you may want to squeeze every bit of performance you can get.  You probably won't, but it's worth thinking about.

 

3.  How long do I want to spend making it?  If you're making it for fun and have no problem working on it for a very long time, it matters far less what language you work with, since once you're decently skilled at a language it's just a matter of trudging through the details, which basically amounts to an investment->reward problem.  If you don't want to spend the next five years developing a small game or actually need to make money, productivity becomes very important.

 

4.  How much do I *really* know about my language of choice?  You may think you know C++ well, but I highly doubt you actually know it as well as Java/C#.  This isn't an attack or anything, that's just the way C++ is.  Evaluate what you actually know as well as you can, and decide if learning a language some more is something you want to or are willing to do.

 

5.  How much of my game do I actually want to make?  Everyone is encouraged to not "reinvent the wheel", and while I think that's a good thing for learning purposes, it's not so much for actual development.  C++ as stated above has the best library support around, but it's not as if there isn't *something* analogous in C#/Java.  Whenever I work on something, I always pick the libraries I want to use first, then the language that supports them most readily.  Language interop can be painful, and it's not something I like doing readily.

 

 

...And there's your wall of text response.  Word economy was never my strong suit.  In the end, it's really just a long-winded way of saying "it depends".

Edited by SeraphLance
2

Share this post


Link to post
Share on other sites

Title^.

 

I basically have the same knowledge on all of the above and i wanted to know what should i learn and keep going with?

 

my goal is to create games and someday build (maybe) an engine for myself.

 

i think i want to use OpenGL for that and i figured that if all of these languages have opengl library (now all of them the same i know)

i should go with one of them.

 

what is the best choice to go with?

C++ is pretty hard to learn but i can handle it. (pretty fast too from what i understand)

C# is really easy and i can easily learn that language but it's not as quick as C++ and i dont know if the openTK (or what's it called) is the same as opengl openal.. (same function's)

Java same as C# but i dont really like that language i dont know way lol

 

 

thanks! smile.png

First of I just want to say, C# is plenty fast.  If you're just beginning you won't notice the "speed differences."  Don't even think about it.

 

Honestly choose what ever language you want really.  There is no correct or wrong language choice.

 

I myself though would go ahead and choose C# right now.  You will be more productive.  The best language for a job is the language that makes you more productive.  Plus I feel by the time you you to where  you can make your own engine your knowledge of programming should be pretty good which by then you would be able to pick up C++ with ease.  Just beginning you won't be doing anything where you will notice speed differences between C++ and C#.  Just because you do choose C++ doesn't mean you'll immediately get code that runs faster.  Matter of fact it may be easier to write code that is slower in C++ than it's C# counterpart.  Just because C++ allows you to do it doesn't mean it is the best or fastest way to do it.

 

Also just want to say their have been some reports that some algorithm implemented in C# have ran just as fast as the same algorithm implemented in C++.

1

Share this post


Link to post
Share on other sites

I basically have the same knowledge on all of the above and i wanted to know what should i learn and keep going with?

 

my goal is to create games and someday build (maybe) an engine for myself.

 

i think i want to use OpenGL for that and i figured that if all of these languages have opengl library (now all of them the same i know)

i should go with one of them.

 

what is the best choice to go with?

C++ is pretty hard to learn but i can handle it. (pretty fast too from what i understand)

C# is really easy and i can easily learn that language but it's not as quick as C++ and i dont know if the openTK (or what's it called) is the same as opengl openal.. (same function's)

Java same as C# but i dont really like that language i dont know way lol

 

 

thanks! smile.png

I'll disagree that C++ is "pretty hard" to learn.  I started programming with C++ and didnt think it was especially hard.  Also, C++ forces you to deal with things that are essential to how a program (and hence an engine) works like memory management, and doesnt hide it away from you.  But, once you know what you're doing with memory management, using smart pointers is extremely easy and will eliminate the headaches that a lot of people complain about with C++.

 

So, your goal is to write your own engine, and possibly work in the broader game development industry?  If this is correct and you want to learn the ins and outs of a game engine and maybe work for a professional game studio, then my suggestion is C++.  Considering that you already have the same level of C++ as you do with the other options, I dont see much of a downside with this.  C++ has more code/libs/support out there for you to leverage.  C++ is used in most professional dev studios.  C++ is used to write most professional game engines, and to program most platforms and consoles.

1

Share this post


Link to post
Share on other sites

I'll quote myself from another post :D :

 

 


 

Java

Pros:

  • Easy to distribute
  • "Enterprise" language that could translate to career skills

Cons:

  • I've never programmed in java before
  • I'm not sure how the performance is for games (minecraft horror stories)
  • I would have to learn Eclipse, which from what I hear is almost mandatory for java

There are two main options for an IDE, Eclipse or Netbeans. I hear Netbeans is easier, but I like Eclipse so I haven't tried Netbeans.

 

Java has some important Pros you havent mentioned:

 

  • It's a generally easy language to pick up because its pretty simple. You don't have lots of syntax sugar, nor many crazy tricks with pointers/counters/etc that you might encounter inside code in the wild.

 

  • It has a massive standard library with all sort of things. For example, ImageIO.read() and you got your png/bmp/jpg loaded (no matter if its greyscale, rgb, alpha or no alpha, etc). IO is really easy, threading is really easy, etc.

 

  • On performance critical stuff (ie, parts of Math library), there is a native implementation instead of a Java one.

 

  • JDK sources available. Want to check out how something is implemented? Want to use a particular class of some library? Check the sources, import what you need.

 

  • It has a common naming scheme convention (classes start with uppercase, variables with lower case, and so on, that means mostly no "__varXYZ" stuff).

 

  • It's very well documented. Not only that but documentation seamlessly integrates with your IDE. Hover the mouse over something you don't understand and bam! Official documentation as fast as your internet connection can deliver. No checking forum posts that half know what stuff actually does. Once you get the hang of the syntax, you can explore, learn and use (most of) the libraries easily with the documentation at hand.

 

  • As long as you're not using native stuff, porting is really easy. As easy as launching the thing on a different OS. And you get the same result too. If you're using native libraries, then you're limited to what platforms those libraries support.

 

I think Minecraft's problems aren't an issue with Java but just poor design choices  Uses very old fixed function OpenGL, it looks horrible to extends since every mob has a dedicated class that knows how to render it specifically (so you have CreeperRender class, PigRender class and so on), it didn't cull cubes for a very long time (and "advanced OpenGL" option that did cull them was buggy as hell) and so on. Thats just my opinion though.

 

 

And a few Cons I would consider:

 

  • Its very easy to do "stupid" things. If you want your code to perform well, you can't ignore memory even if you're in a managed environment. "newing" stuff is a very easy thing to do and a very fast way to get you into making overweight applications.

 

  • Again, no syntax sugar. This might be a bad thing for you if you're used to operator overloading for example.

 

  • "protected" is... Not what you'd think it is. Useless if you're developing on a single package.

 

  • Some consider "static final void method()" madness biggrin.png

 

  • "Every file is a single class" (except for nested ones) is annoying sometimes.

 

  • Buffer madness. Using some native stuff (ie, OpenGL through LWJGL) requires passing things around in Buffer classes, which means duplicate data and additional operations (in some sense, you end up using arrays in a even lower level than arrays in compiled languages, by setting up position pointers by hand, endianess, etc).

 

And things I'm forgetting probably biggrin.png

 

1

Share this post


Link to post
Share on other sites
Thanks for the answers!
i think i'll stick to c# and in the future if needed move to c++.
i have a question,
is opentk for c# is the same as opengl? (and is it updated and keep updating)?)

thanks again!
0

Share this post


Link to post
Share on other sites

well you could have googled for your answers. I didn't know them but got the answer in a couple of minutes by googling.

 1. 

is opentk for c# is the same as opengl?

Yes

2.

(and is it updated and keep updating)?

I don't know but you can read this thread http://www.opentk.com/node/3217 .

Edited by frazchaudhry
0

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
Sign in to follow this  
Followers 0