Hello, and OpenGL?

Hello! I’m a newbie as far as video game development goes, and I suppose to Java as well. Maybe intermediate. I’ve been programming in a couple of classes and in spare time since 200…5? -ish? So, I understand a lot of basic programming concepts and thought processes, but not a lot of the lower-level science and engineering, and most of my experience is in Java. I leave it to you to label my skill level.

I wanted to join this forum because it’s one of the two places I’ve frequently found answers while Googling for my own questions, because it only seemed right that as a person trying to make a game in Java I should join a Java game dev forum, and because I have questions. So, thanks for having me (so far!).

My question right now is, what risks (in terms of licensing, cross-platform compatibility, and system requirements) and learning curves am I in for if I switch to OpenGL rather than throwing BufferedImages onto an AWT Canvas and a BufferStrategy with Graphics2D?

Background: I’m trying to make a pseudo-isometric, 2d, tactical RPG. It is intended to be a commercial release, however long it takes us to get there. I’m developing in Java 6 SE, with nothing extra at the moment because licenses scare me, and I honestly don’t know how distributing it would work once I go beyond the built-in stuff. I’d really love it to run at no work for the user on Windows XP and onward, recent versions of Mac OS X, and the more popular Linux distributions. I’d love for it to run at at least 30fps on my 1.6GHz netbook. So, I’m casting a pretty broad net. The OpenGL question is being pressed because our Illustrious Art Director is very interested in using Sprite Lamp for dynamic lighting. I got the game to process a normal map (this one) to light a blank, grey square that covers maybe 2/3 of the game window, but this dropped the fps from 174 to 7 on my mid-range machine.

If anyone is interested in giving advice or suggestions on OpenGL or alternate routes (I could post my normal mapping code), or just a link to a topic I’ve missed where this has been covered before, I’d appreciate the help.

Thanks, and hope that question wasn’t too demanding for a newcomer!

Welcome!

The most recent thread on distribution rights that I’ve seen here at JGO is the following:

It is mostly about content, not the code libraries, though code libraries get discussed too.

I think for the most part, code licenses are set up to allow you to use them as long as you make the source code (of that library) available. In some cases all you have to do is provide a link to the source in a “Help” or “About” tab.

But the thing to do is to consult the library itself and see what license they use. Usually the code has headers that discuss the terms. And the licenses will usually have wikipedia entries as well as their own url’s which include FAQ’s and forums.

The core OpenGL libraries are pretty open unless you are a hardware vendor. Libraries which utilize OpenGL can carry their own sets of restrictions. LWJGL for instance has very few requirements that must be followed when developing with it. Others such as JOGL have multiple licences attached which can make compliance a bit trickier depending on what you’re doing, but none seem to be overly draconian in nature.

Most organizations/authors are more than happy to answer questions you may have about compliance.

Oh, wow. I forgot LWJGL’s license was so short. Thanks for the link, and for both of you responding. I’ve looked at it before, and I guess I really was just being paranoid. I think I remember some games (Revenge of the Titans, maybe?) just having the LWJGL notice as a screen in their installer. If that’s all I have to worry about, maybe I should stop doing things the hard way. :stuck_out_tongue:

philfrei, I did see that audio thread the other day. Confusions like the one in that thread over whether the game aside from the assets themselves would have to be freed to use CC audio are a big reason I’ve been hesitant to stray outside the bounds of Java SE, but I suppose I really have nothing much to lose with some of the more permissive licenses.

OpenGL is pretty universal, right? If I moved my rendering over to LWJGL, would I be shutting out older computers, people with integrated graphics cards, etc? Would I be opening myself up to a whole new world of support nightmares with graphics driver bugs and finnickiness?

I’ve seen a thread or two about different ways of doing per-pixel manipulation of images without OpenGL, and it sounds like the fast ways are kind of hacky. So, for something like dynamic lighting with Sprite Lamp normal maps, where I have to change the color of each pixel in an image, is there a thread that discusses the best ways to do this? I’ve got the code to do it right now, but like I said in my OP my framerate dropped from 174 to 7.

Should I be posting these questions in their own threads? Or somewhere else? Sorry, got this gush of text and questions spewing forth…

OpenGL will fall back to software rendering if needed and it’s universal in the sense that it’s supported on most major platforms. The trick is choosing which OpenGL version to target. The newer the version, the less cards currently out there will support it. Integrated graphics are usually pretty crappy, but games like Torchlight show that you can do a lot more with those chipsets than people think. You just have to figure out the minimum amount of hardware needed to run your application, and call that the minimum required specs. There are always going to be certain users who will have inadequate hardware to run any given application.

You’ll find a lot of applications, especially games, contain certain amounts of hackery. It’s not necessarily a bad thing so long as you understand the ramifications of your hacks. Sometimes you have to think a little bit out of the box to accomplish a goal with given constraints. That being said, Java2D is touch and go performance wise. It technically uses OpenGL or DirectX depending on the platform it’s running on to do certain operations. My personal experience is that the DirectX pipeline is superb and delivers enough performance to make using Java2D viable for a lot of applications. The OpenGL pipeline tends to be less reliable in my experience. I’ve seen performance tank pretty badly on some machines (my current one included) when the JVM is told to use OpenGL. As for threads, give this one a try, and browse through the Java2D section. These types of questions tend to come up from time to time there.

No harm asking questions in the “Newbie & Debugging Questions” section. :wink: If you want detailed answers to a specific question it’s probably worth posting it in it’s own thread. If you just want a general “lay of the land”, then grouping related questions seems sensible to me.

[quote]You’ll find a lot of applications, especially games, contain certain amounts of hackery. It’s not necessarily a bad thing so long as you understand the ramifications of your hacks. … As for threads, give this one a try, and browse through the Java2D section.
[/quote]
Ah, yes, that was the thread I was referring to, since people argued vigorously over whether it was a dangerous hack. I think I’ll take a look at the Java2D section.

By the way, how do forum avatars work here? Every time I tried to add one, it didn’t work. Would that be because I tried using Google Drive, Picasa, Dropbox, and Facebook to upload it, and it can’t handle those links? Or are there specific requirements for the images I’m missing?

I think it’s probably the places you’re hosting it from. I have mine hosted from my own domain, so there aren’t any concerns of “hot link protection” or the like blocking it. You could always try one of the free image hosting services out there. If worse comes to worst, poke around and see where other avatars are hosted from. You should stumble across a usable host sooner than later.

There we go. Looks like imageshack worked (and apparently I had an account there?). Odd that it stretches the image unless it is exactly 80x80 though. And that there are no instructions I can see. :stuck_out_tongue: But it works! Thanks.

Always happy to help. You can always try padding your image to 80x80 before uploading if the distortion is bothering you.