Game programming with Java in Linux - java

Recently I've been craving some game programming. I primarily use Linux, and was wondering if there are any good graphics libraries for Java development on Linux? Google didn't turn up very much useful information on the subject.
Also, would another language be better? I would like to avoid using python -- Ruby and Java are my two favorite languages. There doesn't seem to be much talk about game programming on Linux in general, unfortunately.
Any suggestions/resources? Easy portability or cross-platform functionality would be awesome too.
Oh, and I prefer 2D graphics.

What about the APIs mentioned in Pro Java 6 3D Game Development: Java3D, JOGL, JInput and JOAL APIs.
Topics are split into three sections: Java 3D API, non-standard input devices for game playing, and JOGL. Java 3D is a high-level 3D graphics API, and JOGL is a lower-level Java wrapper around the popular OpenGL graphics API.
You'll look at three non-standard input devices: the webcam, the game pad, and the P5 data glove.
Along the way, you'll utilize several other games-related libraries including: JInput, JOAL, JMF, and Odejava.
Learn all the latest Java SE 6 features relevant to gaming, including: splash screens, JavaScript scripting as well as the desktop and system tray interfaces.
Or have a look at Java 2D Game Frameworks here on SO.

For game programming there's a nice little framework available, jMonkeyEngine, it support both LWJGL and JOGL.

JOGL is supposed to be cross-platform. There's a wrapper which includes additional functionality called Lightweight Java Game Library.

How about Flash? The PushButton Engine looks fun.

Golden T Game Engine
I think the Golden T Game Engine is the sort of thing that you are looking for. It makes it very easy to get into actually making a game without having to worry about a lot of boilerplate code.
Golden T Game Engine (GTGE) is an advanced cross-platform game programming library written in Java language.
GTGE library provides a complete routines for making 2D game from low level routines such as hardware accelerated 2D graphics, mouse and keyboard input, audio support, game timing, to game specific routines such as sprite, background, collision detection.
...
GTGE is a high level interface library, it means programmer never has to worry about any low level commands anymore. The only thing left for the programmer is use their imagination and start programming their game.
You don't have to know anything about managing graphics, input, and other low level stuff in Java. Instead you can start immediately develop your own game using the latest Java technology, such as bufferstrategy, volatile image, and even OpenGL easily. You can check out GTGE design standard simplicity, generic, and replacable.

Related

Is OpenGL Neccessary for a 2D Android Game?

I'm planning on making a 2D game for Android. For drawing custom graphics, Android Training only goes over how to do so with OpenGL. For my first Android game, I don't want to have to learn OpenGL if I don't need to.
While programming games for Desktop with Java it's simple to paint images and draw. But OpenGL seems to be the standard for Android.
So my questions are, is OpenGL necessary or are there other options? Do I need to use an API or can I just use Android's basic toolkit? It's not possible to use Java's swing with Android, right?
Android GUI is like Swing, it’s on a single thread, if you do some heavy lifting on that thread it will cause some issue’s just like with Swing. There are mechanisms and classes available that like SwingWorker help you out. But If you wanna work in C++ it would be best to use OpenGL library for it.
Determining which engine is most suitable for your game project is a significant design choice, so you'll want to do your homework. Engines with more features are generally bigger and more complex to use than smaller, lightweight engines. Some game engines focus on cross platform support with a single code base. In this case, the developer usually writes their games in some sort of scripting language. Other game engines will require native coding on each platform.
There are alot of new technologies present now on Game Development for Android even you can use Third Party Game Engines.
For e.g,
Android Box2D - This is 2D physics engine written in C++ for Android developers which has even won some awards. Used to create the Crayon Physics Deluxe game, and ports for other platforms are available.
Cocos2D-x is One of the strongest and most famous free-to-use frameworks for building 2D games on both platforms (for Android & IOS).
I hope =my answer would help you.

Java 3D Graphics using Applet and in built libraries only

I want to do Java 3D Graphics without using external libraries to develop a game applet. Sorry I am not that experienced with Graphics and so I am not sure how hard it would be to do it by myself
The real answer to your question is that you're thinking about it a bit sideways: you shouldn't be using an applet (they're dead), and you shouldn't try to do it all by yourself without any libraries.
I'd personally recommend Processing for beginners or libGDX for more experienced users. They both allow you to do 3D, and they both allow you to deploy as JavaScript- which is better than applets.
If you really, really, really want to try to do this without any libraries, then you'll have to do all the 3D math and whatnot yourself, then do the drawing in Java2D. A very basic example of getting started is here, but like I said, you're on your own to do all the conversions from 3D world space to 2D drawing space.
Any sane person would use something like OpenGL instead, which you can find Java wrappers for- JOGL is a pretty basic wrapper (so if your goal is to get "close to the metal" then this might be your best bet), LWJGL provides a few extra features for game development, and the already-mentioned libGDX is built on top of LWJGL.
If you're afraid of using libraries because you think they're too complicated, let me tell you that doing 3D stuff without a library is even more complicated.

Java 3D game programming

Hi! For the last 3 months I managed to get a grasp of JSE (I have never done programming before, I only have a background of HTML/CSS and some jQuery but very little).
For my final exam this year I am going to have to create a project and I've decided on a strategy game. My professor recommended me to make it 3D on the OpenGL platform (the game is going to be based on RISK - most of you may have heard of this type of game as it used to be very popular). I have no idea where to start or what resources should I read not even for an 2D game not to mention a 3D one.
Can you guys post some resources with what steps I should I follow for creating a game in Java, books or any other advice that could help? Thank you.
The main OpenGL library for Java is:
JOGL
If you go in at the OpenGL level, as suggested by others, you will have to learn a lot about low level 3D concepts. Whilst this may not be a bad thing (a deep understanding of a topic is always beneficial) it may hinder progress and you have limited time.
The one advantage to OpenGL is that there is a lot more general information, especially tutorials (Google It!), available online.
For general OpenGL tutorials, the Nehe tutorials are a classic resource and contain source code in Java as well as a plethora of other languages.
Tutorials 1-5
Nehe tutorials index (linked on the right)
Alternatives to JOGL
I would recommend using one of the more prominent Java 3D engines that do a lot of the graphical leg work for you and will allow you to focus more on the game construction and less on overcoming basic obstacles like loading model formats, writing your own scene management code etc.
These are the good 3D engines that I know of:
LWJGL - Lightweight Java Game Library (documentation)
JMonkeyEngine (documentation, tutorials for beginners)
Ardor3D (documentation)
The documentation for JMonkeyEngine is much more suitable and contains many more tutorials, so I would start there. LWJGL is similarly well documented, but is also fairly low level and, in this way, similar to JOGL. Ardor3D could be a better alternative for those more comfortable with 3D programming in general.
Java Game Development Community
Whichever technology you chose, I suggest getting involved with the Java game development community as there's lots of example projects and people experienced with programming 3D games. The best place I know of is:
Java-Gaming.org

Graphical operations in C++ through the JNI

I'm writing an online multiplayer game, and I'm thinking about implementing the network code in Java, using JBoss Netty. But I'm considering C++ for the 3D rendering (they're simple graphics, nothing extensive). Would it be worth implementing such behavior in C++?
Would it be worth implementing such behavior in C++?
No, I would recommend doing everything in java or in c++. That way you won't have any problems with c++ to java interoperability. In case you already have the network code in java I would go for that.
If you choose java you can use a 3D rendering library like for example jogl or lwjgl. These libraries are really light weight and you will probably not have any problems with the actual rendering performance since it is done by the graphics chip.

Best Java 'framework' for LOW-END 3D Graphics?

I've made my share of 2D games on various platforms but I have never developed a 3D game.
I want to make a small "mmorpg". I already made my server in python and it works just fine with my flash 2D game but I decided I want to step it up and try out 3D. I want to make a 3D game for the web browser and I think Java might be a good choice for this.
So basically I'm just looking for a straight forward and well documents 'framework' to make LOW-END 3D games. Keep in mind that I will be targeting peoples with very low-end PC's (plus my 3d modeling skills aren't great so I wouldn't mind hiding it somewhat, haha)
If you care to develop your own software 3D engine, which is pretty cool, Developing Games in Java is a complete walkthrough, step-by-step, of developing a 3D engine in pure Java, capable of rendering textured and lit polygons. You learn a lot about the math involved and you realize that it's really not a terribly hard thing to do; in addition, the engine is all yours, so you know it inside and out and you don't have to learn an API. On the flipside, it might be outdated. It's been sitting on my shelf for a number of years now, but it is made with Java 1.4 so it's not all too old.
Otherwise, I would definitely recommend JOGL or its competitor LWJGL; however, both require OpenGL knowledge, so if you want to just deal with loading 3D models and moving them around, jMonkeyEngine could be a better option for you. There is also the lesser-known Xith3D engine, somewhat a competitor to jME, though it hasn't been updated in over a year.
P.S. Ever seen RuneScape? It used JOGL, though now I think they switched to their own port of only the OpenGL functions that their code uses, kind of like a stripped-down version of JOGL.
JOGL would be a good possibility. You could look at the older "Java3D" framework as well.
You might want to check out the jMonkeyEngine.
I would advise against Java3D. We're using it for a project and frequently run into gotchas. If we had the resources, I'd migrate to something else in a second.

Categories