I’ve been recently working on a 2D games library that supports all kinds of neat features such as triple-parallax scrolling, sprite animation, collision detection and other goodies. It currently uses the standard 1.4 full screen APIs (although it’s abstract enough to use LWJGL). In doing this, I’ve solved many of the issues that were previously a problem for me in the 2D API including the hi-res timer issue (same as my previous thread+native support under Windows). Which brings me to my question. What do you (the community) believe to be the greatest technical issues currently surrounding the 1.4 game APIs?
I could have used a good graphical GUI system years ago.
Really everything else is pretty easy, making an API is good because it’s reusable, but I’ve never considered anything graphical “difficult” longer then the 5 minutes it took to read the API docs and write whatever it was I wanted.
The harder part of games, like pathing and all that jazz is hard the first time, because it’s new, but that is so game specific it doesn’t matter in terms of an API. So really people might argue with me here but in terms of a base API I really would like a cup of steaming hot GUI.
Edit: I realize that saying I didn’t consider anything graphical “hard” is inaccurate and may seem arrogant so I would like to append my post to say: I own. Thank you.
I don’t have a technical issue but when reading your description I thought to myself: Why only three parallax levels? Is a List of # parallax levels really any harder?
[quote]What do you (the community) believe to be the greatest technical issues currently surrounding the 1.4 game APIs?
[/quote]
- The lack of hi res timer (you can work around it a little but throttling will always be an issue).
- javax.sound lags.
- No good support for input (sometimes input lags behind on some machines).
- java2d lacks performant features like blending, rotating etc. If you want your game to look anything better than retro, you have to use a more dedicated api like openGL.
It seems like the timer issue should have been addressed a long, long time ago.
[quote]I don’t have a technical issue but when reading your description I thought to myself: Why only three parallax levels? Is a List of # parallax levels really any harder?
[/quote]
Actually, it does support more than triple-parallax, that’s just the most that usually looks good in a game. The parallax class I have works by stacking maps, calculating which one is the largest, then normalizing the movement of all of them based on the coordinate system of the largest one. Works pretty well, and lets code can treat the whole shebang as one map.
I agree. Graphics themselves are not all that hard. Trying to put together a system that handles the logic behind those graphics gets harder and harder as the size and scope of a game increase.
[quote] - The lack of hi res timer (you can work around it a little but throttling will always be an issue).
[/quote]
I’ve got a hires timer for windows, and all other systems (to my knowledge) have 1ms resolutions. My timer code only works off of the System timer if the Windows DLL is not available.
[quote]- javax.sound lags.
[/quote]
I’ll make sure I add workarounds for this.
[quote]- No good support for input (sometimes input lags behind on some machines).
[/quote]
Do you know what the conditions are that cause this? To date, every machine I’ve seen has produced fairly responsive input.
[quote]- java2d lacks performant features like blending, rotating etc. If you want your game to look anything better than retro, you have to use a more dedicated api like openGL.
[/quote]
This is true. In this case, using LWJGL becomes a good option. I’m considering adding support for multiple renderers so that developers can choose various ways of handling rendering depending on their needs.
Thanks for your comments guys! Keep 'em coming.
“Trying to put together a system that handles the logic behind those graphics gets harder and harder as the size and scope of a game increase.”
IMO the hardest thing about programming is creating well structured classes and good code, graphics or no graphics. It prolly doesn’t help that I’m super anal and I wont allow myself to cheeze the smallest of things sometimes.
Hi the with java you really have two options for making games.
Use Java2D for basic platformers and shooters, or LWJGL for everything more complex.
With straight java2D you don’t have the hi res times etc, but for the types of games you’d make with it its not a problem.
If you want faster graphics, hi res timers, better sound just use LWJGL!!
I think we should generaly use lwjgl for graphics unless it needs to be an applet or somthing similar.
Its possible to abstract the rendering to allow DirectX or OpenGL, but foget about abstracting between openGL and java2D. There to different.
The kind of game api id like would contain lots of small simple functions, that don’t tie you into using the whole system.
Allergo is a good example, even though its in C, its i nice clean design, with simple functions that do one thing well.
Im thinking the basic util functions every game needs, math functions, interp, curves, fonts, images. Nothing to do with rendering API’s.
http://www.froggy.com.au/harleyrana/java/API.java
Its simplicity lets you use it in any type of game. Obviously you’d add a bit more to it, but you get the idea.
Harley.
just out of curiosity… are lookup tables really faster anymore? i assume that’s what they are in that API.java
apart from that, there are no sprite stuff like
public Image[] loadAndExtractSprites(String fileName, int nbr) {}
(i use CropImageFilter for this)
Hey look up tables make a big difference for trig functions.
There are heaps of things that could be added to the api, i just gave a brief example.
The point is a util library, with functions that you’ll use all the time in lots of different types of games.
Probally a bit off topic for Jbanes initial question, buts what i want.