Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (427)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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  
  The Java Rabbit Engine - a 2D Game Engine written with LWJGL  (Read 10727 times)
0 Members and 1 Guest are viewing this topic.
Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Posted 2011-09-04 03:38:41 »


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.


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


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!
Offline ReBirth
« Reply #1 - Posted 2011-09-04 05:25:21 »

Sounds good. Seems it will come face to face to slick2d. However I'll see the game first before try the engine ;P

Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #2 - Posted 2011-09-04 06:52:29 »

I got this in the console:
1  
2  
3  
4  
5  
6  
7  
8  
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!

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

Senior Member


Medals: 4
Projects: 3



« Reply #3 - Posted 2011-09-04 13:46:09 »

Sounds good. Seems it will come face to face to slick2d. However I'll see the game first before try the engine ;P

Well, I hope you enjoy it! Cheesy

I got this in the console:
1  
2  
3  
4  
5  
6  
7  
8  
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)


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.  Roll Eyes

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

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.

Great job on the engine!

Thanks!
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2


Make it work; make it better.


« Reply #4 - Posted 2011-09-04 14:01:34 »

<!-- SHTML Wrapper - 500 Server Error -->

Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #5 - Posted 2011-09-04 16:35:28 »

Well I shall be staring at the source code for quite a while 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

Offline Cero
« Reply #6 - Posted 2011-09-04 17:25:23 »

Obviously you need tutorials and stuff

Quote
Place your games in AWT and Swing applications

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.

Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Reply #7 - Posted 2011-09-04 18:01:41 »

Quote
<!-- SHTML Wrapper - 500 Server Error -->

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

Thank you VERY much for the compliment. It means a lot to know that 1.5+ years have been worth it. Smiley 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
1  
if(KeyboardHandler.isKeyDown(Keyboard.KEY_X))...

than something like
1  
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
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.

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.
Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Reply #8 - Posted 2011-09-04 22:18:05 »

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

http://jrabbit.minds-eye-games.com/javadoc/index.html
Offline aazimon
« Reply #9 - Posted 2011-09-05 01:14:13 »

pretty cool game. It runs very smooth.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2


Make it work; make it better.


« Reply #10 - Posted 2011-09-05 06:00:24 »

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

Offline loom_weaver

JGO Coder


Medals: 17



« Reply #11 - Posted 2011-09-05 07:14:20 »

Obviously you need tutorials and stuff

Quote
Place your games in AWT and Swing applications

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.

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.
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #12 - Posted 2011-09-05 11:29:56 »

That LockingList class looks really interesting! O_O

Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Reply #13 - Posted 2011-09-05 15:35:41 »

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

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

« In padded room »



TUER


« Reply #14 - Posted 2011-09-05 15:51:53 »

Hi

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

Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Reply #15 - Posted 2011-09-05 16:04:14 »

The SVN is on Sourceforge.

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

Senior Member


Medals: 4
Projects: 3



« Reply #16 - Posted 2011-09-05 16:56:01 »

I have created a discussion about LockingList, jRabbit's core iteration data structure, here: http://www.java-gaming.org/topics/locking-list-a-new-data-structure-designed-for-video-games/24726/view.html
Offline charlieg

Senior Newbie


Medals: 1



« Reply #17 - Posted 2011-09-12 00:23:14 »

It doesn't work for me!

Quote from: 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 from: Java Console
Unable to load logo and progressbar images
Unable to load logo and progressbar images
Offline CodeBunny

Senior Member


Medals: 4
Projects: 3



« Reply #18 - Posted 2011-09-13 13:30:16 »

What is your system/whatnot?
Offline JNiNJA

Junior Newbie


Exp: 4 years


Whatever you do, do it in your way.


« Reply #19 - Posted 2012-02-07 23:42:51 »

Wow looking gooood...
and the Micron is just a great game XD
well done Cheesy
Offline zngga
« Reply #20 - Posted 2012-03-08 03:05:12 »

I was reading over the javadocs for your engine, the zip file hasn't even finished downloading yet and I am in love! Of what I can tell from the docs this is very well thought out and implemented. Great work, and I can't wait to use it for my next game!

[edit] well i got everything set up and working, now where to begin. Perhaps a 'make a standard game' tutorial is in order. If I knew more about the implementation I would do it!

My code never has bugs... it just develops unexpected features!
Offline 8Keep

Senior Newbie


Medals: 1



« Reply #21 - Posted 2012-08-26 23:41:59 »

Hello! Is there any way you can write some documentation on this? This really seems comparable to slick2d and libgdx. I want to use to badly, but I'm not good at learning things by just looking at the source for micron. Once, I learn it, I can help you write lots of tutorials, though!
Offline 8Keep

Senior Newbie


Medals: 1



« Reply #22 - Posted 2012-08-28 03:37:19 »

Also, Are you planning on updating this anytime soon? I want to use it, but I'm afraid it will become outdated because it hasnt been touched since it was released.
Offline ReBirth
« Reply #23 - Posted 2012-08-28 03:45:12 »

@8keep
I'm not the developer but here my two cents. If this lib acts as higher level (API helper) to lwjgl, then you can use this lib as long as lwjgl doesn't change hardly their API. Mean you can update this lib by replace the lwjgl lib to newer version so you'll gain the performance update. But if lwjgl's API hardly changed like libgdx, there's chance current version of RE can't be used with new one.

Offline Don Kiddick

Junior Member





« Reply #24 - Posted 2012-08-28 13:52:55 »

It seemed simpler to be able to say
1  
if(KeyboardHandler.isKeyDown(Keyboard.KEY_X))...

than something like
1  
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.

Not really a fair comparison. A fairer version of 2) would be :

1  
if (getParentGame().getKeyboardHandler().isKeyDown(Keyboard.KEY_X))...


another alternative would be to 'push' the keyboard handler to the client, rather than the getParentGame().getKeyboardHandler() 'pull'. Which would give you client code of :
1  
if (keyboardHandler.isKeyDown(Keyboard.KEY_X))...


The main benefits of an approach like this are :
1 Unit testing is easier - you can inject in different Test Doubles
2 Polymorphism. You could have different implementations of these classes. This could make your code more flexible.

The main cost being the extra overhead & complexity. I would say that this is quite small but definitely non-zero.

YMMV.

DK.
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.

xsi3rr4x (78 views)
2014-04-15 18:08:23

BurntPizza (70 views)
2014-04-15 03:46:01

UprightPath (81 views)
2014-04-14 17:39:50

UprightPath (66 views)
2014-04-14 17:35:47

Porlus (82 views)
2014-04-14 15:48:38

tom_mai78101 (106 views)
2014-04-10 04:04:31

BurntPizza (166 views)
2014-04-08 23:06:04

tom_mai78101 (262 views)
2014-04-05 13:34:39

trollwarrior1 (212 views)
2014-04-04 12:06:45

CJLetsGame (221 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!