C++ vs Java

I have looked at the Online Casino/Gaming downloadable games, and most seem to be have written in C++ / MFC.
Is this because of:

  • Download speed: Is this because of the smaller size of application for downloading (about 5 MB), compared to 20+ MB for a similar Java application.
  • Speed of execution: I know that Java is certainly catching up in terms of speed.

Anything else?

Thanks
max

  • Ignorance

java games 20MB? I can think of 100+ java games that dont amount up to 20MB combined…

  • experience I would guess also, there arn’t that many professional java game developers out there (outside of the mobile market)
  • cause everyone does it that way, new one tends to aswell - lack of risk takers.
  • lack of visibility, some people still not aware that Java can do anything else other than those cute little applet things

Kev

They were probably written in C++/MFC because that’s what the developers were used to (and therefore would be more productive with it). If you’re familiar with both platforms I would say Java is easier and also has better tools.

Well, your also looking in a paotentially shadier part of the industry.

Not accusing anyone, but it is a ALOT easier to plant malware from C/C++ then from Java.

Nothing at all to do with either of those

Having spoken to a lot of the developers … the primary reason, sad though it is is:

“Because Flash turned out to be too damn crap to do the job properly … and by writing it in C++ we were able to avoid all the problems of Flash”

(or Shockwave, etc)

Really. These games tend to be written on such short timescales that there isn’t much need to worry hugely about what language you’re going to use, and so C++ has ended up being used as much as anything because it was “good enough to get the job done”. Over time, you might well see more games move towards C# (if MS can get the massive .NET installed on enough PC’s) or java (if Sun can get java installed on enough PC’s and fix the webstart bugs that make it unusable for most commercial companies), because it saves dev time - but the major cost with casual and web games isn’t dev time or code quality, it’s game-polishing and marketing, so it’s just not where people are concentrating their effort right now.

Which are these ?

  1. Using cached version when there are updated files uploaded
  2. Appearantly random crashes, AKA “it worked the second time”
  1. Apps looking like they’ve crashed because the broken desktop intergration has opened a pop-under blocking dialog.

Ah ok, Thanks.

I know this one ;D Tiltilation works half the time at home ^^

But tell me how complicated it is to do an open-source replacement of WebStart ? Does it require some tricks only available to the big bad sun ? ;D

[quote="<MagicSpark.org [ BlueSky ]>,post:11,topic:28032"]
But tell me how complicated it is to do an open-source replacement of WebStart ? Does it require some tricks only available to the big bad sun ? ;D
[/quote]
I believe those already exist, I’ve seen at least one on sourcefourge. However the main draw with webstart is that it’s pre-installed. If you’re going to get the user to download and install a custom webstart then why not skip the middleman and just download and install the app directly?

I believe those already exist, I’ve seen at least one on sourcefourge. However the main draw with webstart is that it’s pre-installed. If you’re going to get the user to download and install a custom webstart then why not skip the middleman and just download and install the app directly?
[/quote]
I agree with you. I never understood all the noise that was made about Java Web Start… You can simply do the following :

  • You deploy from a web site, from which you detect the platform (like on the Mozilla site) and suggest the right download, YET permitting to download another version if needed
  • The user then have a nice .zip file which he then unpack and find :
    • An .exe file (Win) OR
    • An executable file (*nix)
    • Something else (Mac ^^)
  • Then playing is a (double-)click away !
    The major issue with that is that the user really don’t know where to unpack its zip file… in Program Files ? no it’s not a program, it’s “java” ;D
    However this style of distribution is really simple and efficient. Tiltilation is distributed this way on Linux and it “just works”.
    Otherwise, an installer (IzPack, Install4j) is perfectly viable, too.

(Whoops sorry this is not really in the topic).

The “Something Else” for Mac would be an “Application Bundle”

The thing that Web Start gives you is a system that will auto update and auto select the appropriate version of Java. Though I’ve rarely seen issues with running things on the latest Java release, sometimes you just want the security of running on the same version that you’ve tested on.

Java Web Start is only good for very simply things though… It’s not quite what client-side developers want it to be in my opinion. It’s more like an applet cache that can do applications too.

But you are right when you say a simple ZIP file will do the trick in most cases. Just pack everything neatly in a folder so that the application remains somewhat self-contained when unzipped. You can always put some logic into your code to check JRE versions and stuff if you need to. Or you can zip up a JRE with the app - which sort of sucks and is the main reason that Web Start could be better… if only developers had more control of the application install.

The main benefit of java webstart for games developers is the callback to get updates - for online games designers this is has got to be a boon. I think thats pretty useful - though writing your own updater (or using one posted in Shared Code) isn’t really that tricky.

If you’re obsessed with using the latest and greatest VM then the ability of java webstart to get the user the next VM is useful - but they of course had to get through the initial java download/install in the first place.

JNLP as a tech is pretty nice - Webstart as an implementation is the problem.

Kev

IMHO the best thing about webstart is that apps start to behave closer to a native app - just a single click to launch, no messing around with zip files (which most users don’t know what to do with), no messing with installers (that work, but are an extra few clicks) and no getting the user to run a .jar (which may have had it’s extension pinched by winzip or winrar anyway).

However as Kev said the current implementation is pretty bad. Theres a whole load of bugs, and users just don’t know where to find the app when they run it again (app / applet cache is a pretty good summary of the current state of play).

I’m toying with the idea of a webstart ‘installer’ - a webstart app which does little more than prompt the user for an install dir and copy the app into it. You still need a JRE + webstart, but it makes the whole thing a little closer to a native app (probably with a .exe stub for windows users too). You’d loose the auto update for the app itself, but you could always use an existing 3rd party lib for that.

Star wars galaxies is a good example of a java Game.

Is it pure java?

In that … it’s not written in Java?

Seriously.

It’s a funny thing to hear these things. But tiresome.

[quote]- Speed of execution: I know that Java is certainly catching up in terms of speed.
[/quote]
Why do people always focus on speed? Speed is so trivial compared to other factors, such as: reliability, standardization, orthogonality, writability and readability.

C++ does poorly in all those categories I mentioned.

If speed was really so important we would all be writing in assembly today, but you know what, speed is not a big factor when it comes to application performance!

And even so, Java is performing nearly as good as C++ anyway. I’ve seen some benchmark comparisons, and they are all promising for Java.

So, why would ANYONE choose a language that performs worse in all categories, except maybe one where the differences are so trivial it doesn’t matter?