Usenet.com

www.Usenet.com

Group Index

Rec Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Game programming in Java ??



"Peter Ashford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >>>
> >>
> >>For 3D (Jogl/OpenGL), Java speed is fine because most of the work is
> >>done by the Gfx card.
> >
> >
> > Sounds like a contradiction in terms to me.
>
> What terms contradict?
>
>
> OpenGL is almost exclusively
> > used on PC's
>
> Ummm... no.  Macs use openGL heavily too.  So do most graphics
workstations.

Ok, same difference.

>
> and therefore C++, VB or DarkBASIC would be much more obvious
> > choices.
>
> Why?  What is "obvious" about using BASIC or C++ for openGL over using
> Java?  I could perhaps understand that argument being made for C or C++,
> since openGL is a C interface, but why is BASIC more "obvious" to use
> with openGL than Java?

Java is generally used in cross-platform business applications since speed
matters less there and the payoff of multiplatform execution is a great
boon. In games, you want the fastest performance possible. How many
commercial PC or console games are written in Java? None that I know off.
Speed matters, every drop of it. Until someone comes with a good native
code, static compiled version of Java and proves that it's 90% as fast as
C/C++ under similar circumstances, I won't give it a second thought.  Also
note that a lot more tools (libraries and such) are only available for
C/C++. Don't get me wrong, I'm a Java fan (as in the language), but in the
entertainment industry competion is horrible, so you can't afford your game
having just a little less performance. On top off that, people won't like
them having to install a virtual machine to run your app.

>
> And even though a lot is done by the 3D card, there's still plenty
> > of overhead in the game logic, so speed does matter.
>
> Have you profiled that and found out?  I have done a lot of profiling of
>   windows/VC++/openGL, windows/SDL/OpenGL and windows/Java/OpenGL code
> and I've seldom found many areas requiring radical optimization -
> usually just using a sensible alogrithm does the job.

Maybe, but speed still matters and C++ is still quite a bit faster than Java
(especially startup and pre-JIT first-run). That may mean that may mean the
difference between 12 and 16 computer controlled opponents (compare the PS2
and XBox versions of "DTM Race Driver" for example).

>
> I've also profiled raw number crunching (floating point and integer
> maths, array thrashing) in Java and VC++ and found the performance to be
> very similar (for those tests, Java was about 80-105% the speed of C).
> That means that unless you code very badly, there's no reason that your
> game logic should go slow in Java.
>

Sounds too good to be true. And what kind of Java programming tools were you
using? Compiled or JIT interpreted Java?

But when you introduce your commercial Java PC/Console game, let me know.
I'll gladly eat my own words.











<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.