Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Applet FAQ  (Read 13425 times)
0 Members and 1 Guest are viewing this topic.
Offline Wiki Duke

?





« Posted 2009-04-25 15:08:55 »

I think an applet FAQ would be awesome.  It would be great also to have a section just dedicated to applets as their a lot of special considerations like bugs, tutorials, sizes, offline testing, focus.   It seems like java for games could really take off by taking some of the flash market share.   

As a beginner here are a list of the questions I have.  I've answered what I've could, but I'm sure there are a ton more. 


Flash v Java:  advantages and disadvantages?

Warning!  Reading this part might be a bit depressing, depending on your current time investment of Java.  Flash is the king of the browser game market despite being proprietary and not as flavorful, smooth as Java.

<a href="http://www.java-gaming.org/topics/they-re-moving-to-flash-here-s-why/19373/view.html">http://www.java-gaming.org/topics/they-re-moving-to-flash-here-s-why/19373/view.html</a>

Browser Penetration:  (Portability of Java is practically meaningless by looking at this stat)
http://www.statowl.com/java.php  Penetration: 54% with 1.6 + 19% with 1.5. Total 73%.
http://www.statowl.com/flash.php  Penetration: 54% with 9.  + 40 with 10.  Total 94%

On a positive side, Java is going to allow you to move toward bigger and more complex games.   

What size should my applet be?

According to this <a href="http://www.hobo-web.co.uk/tips/25.htm">site</a>, the most common browsing resolution as of March 2009 is 1024x768.   I used Photoshop on Windows XP to measure the maximum available browsing height with tabs and task bar up:  On Firefox I only had 535 pixels.   (Width seems mostly irrelevant.)

According to the flash discussion <a href="http://www.triquitips.com/viewtopic.php?f=25&t=617>here</a>, 640x480 seems to be the preference.  Of course with vector graphics, flash may have more flexibility.   

According to this <a href="https://www.mochiads.com/community/forum/topic/portals-and-game-sizes-list-of-portals-max-size>discussion</a> that lists several flash portals, 640x480 is the max for a few but many go much larger.  Width doesn't seem to be much of an issue, often set at 800.

Beware of large file sizes as it will hurt performance.

Why is the size of the applet important?

Try playing this amazing <a href="http://www.rocksolidarcade.com/games/robokill/>game</a> on low resolution like 1024.   

Webstart versus Applet?

Consensus says applet; however both do different things.  Applets should be great for in browser gaming with fast loading and keeping the visitors harddrive clean.   Webstart is great for keeping a game up-to-date and cleaning installing your application.  The full discussion can be found <a href="http://www.java-gaming.org/topics/applet-vs-webstart-what-do-you-prefer-as-a-end-user/20044/view.html>here</a>.


How to double buffer with an applet?

I've found three code samples I like.  It would be wonderful if a Java Guru could chime in on the quality of these.

http://www.naturalprogramming.com/javagui/BeatingHeartApplet.java

http://www.gamedev.net/community/forums/topic.asp?topic_id=405663

http://www.gamespp.com/java/gameProgrammingTutorial04.html


Which Java game frameworks support applets?

<a href="http://slick.cokeandcode.com/"> Slick </a>
<a href="http://lwjgl.org/">LWJGL</a>
<a href="http://www.interactivepulp.com/pulpcore/">PulpCore</a>
<a href="http://dzzd.net/">3DzzD</a>
<a href="http://www.goldenstudios.or.id/products/GTGE/">GTGE</a>
http://www.jpct.net/forum2/topics/aplha-and-performance/1247/view.html
JOGL --> Unknown.
(any others?)

How do I test my applet offline?

<a href="http://en.wikipedia.org/wiki/AppletViewer">AppletViewer</a>



In an IDE, just add it to a frame.  Something like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
 public static void main(String[] args) {
        SampleApplet applet = new SampleApplet();
        Frame frame = new Frame();
        frame.addWindowListener(new WindowAdapter()
        {
          public void windowClosing(WindowEvent e)
          {
            System.exit(0);
          }
        });

        frame.add(applet);
        frame.setSize(800,600);
        frame.show();
        applet.init();
        applet.start();
    }



In a browser,  for a single class,

1  
<applet code="SampleApplet.class" width="800" height="600"></applet>



In a browser, from a Jar:

1  
<applet code="SampleApplet.class" archive="SampleJar.jar" width="800" height="600"></applet>


How to add files (images and sound) to a JAR?

In NetBeans, right click on the project.   Select properties.   Select the category named "Sources."   Click "Add Folder" under the Source Package Folder Section.   Select your directories.  The default is *.*.   Hit okay. 

How to load files (images and sound) from a URL?

(need help)

How to load files (images and sound) from a jar on a URL?

(need help)

How to setup your code to load from a hard drive or URL?

(need help)

What is the best sound player for uncompressed files?

Use AudioClip.   Clip seems to be buggy. 


What is the best sound player for compressed files like Ogg and MP3?

(need help)
How do I add my own art to the Java Loading screen?

https://jdk6.dev.java.net/plugin2/#LOADING_SCREEN


How can I drive traffic to my game?

<a href="http://jayisgames.com/>http://jayisgames.com/</a>
<a href="http://www.123spill.no/>http://www.123spill.no/</a>
<a href="http://www.javagametome.com">http://www.javagametome.com</a> 
<a href="http://digg.com/">http://digg.com/</a>
http://www.greatgamesexperiment.com/games/


Where can I attempt to sell my game to a portal?

http://www.heavygames.com/
http://www.freearcade.com/
http://www.miniclip.com/
http://www.arcadepod.com/java/

Not interested in money, just want to get the game out there to be played.

<a href="http://gamejolt.com">http://gamejolt.com</a>
http://www.jars.com/
http://www.javashareware.com/


What are the know bugs?

Mac users have a tough time with 1.6.

Is there an explanation of the major browser crash bug?  I know David Brackeen's framework resolves this but his code was a bit over my head.   


What is the difference between Applet and JApplet?  Which to use?

On person says, Applet is the HeavyWeight component, just use Applet everywhere and forget about JApplet.

However, when I use a canvas for double buffer and use Applet, I get a nasty 8 pixel bar along the top of my application.   JApplet does not have this issue.


Has Oracle's purchase of Sun doomed Java Games?

http://www.java-gaming.org/topics/oracle-buying-sun/20314/view.html

How to write to a server for things like high scores, save data, etc?

This allows folks to communicate with perl etc on the server side.

http://www.javaworld.com/javatips/jw-javatip34.html










This wiki entry has had -1 revisions with contributions from 0 members. (more info)
Offline SimonH
« Reply #1 - Posted 2009-04-25 15:18:32 »

I think an applet FAQ would be awesome
I agree!

In a browser, from a Jar:
1  
<applet code="SampleApplet.class" archive="SampleJar.jar" width="800" height="600"></applet>

People make games and games make people
Offline DzzD
« Reply #2 - Posted 2009-04-25 16:19:45 »

good idea Smiley

Quote
What is the difference between Applet and JApplet?  Which to use?

Applet is the HeavyWeight component, just use Applet everywhere and forget about JApplet


Quote
Which Java game frameworks support applets?
Hey what about 3DzzD ! Tongue (work everywhere Java 1.1)


Quote
How do I test my applet offline?
AppletViewer


Quote
What size should my applet be?
you can in some case have performance issue with a too big Applet

Quote
Webstart versus Applet?
as I am an Applet addict I will say that Webstart just sucks ... forget and use Applet


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SunshineKiller

Junior Member





« Reply #3 - Posted 2009-04-25 17:30:18 »

Quote
Sending a HTTP POST

http://www.javaworld.com/javatips/jw-javatip34.html

<b>Check out my Development Blog:</b> <a href="http://www.scottscreations.com">Scotts Creations</a> | <b>Games in Development: </b> <a href="http://mechwarfare.scottscreations.com">Mech Warfare</a> | Mech Warfare: Facebook Edition | Game Master
Offline Darrin

Junior Member


Projects: 1



« Reply #4 - Posted 2009-04-25 17:48:19 »


hiya, thanks for posting.   Could you tell me what types of things this is used for?   highscore writing? 

Offline SunshineKiller

Junior Member





« Reply #5 - Posted 2009-04-25 18:22:43 »

hiya, thanks for posting.   Could you tell me what types of things this is used for?   highscore writing? 
o yeah, its nice to know because of sending stuff to say a php script that then posts to a database. Wink so yes highscore writing, player data saving etc... jit allows a server-side php/perl/script to receive data from the applet.

<b>Check out my Development Blog:</b> <a href="http://www.scottscreations.com">Scotts Creations</a> | <b>Games in Development: </b> <a href="http://mechwarfare.scottscreations.com">Mech Warfare</a> | Mech Warfare: Facebook Edition | Game Master
Offline steveyO
« Reply #6 - Posted 2009-04-25 19:38:15 »


Quote
Which Java game frameworks support applets?
GTGE too.  Very easy to create applets, have made about 7-8 with no problems.

Quite a lot of the other questions would depend on the framework used.  For example, using GTGE to play a .wav I use playSound, playMusic for Midi, without using a framework would load an AudioClip (wth main class extending Applet). 

Offline testing still use a browser (Firefox mainly). 


https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline Hsaka
« Reply #7 - Posted 2009-04-25 22:04:37 »

Quote
Which Java game frameworks support applets?

jPCT also. http://www.jpct.net/forum2/topics/aplha-and-performance/1247/view.html
Offline DzzD
« Reply #8 - Posted 2009-04-26 23:03:17 »

here are some severals free sounds :
http://www.pacdv.com/sounds/voices-2.html

Offline SunshineKiller

Junior Member





« Reply #9 - Posted 2009-04-27 04:23:44 »

http://ebiz.u-aizu.ac.jp/~paikic/lecture/2005-1/handout/Chap13.pdf

sorta covers a little of everything on applets.

<b>Check out my Development Blog:</b> <a href="http://www.scottscreations.com">Scotts Creations</a> | <b>Games in Development: </b> <a href="http://mechwarfare.scottscreations.com">Mech Warfare</a> | Mech Warfare: Facebook Edition | Game Master
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline markmistry

Junior Member





« Reply #10 - Posted 2009-05-17 03:52:16 »

GTGE also supports .mp3 thats what i currently use. I have a question regarding applets soon my game will cross the 10mb threshold should this be a concern regarding actually playing the game once loaded?
When the game is finally finished i intend to share the client and .bat file to run it as an app as a torrent(can you get a mac and linux version of a .bat ? please message me if you can  Grin).
I keep hearing about mysql/php/applet whats wrong with mysql/java application on serverside/applet ?
I can put  highscore data directly onto the applet (if i could find away of actually calculating what decides who goes on top any one help here?).
Offline Mr_Light

Senior Member




shiny.


« Reply #11 - Posted 2009-05-21 17:54:46 »

I haven't done stuff with applets for ages but isn't the whole automatic prompt for installation a good thing? as flash has? Wasn't there some way to nest embedded object and applet together that it works in all browsers and if running firefox or IE automatic installation of the plugin?

since it's seems to be still in the docs, just using applet tag doesn't get you that, some hints here:
http://java.sun.com/javase/6/docs/technotes/guides/jweb/applet/applet_deployment.html

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline steveyO
« Reply #12 - Posted 2009-05-21 20:07:18 »

Quote
I keep hearing about mysql/php/applet whats wrong with mysql/java application on serverside/applet ?
Nothing wrong, guess the issue is more people have php supported hosting than java server hosting (as until recently been loads cheaper!).

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline markmistry

Junior Member





« Reply #13 - Posted 2009-05-21 21:06:39 »

I was refering to the fact of having to learn another language.I suppose i didnt see it from the side of whats being provided by the host server machine.
Offline Darrin

Junior Member


Projects: 1



« Reply #14 - Posted 2009-05-22 22:07:50 »

I have a question regarding applets soon my game will cross the 10mb threshold should this be a concern regarding actually playing the game once loaded?

I would say yes. I'd try to limit it to under 10 for sure, targeting around 5.   Some nice sfx could replace mp3s.   I was finding mp3s take up way too much space.  I did a poll one time and a surprising number of people prefer their own music while playing.  Many turn the sound off all together playing at work and what not. 

Offline Gabrielmelvoin

Innocent Bystander





« Reply #15 - Posted 2009-10-26 02:09:32 »

i would say that the pros definitely make it the best.
Offline adamspencer

Innocent Bystander





« Reply #16 - Posted 2010-02-23 12:05:32 »

what is the difference between Applet and Japplet?
Offline DzzD
« Reply #17 - Posted 2010-02-23 15:38:35 »

what is the difference between Applet and Japplet?
major difference is that Applet works ...

AWT / Swing

Offline Alric

Junior Member


Projects: 1



« Reply #18 - Posted 2010-02-23 15:54:39 »

JME also supports applets.

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #19 - Posted 2010-02-23 17:08:18 »

major difference is that Applet works ...

AWT / Swing

I wouldnt quite agree Tongue. basically JApplet, is applet with a few extra bells and whistels. I mean it even EXTENDS it Tongue
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #20 - Posted 2010-02-23 18:52:32 »

I wouldnt quite agree Tongue
You might want to stop disagreeing about stuff you have no experience with whatsoever?

When working with applets, and actually caring about your users, Swing is so darn incompatible and broken among versions, that all that remains is AWT.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #21 - Posted 2010-02-23 18:58:57 »

You might want to stop disagreeing about stuff you have no experience with whatsoever?

When working with applets, and actually caring about your users, Swing is so darn incompatible and broken among versions, that all that remains is AWT.
whats your deal?

anyways.... the reason I said *quite* is because JApplet can do anything that applet can do....

and why do you assume I dont have any experience, do you stalk me?
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #22 - Posted 2010-02-23 19:05:42 »

I maybe shouldn't but here we go:


major difference is that Applet works ...

AWT / Swing
Isn't this a clear indication that JApplet has problems?

I even explained it to you:
When working with applets, and actually caring about your users, Swing is so darn incompatible and broken among versions, that all that remains is AWT.
Still you seem quite confident that 'JApplet is just Applet with added functionality', while clearly the Sun/reference implementation is totally different, hence why both I and DzzD mentioned how broken JApplet is among Swing versions.

And no, I'm not stalking you, you simply should not 'disagree' without providing *any* backing, just for the sake of it.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline DzzD
« Reply #23 - Posted 2010-02-23 19:06:08 »

whats your deal?

anyways.... the reason I said *quite* is because JApplet can do anything that applet can do....

and why do you assume I dont have any experience, do you stalk me?

from the javadoc
Quote
The JApplet class is slightly incompatible with java.applet.Applet. JApplet contains a JRootPane as it's only child. The contentPane should be the parent of any children of the JApplet. This is different than java.applet.Applet, e.g. to add a child to an an java.applet.Applet you'd write etc...


source here

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #24 - Posted 2010-02-23 19:37:43 »

And no, I'm not stalking you, you simply should not 'disagree' without providing *any* backing, just for the sake of it.
no, I didnt disagree for the sake of it.... and yes, I did have backing up. I said it is extending, and u can argue with that, but you would be WRONG.

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JApplet.html
Offline reiselaender

Junior Newbie





« Reply #25 - Posted 2010-04-04 11:00:18 »

You might want to stop disagreeing about stuff you have no experience with whatsoever?

When working with applets, and actually caring about your users, Swing is so darn incompatible and broken among versions, that all that remains is AWT.


That's right, you have to consider those who will be using whatever it is you're developing.

As for Swing, application debugging can be difficult because of the toolkit's visual nature.


Pages: [1]
  ignore  |  Print  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

pw (18 views)
2014-07-24 01:59:36

Riven (17 views)
2014-07-23 21:16:32

Riven (14 views)
2014-07-23 21:07:15

Riven (17 views)
2014-07-23 20:56:16

ctomni231 (45 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!