LWJGL support for Simulation Container

To demonstrate the flexibility of Simlets and the Simulation Container we have added LWJGL support. This was done to show that Simlets are not tied to any one platform or GL toolkit. Check it out at:

http://www.realityinteractive.com/software/index.html

What are Simlets? Simlets are a modular and reusable approach to simulation (e.g. game) development. They are a bunch of classes and interfaces that define a way to approach and code simulations. Check out the Simlet javadoc at http://www.realityinteractive.com/software/sc/simlet/javadoc/index.html.

Why do we need Simlets? The reusability of components between games is nearly zero. Everyone and their brother are creating a game engine or their own game from scratch. This makes for hundreds of islands of code with no way to leverage the effort from one to build another. We need a way to allow game components to be shared. Enter Simlets.

Another way to look at this is to use history. Before Servlets and J2EE came about, everyone had their own way to code Java for the web. Everyone was starting from scratch and trying to build up momentum. Enter Servlets. Now everyone has a common way to talk with and about web content. You can find a servlet out there to do basically anything and you know how it works since it follows a certain pattern. Add to this the fact that people can now use energy to build toolkits on top of Servlets rather than just getting enough momentum going to write out a basic web page. Games need this type of leveler so that all the developers are playing on the same field and are talking the same language.

What do I do with a Simlet? Simlets are just a different way to think about what you’re already doing. They do not impose a particular toolkit on you as a game engine would. They simply provide a common way to express a game component.

What do I get if I use Simlets? As was mentioned above, Simlets provide a common way to express a game component. As more and more people start to use Simlets and make their software available then it becomes easier and easier for people to simply pick up a component and use it in a different game. So what do you get? You begin to fulfill one of the promises that Java was to deliver: reusability.

Give some examples of how to use Simlets in my game. I will use our QuakeWorld technology preview as an example as that is what we used to help define Simlets.

[]Console: The console is designed as Simlets. One Simlet accepts input messages (keyboard key presses) and translates them into commands or stores them for display. Another Simlet renders the Console view.
[
]Command and Variable processing: A Simlet accepts command messages from the console and network and processes them into actions.
[]Rendering: This is broken down into entity, world, particle, lighting, etc renders each as a Simlet. Just as in the tutorials provided on our site demonstrate the MVC paradigm with Simlets, the QuakeWorld clone uses MVC to achieve a very flexible architecture that supports plug-in renderers.
[
]Sound: A Simlet accepts messages from the network and entities and “renders” them as sound.
[*]Network: A Simlet encapsulates the sending and receiving of network packets.

Where does the Simulation Container fit into this? The Simulation Container provides a place for Simlets to live. Just as Servlets live within a webserver (so to speak), Simlets live within a Simulation Container (SC). The SC allows for individual stages (either a Simlet or a pipeline) to be reloaded on demand. This greatly simplifies and speeds up game development. How many times have you coded, compiled, built, launched, and tested your game? Imagine if you could cut out the launch part. Just code and compile and refresh the SC and it will load any changed Simlets leaving all others unchanged. No more waiting for the JVM to start. No more waiting for the content or objects to load. No more spending time to advance in the game to a point to begin testing. Pure development bliss!

Do I need the Simulation Container to use Simlets? No. Simlets are just Java classes. You can build your own Simlet container (without the deployment descriptor processing) in about 100 lines of code but it will not have the ability to dynamically reload Simlets and all of the other juicy tidbits that we added into the Simulation Container.

But it doesn’t support blah platform! Simlets are POJO (plain ordinary Java objects). The Simulation Container itself is 100% pure Java except that it uses SWT for the UI. In theory (and we’re going to begin other platform testing shortly) you swap the SWT jar and libs out and it works another platform. Platform dependencies in the simulation common libraries are pretty well outlined in the code so you should be able to port them to whatever platform you want.

What’s the catch? No catch. Simlets are GPL (and will most likely go to BSD). The Simulation Container is free for non-commercial use. Grab the Simlet jar and javadoc and start coding your games in a way that will allow others to leverage your work!


This is a forum so let’s start getting some talking going!

Hi,

sounds interresting , i just overflow your Site.
Maybe you can provide some better Demos avaible of your
techique ?

Your main aspect is bringing more structure into the game code, right. Hmm, well some parts of course are written only for special things in games. Game programmers should allready know the MVC paradigm, but frameworks should be welcome to make it easier.

Do Simlets also support any other GL java lib ?

You wrote that i have not to wait for the JVM to start , did a simlet run in some kind of Container ?

I also had a look at the Java Doc…and well…i saw two class and a lot of interfaces…how the heck will does bring structure ? The programmer must do the job. Looks a bit like other Sun APIs for Service providers like JMS.

regards,

  • jens

Demos are forthcoming. It has always been out intention to make the source for the QuakeWorld clone available. We’re cleaning it up and making it follow the Simlet paradigm (it was a proof of concept so it differs a bit from the final Simlet definition).

Simlets are not specific to OpenGL. I come from the enterprise software space. The last enterprise proudct that I worked on was a real-time trading platform. If I had to write the app again today, I would use Simlets. This is just a very long winded way of saying that you can use Simlets for essentially anything were a unit of processing is the core component.

How does a common interface bring structure? The same way that Servlets bring structure to web apps. The same way that java.lang.Object bring structure to the whole Java class hierarchy.

I’m going to say flat out that most game developers are not going to “get it”. Most game developers see interfaces as a nuisance. Inheritance for most people is a technique for code sharing / reuse and the phrase “is-a” is left forgotten in the corner. But to everyone out there I say: until we start coming to a common ground and using and defining standard ways of approaching these problems we’re never going to have the traction we need for game development to be as common place as, say, Servlets and instead we’re going to reinvent the wheel over and over.

One of these days when everyone gets to look at the source for AF they’ll see how interfaces work in real life and go “ahhh! So that’s why!”. I can’t live without them now…

Cas :slight_smile:

Hey Cas!

Now if we can only get you away from using static members everywhere … :slight_smile:

But seriously now folks, I would have thought that Cas would have freaked out when he saw what I did to his baby – embedding it in another app w/o window decorations and allowing the window to be resizable and all of that. Pure sacrilege I tells ya!

Hi,

well, dont teach us about using interfaces…we know how to use them ;D
But good API were allways welcome !

  • jens

Just like interfaces, statics should be used wherever they are meant to be used to achieve the operation required of them :smiley:

Cas :slight_smile:

Sure! Just like code reuse through inheritance. NOT!

I’m not picking on your directly Cas. This is just a general gripe of mine. Too often I see code that was written for convenience rather than taking the extra minute or so to think it through and do it right. And you know what’s funny about it? Nine times out of ten, the shortcut requires more time to maintain and is more error prone.

Grrrrrr!