Showing posts with label osgi. Show all posts
Showing posts with label osgi. Show all posts

Friday, June 22, 2007

Equinox & ECF serving interactive fiction

After a couple of years of being lazy and procrastinating, I finally got Ziggy to the point where we now have it running live [Beta] :) at Idle Thumbs (thanks Spaff, Jake and others from Idle Thumbs for your help with this) . Ziggy is a server side application based on Equinox and ECF, it enables people to play interactive fiction games on web forums, acting as a bridge between the forum and an IF virtual machine.

At first it was just plain Java, a very simple app hacked together in only a few days, but has suffered many a rewrite since then and is now fully OSGified. I separated it into four main components: server, Interactive Fiction API & implementation, Bulletin Board API & implementation, management client -- all of these are now packaged as OSGi bundles and the client is an RCP application. The Bulletin Board API is open source and is also incubating at ECF (still needs some work before becoming part of a release). The Interactive Fiction API may also become open source at some point, and there are other interesting uses for it. For example another plug-in I developed allows playing these games inside an Eclipse console, which I hope to make available soon.

Thanks to taking advantage of ECF's communications container abstractions, Ziggy's potential is not actually limited to bulletin boards -- it was easy to add just a bit of code to make it work over instant messaging and IRC, but this aspect of it is not public yet.

Wednesday, November 22, 2006

Using OpenGL in SWT with Java 5

Following my last idea about an OSGi based game engine, I thought I'd start experimenting with various game engine stuff. So far, I've managed to get a bundle that has OpenGL binding working quite nicely. I used LWJGL, and created two bundles for it:
1) org.lwjgl -- the Java classes and source code is in this bundle.
2) org.lwjgl.win32 -- platform specific fragment for the above bundle, which has the Windows DLL-s and OSGi knows how to load them because I specified the Bundle-NativeCode header for them in the manifest.

I used the SWT OpenGL support to test this and after experimenting with some snippets, and copying some code from the famous NeHe OpenGL tutorials, I thought that since I was using Java 5, I could do the following:

import static org.lwjgl.opengl.GL11.*;

to import the static methods and lo and behold -- now I can paste the C code from NeHe tutorials into Java files without making any changes! :)

Now I'm getting the urge to start learning OpenGL again. I've already done some of the NeHe tutorials in C++, but I never really liked to write code in C or C++ that much.

Saturday, October 07, 2006

Idea: OSGi based game engine

There has been a little talk in the Eclipse related blogs about Eclipse's relationship with games. Which currently seems to be minimal. Here's an interesting idea for a new Eclipse Technology project: an OSGi-based game engine. It could be named EDGE for Eclipse Dynamic Game Engine. Another (sub-)project would add developement tools.

A project like this should define API/interfaces for sub-systems that are required by most game engines and create exemplary open source based implementations. There are some fine open source engines out there (there are others, but these are the ones I know about):
  • OGRE graphics engine. Someone else develops a Java wrapper for it
  • ODE physics engine. There seems to be a plethora physics engines out there lately, but I'm not sure how many are open source. I remember that ODE is one of them. It has a Java wrapper too
  • OpenAL 3D audio library. I think there are Java wrappers for this too, but you'll have to find the links yourself.
Maybe there are even pure Java solutions out there that are better to use in Java? I looked into game engines before I became a Java fan, so I'm not very aware how good the Java ones are.

Other things needed:
  • entity/actor system
  • a scripting language
  • the glue to hold it all together
  • 2D graphics engine (start simple)?
  • extensions for specific genres
There are efforts like this out there, like Yake (although I'm not very familiar with them), but we all know there is no other component platform like OSGi (+ Equinox) :)