[java] Java Vs C w OPEN GL

Started by
9 comments, last by lupine 23 years, 6 months ago
After spending significant time and resources learning some C I am finding out that I''m looking at some serious portability issues (targets WIN, LINUX, MAC 7-9, MAC 10) 1So, can Java really run on all these machines? 2Are Java games unstable or "crash happy"? 3Do all high end computers have Virtual JAva Machine? 4. Is there an example of a Java game that I can download and test? 5. I know some other programming language, I took to Java right away, it seems more like what I''m used to then C am I mental or something? 6. Is Java *really* slow? I am only needing 2D 256colors? 7. Does Java have any weaknesses that I''m missing above? how is it at data manipulation? Can I seperate data and logic as in other languages?
"do you like my helmut?"-yoghurt
Advertisement
Try starting with the FAQ for this thread... it may answer some of your initial questions.

http://games.cpbinc.com/faq
1So, can Java really run on all these machines?

yes


2Are Java games unstable or "crash happy"?

no, in my experience they are more stable

3Do all high end computers have Virtual JAva Machine?

I think all computers have the basic JVM, not sure

5. I know some other programming language, I took to Java right away, it seems more like what I''m used to then C
am I mental or something?

yes it is much easier and natural.

6. Is Java *really* slow? I am only needing 2D 256colors?

Not that slow. Unless you are trying to make a game with high requirements java should be fine

7. Does Java have any weaknesses that I''m missing above? how is it at data manipulation? Can I seperate data and logic as in other languages?

java is good, you can do a lot of stuff, even save and load objects directly to files, as well as more conventional text files. My only complaint is that you can''t load .bmp or .pcx files and instead have to go with gif and jpg





ok, I''m doing my project in Java
I''m going to need some help now and then
so I hope you all can back me up.

Project CODENAME "elfshotthefood"
"do you like my helmut?"-yoghurt
>> 3Do all high end computers have Virtual JAva Machine?

> I think all computers have the basic JVM, not sure

They do not all have it installed by default. For instance, Windows has one installed in the browser but that is *very* slow and not directly usuable by you. When you finally deploy your program it would be a good idea to deploy the Java Run-time environment (JRE) with your program or direct your users to Sun''s site for a free download.

> My only complaint is that you can''t load .bmp or .pcx files and instead have to go with gif and jpg

It is quite easy to write .bmp and .pcx loaders yourself. I have actually written some myself in C++ in days past. It will take you just a few days to do.

Jacob Marner
good idea, I should learn to write one. It just seems kind of silly that they didn''t make it know more formats in the first place.
Anon -
I think the reason it only read GIF and JPG files was that Java is supposed to be platform independent. BMP is mostly only used by Windows, and PCX is mostly only used in DOS programs. I don''t think they included ways to load MacIntosh PIC files, or Unix only file types either. However, all of these know how to read GIF and JPG (mainly due to WWW), so Sun just chose those to implement.

-Nate
lupine -

I would consider Javas only weaknesses to be related to it being a partially interpreted language. These are:

1.) It''s a little slower than C/C++.

and

2.) You have to supply the interpreter to run the program.

However, the solutions to these problems are pretty simple.
1.)The speed issue is not a problem with most games.
2.) a.)make your program an applet. Unless someone has a really old browser (or unless you are using some of the newer Java stuff like Swing) if they can get to your program on the WWW they can use it. However, applets have some restrictions on them for security (such as cannot save files on the users computer, cannot access all system info, etc.) so you could also do -
b.)provide the Java Runtime Environment (JRE) with your program as one of the Anons suggested. This way you can use all the newer stuff like Swing and Java2D to make your program look better.

Hope this helps!

-Nate
quote:Original post by DJNattyP

lupine -

I would consider Javas only weaknesses to be related to it being a partially interpreted language.

These are:

1.) It''s a little slower than C/C++.

and

2.) You have to supply the interpreter to run the program.


You don''t have to. There are plenty of native code compilers available for Java, meaning that your code will be compile to machine code and WILL NOT BE INTERPRETED - and much faster.

Read the forum FAQ for more info. Or read this article http://www.rolemaker.dk/articles/WhyJavaCanBeUsedForGames/index.htm

Running the program as an applet is not the solution. The VM part of browsers are the slowest ones available and you force users to download everything everytime they use it - and you can can native DLLs. So don''t use applets if you are serious about game development with Java.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
I belive the JavaVirtualMachine
is shipped on current Macs and Pc''s
Leaving only Linux boxes needing to "get"
the VirtualMachine.
I will indeed look into compiling my code(machine)
"do you like my helmut?"-yoghurt

This topic is closed to new replies.

Advertisement