Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (860)
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  (Read 1485 times)
0 Members and 1 Guest are viewing this topic.
Offline blahblahblahh

JGO Coder

Medals: 1

« 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 Devvie

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.


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.


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

JGO Coder

Medals: 1

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

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  

hadezbladez (2127 views)
2018-11-16 13:46:03

hadezbladez (807 views)
2018-11-16 13:41:33

hadezbladez (2099 views)
2018-11-16 13:35:35

hadezbladez (415 views)
2018-11-16 13:32:03

EgonOlsen (3451 views)
2018-06-10 19:43:48

EgonOlsen (3680 views)
2018-06-10 19:43:44

EgonOlsen (2272 views)
2018-06-10 19:43:20

DesertCoockie (3002 views)
2018-05-13 18:23:11

nelsongames (3072 views)
2018-04-24 18:15:36

nelsongames (3852 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 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‑
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!