wood burning stoves
The moose likes Game Development and the fly likes To Flash or Java that is the question! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "To Flash or Java that is the question!" Watch "To Flash or Java that is the question!" New topic

To Flash or Java that is the question!

Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137

i would like to build a chess game (read on, not like the chess games discussed already). heres how this works, this will be played on a browser(no downloading or anything) over the internet, with two players. the player can movie the pieces with either the mouse or the keyboard. Also they can rotate the chess board or their own camera angle to see the different positions of the board. this is not like the usual games where u get a bird-eyes view, but rather a 3D envirnoment with 3d pieces and a board like chessmaster. Also as it is over the internet, the game must load quickly.

So now what should i use?? java or flash?? and with the 3d thing, should i also use 3d studio max or some program like that?? or can java or flash take care of it?

For a better viewpoint i am also putting this question to a flash community
Flash-kit.com. the post is under games. check it out

Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342

If this is to be a Java applet with proper 3D capability you will need to consider that the user will need Java 3D installed as a runtime, which will involve a download, install and setup for them. Also, behaviour of 3D can be unpredictable on different hardware in my experience.

I have developed a 3D applet for viewing data, but it is an internal application and requires that we go and install the 3D stuff for people that need to use it. The only way round this that we found was to use thin-client. I can't comment on Flash.

SCJP 1.4, www.gsi3d.org.uk
Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
thanks for the reply wood. this 3d capability u talk about, is it bundled in with the jdk?? if not is it possible to bundle it with the applet, so that it is downloaded and installed automatically?? and if so, how much time will it take to download and install it on a 56 Kbs modem??

Consider this possibility. is it possible to make the program in java but use graphics from a animation program(3d studio or maya) and embed it in the applet. will that save on time and not result in downloading??

[ August 31, 2004: Message edited by: ali gilani ]
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342

The 3D API is not bundled with the JDK, you need to get it seperately http://java.sun.com/products/java-media/3D/index.jsp

I honestly don't know whether you could automate a download, or prompt an install for a user trying to access your applet - I suspect you could, but I think the download and install process for Java 3D would be a considerable time and effort for a casual website visitor trying to get your 3D applet running in their browser over 56k modem; I doubt anyone would hang around long enough to ever see your applet working, so if there is a simpler solution you should probably take it. As for embedding other media content in your applet, again I don't know, maybe someone else can comment?

The only reason we even considered using Java 3D in our applet was because we know if there is a problem running it we just have to walk across site and set things up for the user. I personally would not like to attempt providing a 3D applet for general users with no support and slow internet connections, I think they would just give up trying after a few minutes downloading/installing etc. If you have the resources, thin-client is much more hassle free, and is how we envisage providing access to our applet to other users in the future. Apologies for not being more positive about this, but we have had a lot of issues with our 3D appplet just getting about 40 user on site up and running with it, although it does look good when it works
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Hey Ali-
Sounds like a neat concept for a game!

Check out these two discussions about 3D that we've had recently:
Best 3D option in an applet?
JOGL or LWJGL (these are open gl libraries I think)

Hopefully that helps with a few of your questions.

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
thanks for the reply jessica. i saw the discussions and played that slime game, but the game is 2d and there is a distinct flicker as the graphics change. Also Wood is rite, the loading and installing will take time. The ppl at flashkit.com said that same thing. check out their replies Board>Games>


One thing, what about integrating 3d studio max objects in a java applet. will they perform better to that of a Flash presentation??? i mean giving the game 3d capability, the rotating the board and all, will it be easier doing it in java or in flash?

Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
Also everyone play Chessmaster, and look at how the board and pieces look. i would like to achieve that in this game, so once again what do i do, flash or java. what ever the choice will i ahve to use other animation softwares like maya or 3d studio max. or can i make the desired effect with either java or flash

Michael Herrmann
Ranch Hand

Joined: Dec 06, 2003
Posts: 60
I'm quite experienced in Flash so I think that I can give you an answer. Flash is too slow to display a chess board with 32 pieces in a 3d environment that is freely rotateable. Java, although not very fast compared to native languages, is fast in comparison with Flash. So Java is the only possible option.
As already mentioned in this Thread, an additional plugin would drive clients away. I'd embed this game in a simple applet and I'd write things for the 3d visualization myself(or use some opensource code).
You can use 3dsm to model your pieces and the board, but it won't help you in showing your game in interactive 3d. If you use 3dsm to model the 3d stuff you have to export it into a format your game can read.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Java, although not very fast compared to native languages...

Really? Got proof?

What I would do is use JOGL or LWJGL to build your chess game and then use Java WebStart to deliver the app.

I made a test/concept application using JOGL and used Java WebStart to deliver the app. Problem with using an Applet in this case is that you can't deliver DLL's so the user would have to download something extra. With Java WebStart, as long as they have Java 1.4 or above, they already have Java WebStart and it can deliver DLL's.

My test app can be found here. If you click on the Transform Tab and then click the Object button, you can rotate the cone on any of it's axis. That should give you an idea what what download time you are looking at using Java WebStart.

GenRocket - Experts at Building Test Data
Aaron Roberts
Ranch Hand

Joined: Sep 10, 2002
Posts: 174
Whoa there Sheriff Gregg! No need to start a stampede about the speed of Java.

I'm with Gregg. Use JWS. Its simply a much better delivery mechanism than applets. Save applets for cute site navigation or flashy effects.

Before you start getting everything rolling at once, what type of plan have you laid out for implementing this thing? Some things you may want to consider -

- What do you know more about: flash or java?
- How much do you know about 3d (matrices, co-ordinate systems, scene graphs, openGL, etc)
- Have you ever done a network application before?

Maybe a starting point would be to do a 2d version of tic/tac/toe (naughts-and-crosses) thats playable over the network. Then you can use all the knowledge you gain from that in doing the full up chess program.

You could do both a flash and java one and decide which one you felt most comfortable with.

My thoughts anyway.

Aaron R>
I agree. Here's the link: http://aspose.com/file-tools
subject: To Flash or Java that is the question!
It's not a secret anymore!