GameDevelopment: (Java and OpenGL) or (C ++ and OpenGL and SDL)?

Since Java supports OpenGL, what is the best option for developing a game?

  • Java + OpenGL
  • C++ + SDL + OpenGL

I always avoided Java (in game development, of course) because of its speed. But I found that Java supports OpenGL. So, I think that speed can no longer be a problem ... What should you choose? Are there any comments?

Java will be much easier for me, due to my experience in Java and the garbage collector.

thanks

+7
source share
9 answers

I would vote for C ++ for the fact that you have a reliable destructor in your objects. This allows you to wrap many OpenGL components (buffers, textures, etc.). You can know that when an object is created, the object is highlighted, and when the object is destroyed (or goes beyond), the object is cleared.

Of course, this can be done in Java. Minecraft was made in Java, and it raised over $ 25 million.

+12
source

In my opinion, if you have an idea for a game in your head, no matter what you write it on (first), C / C ++, Java, pen and paper ... Choose a language, more experienced and experienced games, as soon as you have an approximate sketch and you know what you need to do, release a prototype, create a gameplay and architecture, and then start coding the real thing. Do not optimize until you have most or all of the functionality (in general, there are always small bugs for searching), and you really see where the bottlenecks are.

I saw this happen again and again, programmers are some of the worst premature optimizers, trying to squeeze a few cycles out of something trivial, bypassing the biggest bottlenecks, and then optimizing a bit more (in the wrong place). I am also to blame for this many times. I would say that do not choose C ++ (or Java, for that matter) because of speed, you can get very good performance from both if done "right." If necessary, you can always switch to another language if the language itself is really a bottleneck or really prevents you from doing something. Java does not automatically slow down, and C ++ does not work fast, you can go (very) wrong with both. I used to root for C and C ++ in everything, but after a long collaboration with Java, I really did not miss all these problems.

There are many (already optimized and fairly easy to use) game engines available for both languages, so there is no need to download your own ... if you don't want to. In my experience, most hobbyists of β€œprogrammers” are usually more interested in the technical side of things than in a real game (including me);) After all the technical obstacles are completed and you get this nice model / bunch of sprites / particle effects that work with some shader effects, enthusiasm seems to fade ... But don't let me dissuade you, game programming is very funny even if you never finish anything (I would not name any of my own projects shen).

I have not encoded any games for a while, but for C ++ 2D SDL is a good candidate, another option might be SFML , or if you want a lower level of touch with OpenGL, you can try switching from GLFW + SOIL + some audio library. For full-blown 3D, I would say try either OGRE or Irrlicht + Irrklang (there are probably many more).

Java has at least Slick2D , the Golden T Game Engine and for lower level access, LWJGL (although I think you can also access LWJGL through Slick2D). For 3D, someone recommended me jMonkeyEngine , but I never tried.

+18
source

I would go with C ++, SDL and OpenGL .. SDL is now upgrading from 1.3, and that will be really good. In my opinion, you should do it in C ++, since you stated that you would feel more comfortable with Java, being comfortable after creating a game in C ++ would be very useful. You would not only play, but also study at the same time.

+8
source

It has been proven that Java is just as fast, if not faster, than C ++, although it is provided, you cannot achieve such results without a little tweaking and careful monitoring of the garbage collector. If you want to continue developing games using Java, I would say that this is a good choice if you learn how to approach it in the first place.

+6
source

If you go down the Java route, you may need to send the JVM along with your game. Not to say, do not do this, but many people may not have Java installed or the latest version for the features and performance that you want. I have not studied the licensing requirements for JVM delivery, but you probably would like to investigate before making a decision.

You should also be aware that with a highly customized application, although the Java API is the same on all platforms, there are differences because the implementations of these programs often use the underlying OS. Therefore, I doubt that using Java would reduce the test burden for the game.

+2
source

It depends on what language you are most used to. There is a steeper learning curve with C ++ than with java. If you do not use any of the languages ​​and want to get some kind of development, I would recommend java.

And a little note. If you're brand new, I would also recommend looking at XNA, but it is based on DirectX. And you should know some C #.

+2
source

It really depends on what kind of games you want to build, and with what programming language you feel more comfortable.

If you plan on making big games in the future, C ++ is best for a general experience. Most commercial games are written in C / C ++. Microsoft also has an XNA infrastructure that uses C #

Id still comes with a programming language that is more convenient for you, they are both great

However, if you do not miss a little training, go to C ++

+2
source

Well, I programmed all my games in SDL, and I definitely recommend using C ++. Although you can look at SFML!

http://www.sfml-dev.org/

SFML is already integrated with OpenGL, and it gets up pretty easily and works with game programming.

+2
source

C ++ has always been a better option. It is faster and a little easier to understand than java. I use OPENGL C ++ SDL for myself.

+1
source

All Articles