Ferrous Moon
http://www.ferrousmoon.com:80/forums/

Up/Onlink in Java...
http://www.ferrousmoon.com:80/forums/viewtopic.php?f=52&t=741
Page 2 of 3

Author:  Tycho [Fri Feb 29, 2008 2:59 am ]
Post subject:  Re: Up/Onlink in Java...

State sponsored universities are the ones that are especially guilty of the heinous crime of pushing Java on their students. The university I go to, Seattle Pacific University, pushes C, C++, and assembly language.

Author:  eddieringle [Fri Feb 29, 2008 6:48 am ]
Post subject:  Re: Up/Onlink in Java...

Back in 6th grade, I was excited to hear that I would be learning QBASIC in the 8th grade (at the time, I had already known a bit of it). Then comes 8th grade and no QBASIC. But in that time I had managed to learn C++ (most of it anyways :P). The only thing I don't really understand yet is all the math and algorithms to C++, like the ones used in the previous prime challenge. Maybe it's because I'm only in Algebra, I dunno.

Author:  prophile [Fri Feb 29, 2008 12:49 pm ]
Post subject:  Re: Up/Onlink in Java...

Now the language in which I would love to write a game some day is Objective-C with the Foundation kit. Now Objective-C lies somewhere between Java and C++ - while the Foundation kit provides an array of classes for all sorts of purposes, because of the inheritance concept you are free to subclass anything you want and write your own implementation which works exactly the same, and for performance-critical sections, Objective-C is a proper superset of C, so you can freely mix in pure C code. Outside of that, I'd say this: interpreted languages are not, as Tycho would apparently have you believe, the very vomit of Satan himself, but there is no doubt that they are slower than C(++) or assembler. However, they tend to be a great deal easier to use than C or assembler. What I tend to do when writing games is to create the core engine - that is to say, the rendering subsystem, scene graph APIs, networking engine, sound system etc - within C++, with bindings to one of the faster scripting languages called Lua which handles the game logic. This combines the processing power you get from C with the extensibility and programming ease that comes from using a scripting language.

Author:  cpuhacker [Fri Feb 29, 2008 1:41 pm ]
Post subject:  Re: Up/Onlink in Java...

But couldnt you use Java for the Core Engine, even though it's a bit harder, and much more annoying then C++ you would get better scene graph APIs, and a networking engine because it was influenced by Objective-C, C++, Eiffel,C#, and Mesa. It was primarily influenced by C++ so then it would have the components/features of C++ (which you want for the core engine) and extra features.

Author:  prophile [Fri Feb 29, 2008 1:44 pm ]
Post subject:  Re: Up/Onlink in Java...

You could, but why would you want to? If you're going to stick up two fingers to performance requirements, why not go the whole hog and write the whole game in Lua?

Author:  cpuhacker [Fri Feb 29, 2008 1:47 pm ]
Post subject:  Re: Up/Onlink in Java...

Isnt Lua a bit to lightweight, I mean it dosent have all the best features that Java does, though it does have the newest programming code release I believe it was 5.1.3 three days ago.

Author:  prophile [Fri Feb 29, 2008 2:02 pm ]
Post subject:  Re: Up/Onlink in Java...

Which 'features' did you have in mind?

Author:  ugi [Fri Feb 29, 2008 3:07 pm ]
Post subject:  Re: Up/Onlink in Java...

Lua is a bit lightweight? I guess you think python, perl and so on are also ``scripting languages'' and lightweight as well?

Author:  prophile [Fri Feb 29, 2008 3:32 pm ]
Post subject:  Re: Up/Onlink in Java...

I do not dispute that as scripting languages go, Lua itself is lightweight. It is, that's a fact. This does, however, mean huge performance increases - there's also the fact that the Lua API gives you the capability to add basically whatever you want to the language, which makes the point about its minimalism a non-issue since there are just external libraries for that.

Author:  ugi [Fri Feb 29, 2008 3:39 pm ]
Post subject:  Re: Up/Onlink in Java...

I don't think the use of the word lightweight is warranted in that case. It loses meaning if you aren't including standard or easily downloadable libraries and APIs. I'd call a lot of languages lightweight in that instance, and the word does not seem to fit.

I take lightweight to mean a language that can not really produce `serious' programs, or be used in a commercial setting without the aid of other, more `heavyweight' programming languages.

Author:  prophile [Fri Feb 29, 2008 5:29 pm ]
Post subject:  Re: Up/Onlink in Java...

Perhaps 'minimal' would be a better term than 'lightweight' then.

Author:  ugi [Fri Feb 29, 2008 6:49 pm ]
Post subject:  Re: Up/Onlink in Java...

Oh certainly, it is nice in that way. Perl can be non-minimal in that instance ;).

Author:  FinalWarrior [Sat Mar 01, 2008 1:53 am ]
Post subject:  Re: Up/Onlink in Java...

In my school district, we (currently) have three levels of programming classes: Programming 1, and AP Programming 2 and 3.

Programming 1, we learn C++.

Programming 2 and 3, we learn Java.

For the students in Programming 2 who are in the class because they want to learn to program (instead of earn a tech credit towards graduation), of which I am one*, this is an utmost cruelty. My very soul weeps.

(Basically, I hate how much you need to type to print text to console, and I despise how Java can't pass by value. I want my goddamned ampersands, FFS!)

And I feel pretty sorry for my teacher, too... she has to teach introduction to tech, and Programming 1, 2, and 3. He only reprieve is that since the Programming 3 class is so small (I think it's only four or five guys), they got lumped into my Programming 2 class. (Of course, this is unfair to them, because they don't get my teacher's full attention; she's busy beating half the Programming 2 class off the Internet, because almost no one in that class actually wants to learn how to program, they just want the credit.)

Just my experiences with Java. (Or, as I like to call it, Satan's computer's hate-spawn.) I wish we could pick the language we learned... it'd help weed out the stupids.

-- Griffinhart

*: Out of two, maybe three or four. I think most kids take the class thinking it'll be an easy way to earn the credit and get to simultaneously spend time goofing off. I'm glad my programming teacher is awesome, and therefore not nice. :D

Author:  Lassombra [Mon Mar 03, 2008 10:40 am ]
Post subject:  Re: Up/Onlink in Java...

Hey all, some of you might have seen me once in a while over at uplink boards.

I jut thought I'd pop in here and point a couple things out.

1) Anyone who is trying to write a game for Java: Unless you are writing it to go in a web browser, stop. Just stop. Don't look back, don't pass go, go straight to STUPID! And if you ARE writing it to go in a web browser, there are so much better interface languages available that don't hog 99% of the user's system. For example: Flash, Silverlight, PERL??? Ajax. I mean, seriously, if you are going to write a substandard game (minimizing it's value to squeeze it into a web site) then why go with a substandard language too? Shouldn't at least one part of what you're doing be intelligent?

2) If you have your heart set on a Java esque language, then ffs go with C#. It is written specifically to be nice to Java programmers who are waking up. It uses JIT compilation that, in some cases, can be as fast as native code. (I've actually seen some benchmarks where C# code ran a few cycles faster than native as it's compiler is better able to identify hotspots and optimize them more than usual on startup. This makes it great for programs that are going to be running a length of time like games.)

Author:  alansmithee [Mon Mar 03, 2008 12:52 pm ]
Post subject:  Re: Up/Onlink in Java...

Quote:
2) If you have your heart set on a Java esque language, then ffs go with C#. It is written specifically to be nice to Java programmers who are waking up. It uses JIT compilation that, in some cases, can be as fast as native code. (I've actually seen some benchmarks where C# code ran a few cycles faster than native as it's compiler is better able to identify hotspots and optimize them more than usual on startup. This makes it great for programs that are going to be running a length of time like games.)
Just some points to consider:

1) Java's not that slow anymore. Yeah, I know -- you always read that "OMG Java's dog slow", etc... but that's not really true nowadays. It used to be a horrible performer, back around 1.1 -- but Sun's put in some serious work into optimization. As of 1.6, Java's fast enough for use in a desktop app. The main cost comes at JVM startup -- but once the JVM is running, it's honestly not that bad. How fast is it? Well -- the Quake 2 engine's been ported to Java, and runs at basically the same speed as the native engine. I'd say that unless you're gonna be doing something more graphics-intensive than Quake II, Java will perform just fine on a modern machine.

2) C# isn't portable. The only reason I can think of to write a game in Java is portability -- and that's one thing that C# definitely doesn't have in its favor. Yes, C# has a JIT compiler -- but that's not unique; Java has several JIT compilers available as well. GCJ can even build fully-native binaries from Java source (or from compiled .class files, for that matter.)

Personally, I can see the value of writing something in Java (of course, I am a Java dev) -- but in cases where you need more performance, faster start times, or just don't want to deal with the memory overhead of a JVM, native code's your best bet. You wouldn't stand a chance writing something like FarCry (or even Halo, for that matter) in Java.

Something like an Uplink clone, on the other hand, I think could do quite well in Java, as it's not terribly demanding, performance-wise. That said, there's the question of "why?" As was pointed out earlier, Uplink runs on all three major platforms natively -- so why bother to re-invent the wheel (other than for the learning experience / fun / sadomasochism of it.)

I could, however, see one massive benefit of writing a hacking sim in Java: Multiplayer. Java would allow you to sandbox your app, as well as ensure that buffer overflows, etc. won't result in the compromise of a player's machine. I've often toyed around with the idea of writing a multiplayer hacking sim in Java, and even got as far as writing some netcode. Then I realized that my vision of a hacking sim (far more realistic than Uplink, command-line only, etc.) would have pretty much zero interest from gamers. Oh well.

Page 2 of 3 All times are UTC-05:00
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/