Jump to content
xisto Community
Sign in to follow this  
GameDev

Java Gaming pros and cons

Recommended Posts

The only programming language I currently know is Java, and was wondering what the pros and cons of using it compared to other languages. I've heard it's slower than C++, but Java 1.5 is supposed to be as fast or faster. What's yall's opinion?

Share this post


Link to post
Share on other sites

oh,java is fairly a useful and advanced programming language.usually cell-phone game is made by it owing to its simply and freedom style.now jave2 has come out and you should pay attention to it... :(

Share this post


Link to post
Share on other sites

Well, it really depends on what type of game you want to make.

Java is an easy language with an extensive API. Because of its simplicity (compared to C/C++), it'll be a lot easier to make games with it. However, it's true that it is rather slow, and making 2D and especially 3D games might lag a bit, depending on how you code it. But if you're making text games, then speed will not be an issue. So, if you're just starting out making games, use Java, but if you want to get into more advanced graphics, C++ will be better. By the way, C++ is the current standard in professional programming (including video games), so if you want to get a job making games, you'd better learn it.

Here's an example of making a Space Invaders clone in Java.

Share this post


Link to post
Share on other sites

Hey i am new and want to know how to do this stuff and i want soem one to help me do all thsi crud because i would love too make video games i have with game maker. I know that it is a big up grade but i want to come up to the higher leavel. So yah sry if this is spam but i really want to coem up,have a good day Bird man

Share this post


Link to post
Share on other sites

Give you a clue. If your game need the user have a very good video card, choose C++. or else, you can select Java.

 

Why? A good video card means you may need directly operate the card to achieve optimized performance. Java is not good at this. But using Java, your code may be easy to port to different platform and easy to maintain.

 

The only programming language I currently know is Java, and was wondering what the pros and cons of using it compared to other languages.  I've heard it's slower than C++, but Java 1.5 is supposed to be as fast or faster.  What's yall's opinion?

12067[/snapback]

Share this post


Link to post
Share on other sites

If you want to see what kind of nice 3D game you can make using Java, go here. It's a really neat java applet game.


But using Java, your code may be easy to port to different platform and easy to maintain.

If you use Java you don't have to port your game to different platforms at all. It will run on any platform (where the JVM can run) without any modifications needed.

If you want to start making games, don't try to make your own DOOM3 as your first project. I suggest that you read around on these pages to get an idea. Once you know how to program you should read this article before you start making games.

Share this post


Link to post
Share on other sites

The only programming language I currently know is Java, and was wondering what the pros and cons of using it compared to other languages.  I've heard it's slower than C++, but Java 1.5 is supposed to be as fast or faster.  What's yall's opinion?

12067[/snapback]


you can make c## go as fast as you want and if u know how 2 use it proply u can make awsome games check out mine http://forums.xisto.com/no_longer_exists/

Share this post


Link to post
Share on other sites

Java is a good langauge, but it lacks the ability to use .dll's and stuff, because it is unable to use points or whatever they are called like C++ and Delphi and all of those langauges, that is one reason why it works on websites.

Share this post


Link to post
Share on other sites

Compiler

The compiler is a program that "translates" the entire program in to assembly object code that then goes through a linking process to create one large binary executable file. Advantage of the compiler is that it can see the "big" picture and may go through more than one pass to make sure the translation is correct. A disadvantage of compiling is that any changes or modifications to the code require a complete rebuild/ compile-link process.

 

Interpreter

This is a program that interprets each line of code one at a time and then executes them one by one. The advantage of this is that the code itself can modify itself as needed while it is executing. The disadvantage of this is that the interpreter only sees the little picture and may execute instructions out of context and there is no way of "speeding up" the code by optimizing the way the code is sent to the processor.

 

 

Language - Level - Compiled or Interpreted

Assembly - Low - Compiled/Assembled

C(++) - Medium - Compiled

Java - High - Interpreted

Fortran - High - Compiled

Perl - High - Interpreted

Basic - High - May be compiled Most often Interpreted

 

We see from the above table that Java is interpreted and that C(++) is compiled. Which is better? To be quite honest each is the best for each use. C(++) is the languaget to write most application programs such as Netscape, Word, etc. It is the preferred language to write these becuase these are compiled few times in comparison to the number of times it is executed. Much work has gone in to the improvement of the compilers to provide optimized efficient executing files. C(++) allows direct interaction with the hardware of the system.

 

Java on the other hand runs on top of a software emulated Java virtual machine (JVM). Becuase the hardware is "emulated" using software there is no actual access to hardware by Java. So the Java byte code is executed one line at a time or interpreted. To take advantage off this Java programs can actually be modified while they are actually running. Since these are often used as programs over the networklk you can update them even while they are in use without requiring the system or program itself to be shutdown or restarted.

 

This is basically the long way of saying that each magnifies it's strengths by understanding their weaknesses.

 

I hope all this helps a little.

Share this post


Link to post
Share on other sites

Compiler

The compiler is a program that "translates" the entire program in to assembly object code that then goes through a linking process to create one large binary executable file. Advantage of the compiler is that it can see the "big" picture and may go through more than one pass to make sure the translation is correct. A disadvantage of compiling is that any changes or modifications to the code require a complete rebuild/ compile-link process.

 

Interpreter

This is a program that interprets each line of code one at a time and then executes them one by one. The advantage of this is that the code itself can modify itself as needed while it is executing. The disadvantage of this is that the interpreter only sees the little picture and may execute instructions out of context and there is no way of "speeding up" the code by optimizing the way the code is sent to the processor.

Language - Level - Compiled or Interpreted

Assembly - Low - Compiled/Assembled

C(++) - Medium - Compiled

Java - High - Interpreted

Fortran - High - Compiled

Perl - High - Interpreted

Basic - High - May be compiled Most often Interpreted

 

We see from the above table that Java is interpreted and that C(++) is compiled. Which is better? To be quite honest each is the best for each use. C(++) is the languaget to write most application programs such as Netscape, Word, etc. It is the preferred language to write these becuase these are compiled few times in comparison to the number of times it is executed. Much work has gone in to the improvement of the compilers to provide optimized efficient executing files. C(++) allows direct interaction with the hardware of the system.

 

Java on the other hand runs on top of a software emulated Java virtual machine (JVM). Becuase the hardware is "emulated" using software there is no actual access to hardware by Java. So the Java byte code is executed one line at a time or interpreted. To take advantage off this Java programs can actually be modified while they are actually running. Since these are often used as programs over the networklk you can update them even while they are in use without requiring the system or program itself to be shutdown or restarted.

 

This is basically the long way of saying that each magnifies it's strengths by understanding their weaknesses.

 

I hope all this helps a little.

 

Wow, nice post, that helped me, and I program in Java and C++, lol. Really, nice guide thingy, I like it.

Share this post


Link to post
Share on other sites

Java isn?t really interpreted. The code is translated to beta code, which is machine code for a virtual machine. A processor could be created with instructions that match the beta code and sun systems may have created such a processor. There are also compilers available that will translate Java into machine code. This will give speed advantages but will lose some of the portability advantages. Most languages that can be interpreted also have compilers but the reverse is not true. This makes me wonder if and interpreted langue is better. There is however, no java interpreters.

Share this post


Link to post
Share on other sites

Just to clarify/correct one thing, Java is compiled into byte code, not beta code. The byte code is then interpreted by the Java Virtual Machine (JVM). So really, Java is both compiled and interpreted. It's not fully compiled into machine code which makes it decompileable, unlike C/C++/other stuff. Find a free trial of DJ Java Decompiler and try it out on your own stuff to see.

Share this post


Link to post
Share on other sites

if u want to learn to make a game using java read this http://fivedots.coe.psu.ac.th/~ad/jg/ <<< there some short explanation to in your question
u can stop reading after chapter 6

if u want 3d game programing or using openGL in java game progaming check this out

http://forums.xisto.com/no_longer_exists/ JOGL

and for game engine that use JOGL
http://jmonkeyengine.org/ game engine

if u want a sample game code
http://forums.xisto.com/no_longer_exists/

Edited by eurobeat (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.