The Java Rabbit Engine - a 2D Game Engine written with LWJGL

http://jrabbit.minds-eye-games.com/wp-content/uploads/2011/08/jRabbit.png

So, after 21 months of development and countless revisions, I have finally finished version 1.0 of my first real programming project: The Java Rabbit Engine.

http://jrabbit.minds-eye-games.com/

The Java Rabbit Engine (jRabbit for short) is a lightweight, hardware accelerated 2D game engine. It is fast and flexible, and allows for very east yet non-constricting development.

Atm, due to time, effort, and energy constraints I do not have a tutorial suite available. However, I DO have a completely open source game written with the engine that is:

A) my first complete game,
B) a proof-of-concept that the engine works well,
C) a showcase of all major features of the engine, and
D) a fully documented, working example of how to make an entire game.

So, meet Micron: http://play.minds-eye-games.com/micron

http://play.minds-eye-games.com/wp-content/uploads/2011/09/Micron-Screenshot.png

It’s a 2D randomly generated abstract shooter. Everything except the music (code, art, etc.) has been created by me.

I’d recommend downloading either the EXE or the executable Jar over playing it as an applet. It’s a bit more fun as a fullscreen desktop game, and it allows the user to use the persistent high scores and soundtrack features.

Anyway, I hope you enjoy it!

Sounds good. Seems it will come face to face to slick2d. However I’ll see the game first before try the engine :stuck_out_tongue_winking_eye:

I got this in the console:



org.lwjgl.LWJGLException: Could not share contexts
	at org.lwjgl.opengl.WindowsContextImplementation.nCreate(Native Method)
	at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
	at org.lwjgl.opengl.Context.<init>(Context.java:131)
	at org.lwjgl.opengl.AbstractDrawable.createSharedContext(AbstractDrawable.java:30)
	at org.lwjgl.opengl.SharedDrawable.<init>(SharedDrawable.java:50)
	at org.jrabbit.base.data.thread.WatchableGLThread.shareContext(WatchableGLThread.java:76)
	at org.jrabbit.base.data.thread.WatchableGLThread.run(WatchableGLThread.java:58)

Cool game though! How did you make that awesome background?

Great job on the engine!

Well, I hope you enjoy it! :smiley:

That’s intentional, actually. When you first see the initial loading screen, the game first tries to load everything in a separate thread (using context sharing). If that succeeds, the loading screen is animated, If context sharing fails, you get an error message but no crash, and you can design the game to do an alternate loading process.

It occurs to me that adding an option to turn off this error message would probably be a good idea. ::slight_smile:

I actually brute forced the background; since it’s 2D I couldn’t get actual perspective without having the rendering code be completely custom. Each node in the “grid” is a separate object.

Basically, as the player moves around, the instant that a portion of the Grid goes offscreen, it places itself on the other side of the screen, and randomizes its image and transparency. That way, there are only as many Grid cells in the game that you can see at any time.

Thanks!

Well I shall be staring at the source code for quite a while :stuck_out_tongue:

EDIT: I gotta say, this is extremely well done. The game, the engine, the code, the organization…you sir have accomplished a great feat. However, I feel like you have overused static classes just a bit :wink:

Obviously you need tutorials and stuff

[quote]Place your games in AWT and Swing applications
[/quote]
This is relevant to my interests.
Using Slick Canvas, for applications in which you want OpenGL rendering, is a pain; that canvas is unstable as hell.

[quote]
[/quote]
I noticed that, and have no clue what caused it. It should be working now.

[quote]I gotta say, this is extremely well done. The game, the engine, the code, the organization…you sir have accomplished a great feat. However, I feel like you have overused static classes just a bit
[/quote]
Thank you VERY much for the compliment. It means a lot to know that 1.5+ years have been worth it. :slight_smile: And yes, using so many static classes did concern me, but it seemed like the best idea at the time for a number of reasons:

1: They offer functionality which is best if universal.
Consider the input code: KeyboardHandler and MouseHandler. For each instance of the game, there will only be one keyboard and one mouse. Additionally, virtually any section of the game may need to access input data. Thus, I make the input data static, so that it can be accessed from anywhere in the engine and will always be consistent.

2: I wanted the API to be as simple as possible.
It seemed simpler to be able to say

if(KeyboardHandler.isKeyDown(Keyboard.KEY_X))...

than something like

if(this.getParentGame().getInput(Input.KEYBOARD).getState(Keyboard.KEY_X) == KeyState.KEY_DOWN)...

which seemed to me to be the logical extension of not using static classes.

Maybe this is just due to my inexperience, though. That’s why I wanted it to be open source, actually.

[quote]Obviously you need tutorials and stuff
[/quote]
I do need tutorials, I agree. The reason I don’t yet is from juggling college classes, a programming internship, and a general desire to finish this project up.

However, I’ll see what I can do. Don’t expect them right away, though.

[quote]This is relevant to my interests.
Using Slick Canvas, for applications in which you want OpenGL rendering, is a pain; that canvas is unstable as hell.
[/quote]
Perhaps I should add the caveat that I support using a single AWT Canvas. The current functionality is basically some utility functionality based upon Display.setParent(). I’ve worked with AWTGLCanvas before (which is how you obtain multiple OpenGL views), and it is truly a pain. I didn’t include it because it is so unstable.

However, if you simply want a single canvas, go right ahead with jRabbit.

I uploaded the generated Javadoc for people who don’t want to download it:

http://jrabbit.minds-eye-games.com/javadoc/index.html

pretty cool game. It runs very smooth.

Graphics are cool and the game runs smooth. But it is too hard to play.

This is relevant to my interests.
Using Slick Canvas, for applications in which you want OpenGL rendering, is a pain; that canvas is unstable as hell.
[/quote]
From my experience with 2.7.1 lwjgl, it doesn’t mix well with Swing components in the same window and the AWT event queue is borked on Windows (i.e. you won’t be able to attach any kind of listener to the canvas). It really is meant to run in its own window/fullscreen and use its own input handling (and at this it excels).

For all the bad rap that it gets on these forums, I think JOGL is more suitable if you want to embed one or more OpenGL canvases into a traditional Swing app with lots of Swing controls. Likewise if you want to use AWT event handling, call Graphics2D to paint on top of the canvas, and/or do passive rendering on the EDT.

That LockingList class looks really interesting! O_O

I know, it is very hard. But it is open source! Modify the settings and see if you can find a more suitable difficulty level! :smiley:

Yes. The LockingList class is probably the crowning effort of the engine. I was going to start a separate topic about it, actually.

Hi

The source code seems to be well documented. Thank you for sharing your source code :slight_smile: Where is the SVN repository? I have found only several archives containing the whole source code.

The SVN is on Sourceforge.

https://sourceforge.net/p/jrabbit/code/4/tree/

I have created a discussion about LockingList, jRabbit’s core iteration data structure, here: http://www.java-gaming.org/index.php/topic,24726.0.html

It doesn’t work for me!

[quote=“Micron Applet”]An error has occurred while loading the applet.
Please contact support to resolve this issue.
Unable to load logo and progressbar images
[/quote]

[quote=“Java Console”]Unable to load logo and progressbar images
Unable to load logo and progressbar images
[/quote]

What is your system/whatnot?

Wow looking gooood…
and the Micron is just a great game XD
well done :smiley: