Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  
  Plugin system / usability  (Read 2198 times)
0 Members and 1 Guest are viewing this topic.
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Posted 2004-09-01 08:11:22 »

Hi
 I've just had a reasonable length phone all with KevGlass, and one of the things we discussed is why JInput doesn't seem to be used much. Kevs opinion is that one reason might be the plugin system that seems to cause so many people so much problem. I really like the flexability it provides, but can see how developers working on games don't want to spend ages trying and failing to get it working.
 One solution that we came up with I quite liked. The plugin loader in JInput is modified so if it finds no plugins, it loads (as a ClassLoader.getSystemResource call) a file, something like defaultPlugin. This file contains the string name of the plugin to load. There is a copy of this file in each plugin src folder, and on compiling JInput as well as the current files, one jar for *each* plugin, that contains not only the plugin code, but the jinput core jar contents and the jutils core contents and that file. So a dev on say windows only needs the jinput-dx8.jar and the native library. If more plugins on a particular platform are required, the dev will probably research the plugins system, which will still be the first approach take in the plugin loading code.
 This leaves us with the flexability we have, but adds the simplisity that *most* games devs will be looking for. That combined with the new static Identifiers should make JInput a much more tempting option.

Comments/questions?

Endolf

Offline kevglass

« JGO Spiffy Duke »


Medals: 195
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2004-09-01 08:24:00 »

Also, I'd really like to validate the assumption that no one is using JInput... are there loads of people out there using it that are just very quiet?

Kev

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #2 - Posted 2004-09-01 08:31:26 »

There are simply not enough bug reports for people to have actually tried it Smiley

Endolf

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

Junior Devvie




in code we trust


« Reply #3 - Posted 2004-09-01 10:05:05 »

Well, I use it for mouse input, so thats 1 person at least Wink

// Gregof
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #4 - Posted 2004-09-01 19:58:13 »

I am using it for everything except mouse-style input devices in freefodder.dev.java.net . By default it uses an AWT based input system. That kills gamepad coolness but works everywhere. See the project page for details setting up JInput support in the game.

Did I mention that I had written my own version of the Linux based plugin for this game ...

Bug report: Well, I am not sure but there seems to be a problem with JInput in combination with LWJGL on Windows: The keyboard does not return any poll data (always 0.0f). ATM I am not sure whether this might be a problem on my side. If someone has some spare time he/she might write a little app that controls something in a LWJGL window with JInput.


cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #5 - Posted 2004-09-02 05:36:16 »

That smells like the cooperative level setting in direct input. My guess is they are stealing the k/b. I *might* be able to sort that in jinput, but some interaction with the LWJGL guys might be needed. I'll have to have a play at some point.
Can you raise that as an issue in the issue tracker?

Thanks

Endolf

Offline elias

Senior Devvie





« Reply #6 - Posted 2004-09-02 17:18:32 »

Which cooperative level is needed? In src/native/win32/org_lwjgl_input_Keyboard.cpp we have:

lpdiKeyboard->SetCooperativeLevel(getCurrentHWND(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND)

- elias

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #7 - Posted 2004-09-03 09:19:39 »

Hmm,
 JInput is using NONEXCLUSIVE BACKGROUND, but as they are both non exclusive it shouldn't be an issue. I think I need to get hold of LWJGL and test this. For force feedback stuff JInput tries to get exclusive mode, but still background. I have also remembered that the dummy window is needed for changing the cooprative mode. Also for getting things like joystick recalibration events etc.

Endolf

Offline VGR

Innocent Bystander





« Reply #8 - Posted 2005-02-04 10:38:11 »

I found the plugin system difficult to use.  I see from the source that the PluginLoader class is supposed to find the native library in the same directory as the jar, but it didn't seem to work.  Worse, I didn't get any sort of error or message or anything on standard output or standard error about the failure.  (I think I may have been using an older version, since the 1.1.0 source appears to have fixed that.)

Now that I've looked at the source and discovered what I need to do, I'm not too happy with the steps required to use it.  I sure wouldn't expect users to set up such things.

I'd like to suggest making use of Java's own "SPI Jar" specification:

http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider

Pretty short read, isn't it?  It does everything the Plugins class does, and it's a Sun standard that's already used by New I/O, XML parsing, sound, Image I/O, and input methods.  I've used it in projects both at work and at home, and it works quite well.

The easiest way to use it is with the javax.imageio.spi.ServiceRegistry class, which despite its package works with any SPI jar.  (There's also a sun.misc.Service class, but relying on an undocumented sun.* class is not wise.)

One thing the Plugins package does which SPI jar doesn't do, is provide a ClassLoader that can find a native library which is simply in the same directory as a jar file.  While I understand the reason for that functionality, I can't help feeling like that's the job of the installation process:  put jinput.jar and linux-jinput.jar (or whatever) in ${java.home}/lib/ext, put the native library in ${java.home}/lib/${os.arch}, and if we're using the SPI jar approach, there's no more setup to do.  No system properties, no extra classpath.  Developers would still use ControllerEnvironment.getDefaultEnvironment().

Offline Jeff

JGO Coder




Got any cats?


« Reply #9 - Posted 2005-04-17 05:51:53 »

HI,

So if you guys want to replace the plug-in system, Im not offended even though I'm its origianl author.  It was actually a repalcement for the ORIGINAL plug-in system Mike Martak wrote, which you guys never saw, and which required manually modifying a config file.  

Do whatever works best for you.  Not every idea Ive ever had is a winner and the great thing about open soruce is you get many minds on a problem.

Let me explain the reasoing though behind the support for a nested file structure in the controller directory and the association of the jar to the plug in isharing the same folder.  Thsi was done to solve the problem when two different independant plug-in developers call their dll "input.dll" Smiley  If they all had to live in the same folder then you wouls have an unresolvable incompatability.  The sub-folder system was designed to solve for that.

Now, maybe I was over-engineering, but I wanted to at last make sure everyone udnerstood the original motivation.

Persoanlly, I rather dislike the SPI system.  I like "drop it in place and forget it" plug in systems and find manifest munging an annoyance. But thats just personal taste Smiley

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #10 - Posted 2005-04-17 05:54:51 »

Quote
I found the plugin system difficult to use.  I see from the source that the PluginLoader class is supposed to find the native library in the same directory as the jar,



btw. This worked in original release. AFAIK it still does.  If you have a good test case that shows that it doesnt maybe you shouls zip it up anmd send it to me so I can  look at it.



Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

trollwarrior1 (33 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (65 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!