Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Java as a Game development language

Started by XdragonosX Oct 13, 2002 at 9:16 AM 49 replies 6.1k views
Original Post
XdragonosX
XdragonosX
Hi, I''ve been working on a simple game using a GUI interface in java. As I was working I decided to take a break and go online and look at some examples and prehaps some source code of games made in Java. There wasn''t many and Mostly anything pertaining to game development was either in c or c++. So my question is, is Java a good language to develop games in? Is there a difference between Java and C++ that makes C++ a better game development tool? or is it because c and c++ has been in used so long, no one wants to change. Answers will be greatly appreciated, thanks.
Arch@on
Arch@on
Hey, I do not think you have been looking from the right places. I''d suggest you go to javagaming.org and check the 3d demo they have overthere, since what you seem to be looking is something to impress you.

Java game apps are hard to find and they are mostly in closed communities with programmers who are close together physically.

It is also hard to find decent enough communities as it is. And last night when I checked javagaming.org they still had last post by my, over half a year ago where I wanted them to explain how the scroller works.

Java as a language is not limited. The problem is the community, which is not active enough. The most prominent programmers are working alone, therefore they are not very productive, since java industry is filled with 1337 d00ds who are trying to find an easy way to implement their morpg by copying and pasting from templates.

Arch@on
Arch@on
The development of C language has stalled, in fact it has been moved to big corporation, like Microsoft and IBM, which both take C++ to their own different directions. This makes C++ faster, but it also makes it dependant. Java, as you can see, has been fastly growing and gaining speed all the time and its only a matter of time when its faster than c++.

The only problem is again the communities. Where as Java has been developed, the communities have become elitist ones where only the real 1337 d00ds survive.
Viro
Viro
Check out Evaluating Java for Games
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.
Wrathnut
Wrathnut
Java is a good language to make games in, as long as your game fits within java''s speed bottleneck.

Don''t get me wrong you can make a lot of cool things that run fast as hell in java but if you are just starting out simple it will be no problem.

If you wanna see a cool java game check out:
http://www.runescape.com

As for source codes for games you can probably get a hold of a lot of simple ones like pac man and tetris, just by searching google for them. That''s how I found a lot of them.
nonnus29
nonnus29
I have Tetris and Asteroid applets on my site with the sources.

www.geocities.com/nonnus29/index.htm
HenryApe
HenryApe
Probably the most important reason why most serious games are written in C++ is that it is the only language that can currently be ported to consoles such as the PS2. Sony is working with Sun to create a game profile for Java though, the admins at javagaming.org should know more about that since they are in the group that work on the profile.
FearedPixel
FearedPixel
I am not too sure about this, but the fact that java can be so easily decompiled into clean code almost 100% like the original make it pretty useless for multiplayer games, since anyone with basic java knowledge could modify the game and cheat?

I guess if you use an applet then that could be overcome, but then again, applets have limitations, not the most ideal medium to release large or commercial games on.
Viro
Viro
There are tools like Java obfuscators, and native compilers if you''re that worried about people decompiling your code.
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.
c_wraith
c_wraith
Java is a somewhat difficult language to program highly interactive games in, because it takes skill and a lot of testing to make the garbage collection as non-intrusive as possible.

With regards to decompilation... It doesn''t make cheating any more of an issue than it already is. In multiplayer games, cheating is taking advantage of holes in the communication protocols in some way. Either they give you too much information, or they trust each computer too much. If the protocol is well designed to minimize those problems, being able to see the source doesn''t make a difference.
FearedPixel
FearedPixel
Well, direct access to sourcecode will make cheating more of an issue imo. It means that the user can understand the communication protocol. Even if the game is heavy on the server side, and the client is almost completly just a gui shell, simply access to the protocol could allow the user to generate information that he should not know of. (although this depends heavily on the game in question).

I also have a question related to native compilers; is there any available for linux/mac ? Also, are there any more for windows apart from JET and that gcc conversion thing (cant remember what its called gcj maybe)?
HenryApe
HenryApe
From a theoretical computer security standpoint, using an obscure language is exactely ''security through obscurity'' which most people in the security industry will agree is not to be trusted. The only way to really secure a game is to do everything on the server and just send the client the information that it should legally have.

From a more practical perspective, well, there are cheats for all multiplayer games but that did not stop Quake, Counterstrike, EverQuest etc. from becoming great successes. I''d say the decompilation argument is mostly FUD when related to real commercial game production.
FearedPixel
FearedPixel
Even if java had the same speed and features as C++, and if any of the above games was written in java, it would have been a disaster, and they wouldn''t have been nearly as successful. Having direct access to the game code is not the same as analyzing network packets/hooking dll''s to make cheats. It would have meant completly custom clients, absolutly no possibility for online competition which is what made those games big and keeps them there.
dMDI
dMDI
It''s already been pointed out a million times that you can obfuscate code. This would make the difficulty of understanding the code the same as if you decompiled an EXE.

Your point is moot.
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein
Viro
Viro
quote:
Original post by FearedPixel
Even if java had the same speed and features as C++, and if any of the above games was written in java, it would have been a disaster, and they wouldn''t have been nearly as successful. Having direct access to the game code is not the same as analyzing network packets/hooking dll''s to make cheats. It would have meant completly custom clients, absolutly no possibility for online competition which is what made those games big and keeps them there.


I really don''t quite follow the logic here. Just because they understand the client code, doesn''t meant that they''re going to how the server is written. If you''ve designed your game''s multiplayer client/server model properly, this wouldn''t pose a problem at all.

Plus, if reverse engineering is such a problem, you could always use an obfuscator or a native compiler.
"Linux is not about free software, it is about community," -- Steve Balmer, Microsoft Chief Executive.
dMDI
dMDI
BTW, there''s a perfectly good java game development community on the forums at java.sun.com, they are currently holding a 4k and 512k game competition too.
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein
Daemon
Daemon
The problem with programming Java games is mainly that there aren''t too many Java game programmers in the world.. if you program Java usually you end up working on servers and do stuff other than games. It''s simply not a large community as C++.
Additionally Java requires a lot more time passed designing code rather than coding itself. That of course means you would end up with better code, but many people would rather code than design programs.
As far as decompiling goes, there are some ways to prevent some of the code to be seen, especially if it''s remote code, but still, unless Sun introduces a requirement for a "Safe" JVM (like encryption of classes), there is not much that can be done in that field.
Popcap Games is the developer of many popular web browser games, and you can actually decompile all their classes, but I don''t know how legal that is.

D-

-----------
Érdely!
-----------Érdely!
WayfarerX
WayfarerX
quote:
Original post by Daemon
Additionally Java requires a lot more time passed designing code rather than coding itself. That of course means you would end up with better code, but many people would rather code than design programs.

Umm, I''m not seeing where you''re getting this. How exactly does Java impose any design requirements on a project?

"There is no reason good should not triumph at least as often as evil. The triumph of anything is a matter of organization. If there are such things as angels, I hope that they're organized along the lines of the mafia." -Kurt Vonnegut
TheFez
TheFez
More time spent on designing? So does that mean I would spend negative time on design with C++? So if I program in C++ I CREATE time?!?! No wait, that means I can go back in time if I use C++!!!!! See, C++ really is the most powerful language out there, use it instead.

Sorry, I just found that one comment funny. I had to run with it.
Daemon
Daemon
Hmm.. I worded it badly, sorry.
It is my opinion that, because of the way Java is, you should pass more time doing analysis and design beforehand, while you can get away with less in C++.
I guess I find it easier to hack things together in C++ than in Java; while in former I can start coding right away, designing as I go, with the latter I find myself doing more design ahead.
I think a lot comes from the fact that I can use C syntax and constructs in C++, while in Java I can''t.

D-

-----------
Érdely!
-----------Érdely!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.