Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
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  
  Extensibility and webstart...how?  (Read 749 times)
0 Members and 1 Guest are viewing this topic.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Posted 2005-04-01 05:09:46 »

Back to the old problem that Sun made the world's first mainstream dynamically linked language and then people want to .... dynamically discovre and load classes at link time - but java still doesn't support this no-brainer.

I've met someone doiung the classic "make a new classloader, make a custom "load from file" loader in 10 lines of code, and laod classes from a user-specificed directory". Now the question is: how the heck to do this in "Sun sanctioned" ways, i.e. so that it will *work* in webstart?

Off the top of my head, ideas so far are:
1. Make all the downloadable additional classes Extensions. The author then has to manually specify every single one in the webstart JNLP for the app. Off the top of my head ... I think they also have to hard-code a description of each into the app, which is incredibly stupid given what this trying to acheive

2. Make all the dl/classes into standalone apps, that "install" themselves by wrting a child of a known Muffin. Main app scans that muffin on startup to find out what additional classes are "installed". Not sure how it's going to instantiate them at this point...presumably, they advertise themselves in the muffin with their JNLP URL so that the main app can trigger a webstart extension fetch. However, I've never tried doing an extension fetch AFTER the app has started, and given the way sun chose to desgin webstart I'm not entirely sure it's possible?

3. ....other?

malloc will be first against the wall when the revolution comes...
Offline c_lilian

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #1 - Posted 2005-04-01 07:08:04 »

Other alternatives :
- use a URLClassLoader and a servlet to provide class bytes : won't work for unsigned apps, but easy to implement (sources are in the jdk samples).
- use beanshell and java sources ;-)
- use the JNLP Download service to flush local cache and reload new jars (that might have been bebuilt by the server meanwhile) : worth to dig a little more.

Lilian

Offline Alistair_Dickie

Senior Newbie




Java games rock!


« Reply #2 - Posted 2005-04-01 19:51:20 »

I think the place to start is to focus on what I want users and developers writing extensions to be able to do. The basic problem is that developers will write some code and put together some resources as an extension to my game and I need to ensure that this can get to users. I am going to take it as a given that the classes and resources will be packaged into a jar file. This jar file then has to find its way onto the users system and be loaded onto the classpath (not possible as I want users to be able to add extensions after program start), or be loaded via a URLClassLoader.

I think the way I am going to do it is allow the user to specify the directory containing the skins. By default this will either be the skins directory in the program installation path (if it was installed by an installer), or the gamename/skins directory in the "user.home" directory if it is running via JWS. Users can place skins there manually, download them to there via a "skin server" from within the program, or perhaps click on a jnlp link that references the main game jnlp but also includes the skin jar as an additional resource. I have to think more about the latter one.

Regards,

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

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2005-04-02 07:11:38 »

Quote
This jar file then has to find its way onto the users system and be loaded onto the classpath (not possible as I want users to be able to add extensions after program start).


I'm not a fan of this, but ... it IS possible, using a very common technique nowadays, *especially* for skins: download from within the app, then popup a box saying "New skin will not take effect until you restart".

Lots and lots of C++ apps do it these days, rather than try to dynamically load something mid-operation. Even the FPS's have a long tradition of "new skins and mods require you to restart" - even quake3 had you specifying *everything* that was new as command-line args saying which files you wanted to load in.

malloc will be first against the wall when the revolution comes...
Pages: [1]
  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.

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

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

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

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

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

Tekkerue (27 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 (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
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!