Advertisement

[java] State of Java Game Development - Topic #3: Java and DirectX

Started by June 05, 2000 11:53 AM
18 comments, last by Jerry Lynn 24 years, 6 months ago
Original Post: I thought that it might be interesting to start a series of discussions on the state of Java game development. I’ll throw a question out and if everyone seems interested I can continue to throw out additional topics every couple of days. If we get some good comments I will sum everything up in an article (maybe add a little additional research) and submit it to this board. I haven’t done one of these in a while, and everyone seemed to respond well to them in the past, so without further delay... Topic #3 Java and DirectX It seems to me that one of the problems we face attempting to develop games in Java is the lack of DirectX bindings for current versions of the API. Even in the OpenGL forums they advise using DirectX for audio and input device management. While its possible to go through JNI to get access to the DirectX Libraries, that is in itself a major undertaking and is beyond the capabilities of most amateur game developers (the ones most likely to Java to develop games in the first place). I don’t see using DirectX from Java getting any easier. Microsoft has all but abandoned Java. The latest supported version of DirectX is version 3, and as new versions of DirectX are released I bet we see legacy interface support wane (meaning that if you have DirectX 8 or higher installed on your system, games that require DirectX 3 will cease to function). So the questions I pose are: - Do we absolutely need DirectX? - Are the standard Java alternatives sufficient (ie… Java Sound and AWT input device techniques)? - What are the biggest holes left in Java Game development because of the lack of DirectX support (such as the inability to use force feed back enabled joysticks)? Because of the availability of components and mappings to DirectX and OpenGL, both Visual Basic and Delphi have better game development support than Java at this point. In many cases these mappings were developed by third party developers (There are open source components for Delphi for both DirectX and OpenGL. Visual Basic has open source components for OpenGL and had them for DirectX prior to version 7 when DirectX offered support for VB). Is anyone aware of efforts underway to provide bindings for the more current versions of DirectX by third party developers (maybe something like what Magician does for OpenGL)? (and for our ‘flame-bait’ question of the day) - Microsoft’s lack of support Java and DirectX is for obvious reasons, but what about OpenGL? They have been trying to set a standard for using OpenGL for Java for over two years and haven’t reached I final conclusion that I am aware of (though I believe most developers and SGI are supporting Magician). Its too soon to know if OpenML will have Java bindings. SDL (Simple DirectMedia Layer) even has bindings for Python, but not for Java. Why does there seem to be a lack of support or interest in Java graphics API’s?
Jerry, I think the primary concern should not be to make graphics programming easier for the hobbiest, but to make Java graphics and game development possible for commercial ventures. Hobbiests are not going to be able to put the money or time into the language that are required to make it a stable robust development platform. Our JVM''s must run faster and better before API''s will be of any use to us.
Advertisement
Hmm... lack of support or interest in Java Graphics APIs? I don''t really see any lacking, I see a lot of APIs comming from sun, and a few from other developers. I feel the main reason why no one is pushing Java as a game dev language is the simple lack of client side runtimes, coupled with the misunderstanding of the language.

I don''t think we need directX. An individual might require DX for thier particular project, but for the language as a whole... I''ve seen too many impressive demos to think otherwise. Are the alternatives sufficient? that depends on your needs.

I don''t see any big holes left in java that are stiffling amateur game development. But, things i would like to see are, resolution changing and peek & poke functions.

WildTangent provides a DX wrapper for c, java-script and (i think) java. wildtangent.com
The the question: Do we need directX.

I don''t thinks so, We can create ood game with out direct X! Direct X is only a tool, and the Java API can do anything Direct X can do!

Look in the past...developper din''t have Direct X and they manage to do really good game! Lets prove to microsoft than we don'' need their Direct X

Delisk
Good questions, I''ll just go through them one by one from the game library programmers view:

Do we absolutely need DirectX?
Not if we can find something that is equal or better as an API (which shouldn''t be too difficult). Most people propably are thinking about 3D support when they think about DirectX, but 3D support should propably be done through OpenGL mappings which would be easier to port to all platforms. DirectX is overly complex to use with its heavily Win32 based COM architecture and would propably be near to impossible to port to all platforms. The "whatever" API in question would need to include support for fullscreen graphics modes, proper sound and input device reading with small overhead (+joystick support).

DirectX API is really not the most productive API I''ve used and while it is the industry standard today, it really isn''t the best possible choice. E.g. many of the 3rd party libraries that build upon DirectX make the game programming experience much more enjoyable and productive (which should be of consern to both hobbyists and professionals).

Are the standard Java alternatives sufficient (ie… Java Sound and AWT input device techniques)?
No, they are not. Sound API is cathing up with the release of JDK 1.3 (finally we can try to stream sound data with buffers through an official API), but even with that it is still unsuited for game use due to lag and choppy sample playback. Also the kind input of reading and graphics mode switching support that a game needs are not there.

What are the biggest holes left in Java Game development because of the lack of DirectX support (such as the inability to use force feed back enabled joysticks)?
I have to say that the single most important missing feature is the fullscreen graphics mode support. A game looses much of its appeal when it is played in a small window instead of fullscreen. Yes you can try to get around that with fullscreen sized windows, but that is not the real thing. Actually this started my GF4J project a year and a half ago, I had programmed an Asteroids emulator and I wanted to see it run in fullscreen graphics mode.

Input device techniques are inadequate and overly complex for game use. Keyboard input is ok, but mouse input is horrible. The amount of event objects created for a single sweep over the screen is huge and the complex event handling mechanism causes some serious lag if you try to make an icon follow the cursor exactly. Also the inability to capture the mouse is frustrating. And there is no joystick input support at all.

Sound support is not yet good enough (as I mentioned earlier).

Also we need to take into account that the users don''t necessarily want to download and install a new JVM just because your game requires it. That is also a thing I''ve tried to battle with my game library, but it is just a one man project and it really can''t deal with all the problems that arise from this. A simple (but not limiting) API library that would be usable from all current JDK''s (1.1, 1.2 and 1.3) would be the best solution.
-Pasi Keranen
Check out http://www.javasoft.com/products/java-media/3D/index.html

Which is Sun''s Java3D page. Java3D enabled VMs will be using OpenGL (and looks like Sun is working on a DirectX version). So, through the Java3D API, you''ll be able to get hardware acceleration. Hopefully Java3D will become part of JDK in the near future.

Advertisement
You should check out the posts in the Java 3D thread that was posted a day or two ago. I don''t think anyone is going to be using Java 3D for games any time soon.

,JL
I think the current Java platform (jdk1.3) for Windows is already using DirectX for 2D graphics. Check out this link where Sun recommends turning off DirectDraw support if it causes problems:

http://www.javasoft.com/j2se/1.3/relnotes.html#2D
And the Macintosh version uses Quartz. Which is very powerful and pretty fast.

Be reading you,
David

--
===
Am I the keeper of my brother ?
It seems Sega is adding Java support to their Dreamcast console.
According to an article in Wired the Dreamcast''s webbrowser will have Java support in August. While Java support in the web browser might be of limited use to serious game developers (especially since they are using a version of PersonalJava rather than the Java2SE platform) it''s still a step in the right direction. The fact that a JavaVM is being built for the Dreamcast''s hardware platform means that most of the work that is needed to have real Java support for the platform is being done.

Personally I think that smaller console makers (counting market share) like Nintendo and Sega are going to have to come up with something creative, such as Java support for their consoles, in order to get developers to keep making games for their platforms, especially since MS will enter the business soon. I would love to see a version of Java with good performance for games and this might be the first step.

The article:
http://www.wired.com/news/culture/0,1284,36810,00.html

Henry

This topic is closed to new replies.

Advertisement