 |
Slick Forums Discuss the Slick 2D Library
|
| View previous topic :: View next topic |
| Author |
Message |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Fri Feb 06, 2009 11:51 pm Post subject: TASK: Slick as an Eclipse Plugin (get it on slick site) |
|
|
It would be nice if Slick would be bundled as an Eclipse plugin (and an update site), besides the current release form. If you think it's a good idea, I'm willing to do the initial work myself, and maybe look at how it could be integrated into the build (I haven't looked at Slick's build system, yet).
Why this should be done, IMHO, is because it opens the door for:
1) easier development environment setup:
Install the plug-in into Eclipse (once)
For each Slick project you create, select "Add Library", then "Slick Library"
It will have source and natives attached
Now you simply write your classes and click "Run as Java application" and no further configuration is needed.
2) creation of a "New Slick Project" Wizard
it would create a java project with all the libraries attached, and some basic game classes (perhaps it could have several templates for different game types).
3) Eclipse based tools that require Slick
I've been thinking about porting the Pedigree particle editor to Eclipse, some time in the future, if I have time I hate navigating those open file dialogs
LWJGL has recently done this, the library can now be installed into Eclipse from http://www.lwjgl.org/update/ . What they provide right now is mainly useful for Eclipse plug-in development, but they are also adding LWJGL as a library for standalone java applications.
here's a blog post about it: http://jevopisdeveloperblog.blogspot.com/2008/12/lwjgl-plugin-at-lwjglorg.html |
|
| Back to top |
|
 |
kevglass Site Admin

Joined: 01 Jan 1970 Posts: 2851
|
Posted: Sat Feb 07, 2009 9:40 am Post subject: |
|
|
Sounds reasonable, though you shouldn't need any changes to the Slick build system to do it. You could just use the slick binary as a library in the plugin.
Kev _________________ Coke and Code - Java Games, Development and Life |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Sat Feb 07, 2009 3:37 pm Post subject: |
|
|
Ok, my first attempt is up, here's how it works:
http://villane.org/slick/update/
In Eclipse, select Help -> Software Updates -> Add Site -> http://villane.org/slick/update/
Unfortunately, then you also have to go to Manage Sites and check the LWJGL site: http://lwjgl.org/update/ I don't know how to make this automatic.
Then select Slick Library from the Slick site and LWJGL from the LWJGL site (the latter should also be added automatically if you don't select it).
Click Install, and the libraries will be installed into your eclipse plugins folder. Now if you were to make an Plug-in/OSGi project, you can add slick to dependencies and the sources are already attached.
-----
I assume you would want this site to be moved to http://slick.cokeandcode.com/update/ or something like that eventually?
Some notes:
I used the package names for bundle and feature names, maybe com.cokeandcode.slick would be preferrable?
Since Slick doesn't have a version number, I used 1.0.0.b239
Plugin provider name: slick.cokeandcode.com <- is this ok or do you want something else?
This plugin currently doesn't include a library definition for standalone Java Apps, it simply bundles the slick.jar and sources as plug-ins. I will work on that tonight or tomorrow. |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Sat Feb 07, 2009 7:15 pm Post subject: |
|
|
Ok, I got the plain Java library somewhat working now.
WARNING: it is buggy as of now, and for some reason the library doesn't show up properly until you restart Eclipse (but seems to work anyway).
WARNING: the natives are only attached on Windows as of now, I'll fix it soon.
But in case you want to try the early version, install "Slick Library for Java Development Tools" from the same update site: http://villane.org/slick/update/
It requires the "LWJGL Feature" and "Slick Library" I mentioned earlier.
Now, create a Java Project, then "Configure Build Path" -> "Add Library" -> "Slick Library"
Write your game classes, and "Run as Java Application". Should work.
Oh, and if you noticed, then sources for Slick & LWJGL are automatically attached  |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Sun Feb 08, 2009 12:05 am Post subject: |
|
|
Fixed the two biggest problems:
* now it is initialized properly
* now it supports all OS-es that the LWJGL plugin provides natives for: macosx, win32, linux, solaris
There may still be bugs, but I'm not aware of any. For future features I am thinking of:
* selecting optional components (Ogg, FMOD etc.)
* attaching JavaDoc, although Eclipse provides inline JavaDoc from the source just as well as far as I know. Still, link to the online doc might be useful.
* selecting different versions of Slick/LWJGL (does anyone want this or is one version per Eclipse installation enough?) |
|
| Back to top |
|
 |
Gornova81 Oldbie
Joined: 02 Apr 2008 Posts: 498 Location: Italy
|
Posted: Mon Feb 09, 2009 8:22 am Post subject: |
|
|
cool ideaaaa!
i really like it and little note to kev: if Villane idea works right, i suggest to you to make eclipse plugin and update site in front of your site, what do you think?
i'm also thinking if is possibile to connect some little tool (hiero? tiled?) as extension usefull to work with slick? (or maybe slick fx, or so on..) |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Mon Feb 09, 2009 5:26 pm Post subject: |
|
|
| Gornova81 wrote: | | i'm also thinking if is possibile to connect some little tool (hiero? tiled?) as extension usefull to work with slick? (or maybe slick fx, or so on..) |
I hadn't thought of that, but yes, it might be possible to make those tools launchable easily through Eclipse (without porting them to SWT). There are a few different approaches here, I'll see if I can do one easily.
Also, I think the next thing I'll implement is a "New Slick Game" Wizard, but I'm not sure how much code that requires so it might take some time. If the basic tools like that are in place, I'm sure we could get some people from Eclipse community to start experimenting with writing games with Slick My blog (villane.wordpress.com) is aggregated on PlanetEclipse so I'll write a post about this when it's complete. |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Mon Feb 09, 2009 9:36 pm Post subject: |
|
|
Added the tools (as a new feature in the update site: Slick Development Tools)
What it does currently: lets you launch the 4 included tools (Hiero,Scalar,Pedigree,Pack-U-Like) from an Eclipse menu, setting their current working directory to whatever you had selected. Note: I didn't add sources for the tools, should I?
[/img] |
|
| Back to top |
|
 |
manunderground Oldbie
Joined: 17 Jun 2008 Posts: 336
|
Posted: Mon Feb 09, 2009 10:21 pm Post subject: |
|
|
This is really exciting stuff, keep it up!
Here are some other cool ideas:
* Provide an export function to export a runnable jar which is ready for distribution
* Provide an export function to export as a webstart which is ready for upload to a server
I definitely think the wizard you touched on above would be great too. Ideally it would create the BasicGame/BasicStateBasedGame plus a main class to run things? _________________ My website about game development http://anotherearlymorning.com |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Mon Feb 09, 2009 11:45 pm Post subject: |
|
|
| manunderground wrote: | This is really exciting stuff, keep it up!
Here are some other cool ideas:
* Provide an export function to export a runnable jar which is ready for distribution
* Provide an export function to export as a webstart which is ready for upload to a server |
Good ideas. I'll take a look at that later this week. How would you do the runnable jar when you need native code (-Djava.library.path=...) though? There's probably a way, I'm just not aware. There are some native launchers for java out there, I could take a look at those.
| manunderground wrote: | | I definitely think the wizard you touched on above would be great too. Ideally it would create the BasicGame/BasicStateBasedGame plus a main class to run things? |
Yep, I'm thinking of providing several templates for the basic structure (similar to the Eclipse plug-in templates) so you could create either a basic or state based game.
NOTE: I just realized something. The latest Slick distribution doesn't use LWJGL 2.0.1 (I'm not aware which one it uses), but I used 2.0.1 for the plugin (that's the first version available from their Eclipse update site). This doesn't seem to work that well -- I'm not getting any sound with HW acceleration turned on. I'll think of something tomorrow. |
|
| Back to top |
|
 |
Gornova81 Oldbie
Joined: 02 Apr 2008 Posts: 498 Location: Italy
|
Posted: Tue Feb 10, 2009 9:55 am Post subject: |
|
|
| Villane wrote: | | manunderground wrote: | This is really exciting stuff, keep it up!
Here are some other cool ideas:
* Provide an export function to export a runnable jar which is ready for distribution
* Provide an export function to export as a webstart which is ready for upload to a server |
|
i see into picture that you added slick.jar, lwjgl.jar and lwjgl_util.jar, jinput.jar. IHMO, lwjgl_util and jinput.jar is not essential for slick development, no ?
another idea:
when you create a project using a wizard, user can choose to have an ant script with few commands, like export for win32, linux, macOS, webstart, and so on ? I can post an example  |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Tue Feb 10, 2009 6:09 pm Post subject: |
|
|
Ok, here's the current plan for this week or so:
* Implement the New Game Wizard. Mostly done, but needs some more code for template support.
There will be an extension point for providing templates so others could add templates (by writing a rather simple Eclipse plugin).
* Make lwjgl_util and jinput optional. Add jogg, jorbis, ibxm as optional components as well (why did I say FMOD earlier? beats me)
* Add ant build scripts to wizard templates (send me samples, my username at gmail.com or here). I would make them disabled by default, though -- the default thing should be really basic, IMHO. On the other hand, it would suck if people write a game with the default options, and then don't know that they could have chosen to include the build script and easily export their game.
* Fix the incompatible version issues, license, copyright and whatever little technical details.
* Add support for multiple versions of slick library / lwjgl.
* Add Tiled to the tools included? Any other tools?
That doesn't seem to leave much time, so an export wizard would have to be done later, if it's even necessary when an ant script would already handle the exporting.
Also, I think the actual code I'm creating will have to be licensed under EPL (Eclipse Public License), since I'm copy&pasting a lot of Eclipse code. |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Wed Feb 11, 2009 12:55 am Post subject: |
|
|
The wizard is almost complete. There are three pages:
1) project creation page, similar to new Java Project/Plugin Project wizard
2) template selection page, similar to Plugin Project Wizard
3) template options page, similar to Plugin Project Wizard (not implemented yet)
I think this is enough, the rest of the options can be configured later if one wishes. Everything works already, except there is no UI for changing the template options (game title, class name etc.), so currently defaults are used.
It can create both Java and Scala projects (only if you have Scala Plugin installed). Depending on the language you choose, different templates are presented on the second page.
 |
|
| Back to top |
|
 |
manunderground Oldbie
Joined: 17 Jun 2008 Posts: 336
|
Posted: Wed Feb 11, 2009 1:29 am Post subject: |
|
|
This looks pretty sweet, any chance you have the code hosted somewhere? _________________ My website about game development http://anotherearlymorning.com |
|
| Back to top |
|
 |
Villane
Joined: 12 Dec 2008 Posts: 30
|
Posted: Wed Feb 11, 2009 2:02 am Post subject: |
|
|
You mean source code? Not yet, but I'm thinking of creating a Google Code project (tomorrow, maybe).
The latest binaries just got uploaded to the update site: http://villane.org/slick/update/
(but I'm not incrementing version numbers yet so automatic updating as I make changes won't work) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|