Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Pros and Cons of Java  (Read 4920 times)
0 Members and 1 Guest are viewing this topic.
Offline jmcklap0

Junior Newbie





« Posted 2010-11-15 19:24:11 »

Hey everybody,

For a school project i need to make a game thats able to run on websites.

I was thinking of using Flash or Java, but i dont know the pros and cons of Java.

I want to make a good thought out decision of wich software i'm going to use, i hope you can help me with this decision?

Thanks in advance for your time!

J.
Offline JL235

JGO Coder


Medals: 10



« Reply #1 - Posted 2010-11-15 19:35:45 »

The way I see it, with Flash it's much easier to build something to a good standard. With Java it's much more difficult, but is a much better platform for building something to an amazing standard. For example there are plenty of topics around here simply asking on how to get to a stage where you can draw in the Applet.

So IMHO I'd recommend Flash because 1) you should get running with your project in less time and 2) there are lots of little niggling issues you just won't encounter (like if someone with an older version plays your game Flash gives a much better error message).

If you need to write about the technology you've used (to help justify why) then you can also bring up the fact that Flash is used heavily for web games where as Java just isn't (although there are some exceptional examples around online). Adobe also encourage using Flash for web games where as both Oracle (and Sun before them) don't do the same for Java.

But my personal recommendation would be JavaScript + HTML5 Canvas.

Offline CyanPrime
« Reply #2 - Posted 2010-11-15 19:39:21 »

Pros:
Can compile into a executable jar for desktop use.
Cross-platform.
Slick2D is awesome.
Garbage collection is nice.
Better syntax than flash.
Great Client/Server stuff.

Cons:
Doesn't compile into a exe.
Needs the Java JRE to run.
Cross-platform is a little buggy.
Heap can't be auto resized.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jmcklap0

Junior Newbie





« Reply #3 - Posted 2010-11-15 20:02:34 »

Thanks for the (very) quick response! Cheesy

I now have a bit more to go on for my decision, i'll probably go with Flash though.

If you'd look at the programming language, wich one would have the easiest learning curve?

Personally i think actionscript has an easier learning curve than Java, but i dont know for certain.
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #4 - Posted 2010-11-15 20:51:40 »

Pros:
Can compile into a executable jar for desktop use.
Cross-platform.
Slick2D is awesome.
Garbage collection is nice.
Better syntax than flash.
Great Client/Server stuff.

Cons:
Doesn't compile into a exe.
Needs the Java JRE to run.
Cross-platform is a little buggy.
Heap can't be auto resized.

if you were to be so inclined, u could make it into an exe, and you can even bundle the jre with it Tongue.

java rules Cheesy
Offline JL235

JGO Coder


Medals: 10



« Reply #5 - Posted 2010-11-15 22:12:45 »

If you'd look at the programming language, wich one would have the easiest learning curve?
IMHO I wouldn't look at the language, I'd look at the libraries. That's where your real learning curve and issues will be.

Online Mike

JGO Wizard


Medals: 74
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #6 - Posted 2010-11-15 23:04:06 »

It's actually quite sad that even this forum don't believe in Java anymore for web games ;-)

In my opinion:

If you want to do something simple, stick with Flash
If you want to make something client/server based with 3D and so on, go with Java

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline JL235

JGO Coder


Medals: 10



« Reply #7 - Posted 2010-11-16 00:43:32 »

It's actually quite sad that even this forum don't believe in Java anymore for web games ;-)

In my opinion:

If you want to do something simple, stick with Flash
If you want to make something client/server based with 3D and so on, go with Java

Mike
I entirely agree (about not believing in Java). With WebGL and the new 3D support coming in Flash then they will probably become better platforms for web 3D then Java.

But what you write has a far bigger impact then what your using. RuneScape and MineCraft aren't popular because they run on Java; and although I recommended Flash over it Java is still an excellent platform to develop on.

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #8 - Posted 2010-11-16 00:51:53 »

If you are an engineer, use Java.

If you are an artist, use Flash.

F** I hate Flash. It's made for people who don't know how to program.

See my work:
OTC Software
Offline zammbi

JGO Coder


Medals: 4



« Reply #9 - Posted 2010-11-16 07:43:20 »

I would go with what you know most.
But does sound like flash is good for small projects.

Current project - Rename and Sort
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2010-11-16 10:30:31 »

Anyone doing 3D in the browser these days is probably using Unity.

Cas Smiley

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #11 - Posted 2010-11-16 11:43:50 »

>If you want to do something simple, stick with Flash

It's actually even a bit easier with JavaScript/Canvas. The language is tiny, the base lib is tiny, the new APIs are tiny, and all you need is a good editor (like Komodo Edit). That's it.

弾幕 ☆ @mahonnaiseblog
Offline jmcklap0

Junior Newbie





« Reply #12 - Posted 2010-11-16 20:36:41 »

Thanks for all the replies! I really appreciate it!

I'll probably go with Flash after reading all of this, we are planning on making a simple platform type game, wich uses 2D graphics.
I also see that the common opinion is that Flash is good for simple projects (wich mine is Tongue) and Java is more for the complex projects that include client/server communication and/or 3D graphics.

I thank you all for your time and help!

You all really helped me out with making a good decision!

Thanks again! Cheesy
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #13 - Posted 2010-11-16 21:14:05 »

It is slightly sad someone comes to Javagaming.org, the only dedicated site for Java games development on the internets, and we tell him to use some other technology.

What happened there then?

Cas Smiley

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #14 - Posted 2010-11-16 21:26:41 »

Sounds like Flash was the right tool for the problem he wanted to solve, his alternative was to use Java Applets. Do you really think recommending Java Applets in this case was a better choice?
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #15 - Posted 2010-11-16 21:57:04 »

Well, there's the thing... how has this come to pass?

Is it the APIs which are bad?
The language too verbose or hard to learn?
Is deployment too difficult?
Is Java too unreliable?
Is Java penetration so far behind Flash that hardly anyone would get to see it?

Cas Smiley

Offline wondersonic

Senior Newbie





« Reply #16 - Posted 2010-11-16 22:01:05 »

BTW did you take a look at HTML5 and canvas features?

sample: http://www.geek.com/articles/games/html5-platformer-biolab-disaster-proves-flash-has-serious-competition-20100913/
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #17 - Posted 2010-11-16 22:16:43 »

Yes, all brilliant and such, if somewhat missing the point of developing in Java.

Cas Smiley

Online CommanderKeith
« Reply #18 - Posted 2010-11-16 22:33:34 »

Interestingly, <a href="http://www.dynastica.com/publicmenu/screenshots">Dynastica</a> is a game written in C++ (using ogre3D) that <a href="http://www.ogre3d.org/forums/viewtopic.php?f=11&t=60857#p407275">uses java as the launcher!</a>

So maybe java is not so bad in terms of reliability, penetration and deployment...

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #19 - Posted 2010-11-16 23:36:41 »

As a desktop application, Java beats Flash hands down, but since we are talking about the Java Plugin here, due to the requirement of being embedded in a web page and comparing against Flash the situation is very different.

Well, there's the thing... how has this come to pass?
Years of neglect by Sun on clientside Java, at some points in its history the plugin has been unbelievably broken (super slow, crashing browsers, hanging computers, etc) that I'd go as far as to blame it solely for java's widespread tainted image of being slow and bloated. Its been so bad and for so long that most Java developers have given up all hope on java applets, hardly anyone uses the them these days. If Sun had focused on client side Java, they could have easily been where Flash is today (especially considering the head start they had).

Is it the APIs which are bad?
The language too verbose or hard to learn?
Is Java penetration so far behind Flash that hardly anyone would get to see it?
The Java API is pretty good and its easy to learn. Penetration isn't a big issue here as its has plenty of marketshare. Its a little verbose for gui development but its pretty good as a generally purpose language.

Is deployment too difficult?
Is Java too unreliable?
The Plugin has been way too unreliable and you have to jump way too many hoops to even get close to an experience that Flash provides. I've only seen PulpCore come relatively close to providing a flash like experience and even that was some super ninjastic hackage going on under the hood. The situation with the plugin has improved of late but it'll take a while for the damage to be undone and by the looks of it Flash will be way ahead by the time it does.

Its not only that the java plugin has been bad but Flash has been really good at clientside user experience, even though it doesn't provide as much as java it does what it does really well. Secondly the tools and editors for Flash have been excellent, really easy for non programmers (Artists).
Online CommanderKeith
« Reply #20 - Posted 2010-11-17 01:39:31 »

The Plugin has been way too unreliable and you have to jump way too many hoops to even get close to an experience that Flash provides. I've only seen PulpCore come relatively close to providing a flash like experience and even that was some super ninjastic hackage going on under the hood.

Yeah it's ridiculously complicated:
http://www.pulpgames.net/milpa/pulpcore.js

Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #21 - Posted 2010-11-17 02:18:22 »


It's quite nice.

Personally, though, I'd never put a serious effort into making a *serious* game in HTML5. Think about it. It's limited to running in browsers, the source code is readily available by simply doing view-source in the browser, and future-proofing your game will be a nightmare as years go by since browsers are continuously changing.

With Java you're not limited by where you run your game, application or applet. The code is a lot safer. And if you bundle your application in a EXE+JRE you're safer the game will run 10 years from now.

HTML5 is fine for most flash games out there, smallish web games, and that's really where the fight will take place, between flash and html5. Java will be on the sidelines, pretty much unaffected, because if flash hasn't already wiped java out by now, html5 won't either.

I do wonder about the portability of html5 games/apps. I guess there's no single embeddable package file, it's all just html and javascript, that depends on the environment where it was loaded from? Flash has the advantage of being easily distributable and embeddable anywhere.



Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #22 - Posted 2010-11-17 02:23:14 »


Btw. before posting screenshots/videos of your browser, be sure to clear out the Google searchbox in the browser Wink

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #23 - Posted 2010-11-17 04:51:51 »

Personally, though, I'd never put a serious effort into making a *serious* game in HTML5. Think about it. It's limited to running in browsers, the source code is readily available by simply doing view-source in the browser, and future-proofing your game will be a nightmare as years go by since browsers are continuously changing.

It's not limited to running in browsers. All you need is a JS engine, a Canvas/Audio/input implementation, and a little bit of wrapper code. The guy who made Biolab also wrote such a thing (it's OpenGL accelerated and runs on iPhone). And of course there are other easier options like PhoneGap or XULRunner, which basically just turn some website into a stand-alone application.

If the code is minified it's about as "save" as minified Java code. Not having to run it through a decompiler first doesn't really change much. Actually, this step is replaced with running it through a formatter.

It's the same thing, really.

I do wonder about the portability of html5 games/apps. I guess there's no single embeddable package file, it's all just html and javascript, that depends on the environment where it was loaded from? Flash has the advantage of being easily distributable and embeddable anywhere.

The bare minimum is one script file and one resource file. But usually there will be at least 2 resource files. One which contains everything with audio as Ogg/Vorbis and another one which contains everything with Audio as MP3 (or AAC). The former is for every browser and the latter is for bloody Safari and f-ing IE9. Depending on the browsers capabilities one of those files will be downloaded.

The script file can be bootstrapping + game code or just bootstrapping (and the game code is in the resource file).

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #24 - Posted 2010-11-17 04:58:55 »

Btw. before posting screenshots/videos of your browser, be sure to clear out the Google searchbox in the browser Wink

Actually, it's the other way around. Put there some crap on purpose to get more views, comments, and publicity.

For bonus points open some extra tabs and run something like this:

1  
javascript:document.title='filthy%20stuff';void(0)


to create some ominous looking tabs.

So, yea. It's just some kind of guerrilla marketing. But it still works pretty well. I highly recommend it. Wink

弾幕 ☆ @mahonnaiseblog
Offline jezek2
« Reply #25 - Posted 2010-11-17 08:42:12 »

PulpCore is really great, both in API, design process and deployment (does half the job of Java Applet system). But still I had issues when I loaded the same applet in two tabs at once (in old applet system before 6u10+). I suppose now you could use the separate_jvm option in new applet system (now it's probably much more widespread) and everything would work well Smiley

I also recently looked at javafx.com and looked much more functional than before, they're even not afraid to use JavaFX applet to select the demos (previously they used some DHTML crap).
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #26 - Posted 2010-11-17 09:53:47 »

Mind you Apple have done their level best to completely break applets anyway. Grr.

What, realistically, is the performance difference between Java 6 and the fastest JS engines out there at raw compute power and memory writes?

Cas Smiley

Offline jezek2
« Reply #27 - Posted 2010-11-17 10:41:12 »

What, realistically, is the performance difference between Java 6 and the fastest JS engines out there at raw compute power and memory writes?

Dunno about realistically, but for at least some comparison look here, compare V8 with Java6 -server. Sadly there is no Java6 -client (but that's probably not much relevant these days). The difference is still very big and I doubt it will be comparable to Java because of the dynamic nature of Javascript language.
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #28 - Posted 2010-11-17 11:03:11 »

It's not limited to running in browsers. All you need is a JS engine, a Canvas/Audio/input implementation, and a little bit of wrapper code. The guy who made Biolab also wrote such a thing (it's OpenGL accelerated and runs on iPhone). And of course there are other easier options like PhoneGap or XULRunner, which basically just turn some website into a stand-alone application.

If the code is minified it's about as "save" as minified Java code. Not having to run it through a decompiler first doesn't really change much. Actually, this step is replaced with running it through a formatter.

It's the same thing, really.

The bare minimum is one script file and one resource file. But usually there will be at least 2 resource files. One which contains everything with audio as Ogg/Vorbis and another one which contains everything with Audio as MP3 (or AAC). The former is for every browser and the latter is for bloody Safari and f-ing IE9. Depending on the browsers capabilities one of those files will be downloaded.

The script file can be bootstrapping + game code or just bootstrapping (and the game code is in the resource file).

It can be a pain to get javascript code to work the same in different browsers, let alone on totally different platforms. There will always be those hacks to get around variations between browsers, e.g. if(ie) { ... } else if(firefox) { ...}.

I've written a lot of javascript code for two different legacy set-top-boxes, who supposedly have the exactly same browser, but there are plenty minor differences that matter a lot. For instance, one box can run anonymous functions in a timer, the other cannot. One cannot handle a long integer, the other can, so if you were to use timestamps in milliseconds, you'd be out of luck on one of the boxes.
I've written a GUI platform in javascript that works great in Firefox, but I'd need months to get it working in Internet Explorer.

But perhaps that is all worth it. Javascript is pretty portable considering. It's the most used and widespread programming language out there.

After writing it for 5 years, I still hate how bad the OOP support is. It's like they've gone out of their way to not evolve javascript. It was never intended to be used so much, but it's #1 out there, it was supposed to be used as a "helper" scripting language for forms and stuff, and therefore doesn't even have basic OOP support. I'd really like to have classes, abstract classes, inheritence, polymorphism. I know you can simulate a lot of this stuff, but it just doesn't feel right.



Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Online princec

JGO Kernel


Medals: 364
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #29 - Posted 2010-11-17 11:08:21 »

Hm I still wonder why no-one's just made (experimentally) a browser that simply executes Java code instead of Javascript.

I see the benchmarks put Java at roughly 10x faster than Javascript which means I won't be making Revenge of the Titans any time soon in JS. I'm already trying to figure out a way of using more than one core to get more performance out of it (just to achieve 60fps)

Cas Smiley

Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (28 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!