UX2Engine - 2D Game Engine

Hello everyone, I just thought I’d post here to showcase a project I’ve been working on for quite some time.

Ux2Engine is a framework for developing 2D games that I’ve built from the ground up to be pluggable into different types of APIs and frameworks, designed with speed and simplicity in mind.

The flagship game behind the engine is Renoria, a 2D MMORPG currently in development by my company Uxsoft:

For more info on Renoria please check out my other topic: http://www.java-gaming.org/topics/renoria-java-mmorpg/30991/view.html

Current features of the engine:

  • Pluggability - Plug any renderer, physics engine or audio renderer you want! Java2D/AWT, LWJGL and JOGL/NEWT currently supported. Audio currently only supports JavaSound and Physics engine currently only supports Box2D, but support for any framework can be added.
  • Need to load encrypted resources? Just add a filter driver into the AssetManager and away you go!
  • Need to load a custom format into the game? Just plug in your custom loader into AssetManager and all the details are hidden from you :wink:
  • Built in networking module running on Java NIO, all you need to implement is the protocol encoder & decoder!
  • Fine tune any part of the engine without changing the engine itself, just extend any classes derived from the engine!
  • LWJGL module has a TextureLoader which uses dynamic texturepacking to improve performance by decreasing amount of bindTexture calls. Also has young/old generation textures to better manage VRAM.
  • Prefer immediate mode? Just plug in an immediate mode renderer, or prefer VBO graphics? Just plug in the LWJGLVBORenderSpace :slight_smile:
  • Input details are also transparent, all you need to provide is an InputHandler and the actual details of whether its using LWJGL, Swing or NEWT is completely hidden

Example code from Renoria that shows the engine in action (runtime choice between Java2D or LWJGL):


UxEngineOptions options = new UxEngineOptions();
options.fullscreen = useFullScreen;
UxAssetProvider renoriaEncryptedProvider = new RenoriaEncryptedAssetProvider();
options.displayMode = new UxDisplayMode(requestedWidth, requestedHeight, 32, UxDisplayMode.REFRESH_RATE_UNKNOWN);
options.setComponent(UxComponent.RENDERER, useJava2D ? new Java2DRenderer() : new LWJGLVAORenderer());
options.setComponent(UxComponent.ASSET_MANAGER, new UxAssetManager(useJava2D ? new Java2DBufferedImageAssetProvider(renoriaEncryptedProvider) : new GLTextureAtlasBuilderAssetProvider(renoriaEncryptedProvider, runOptions.getOptionalInt("textureCacheSize", 10))));
options.setComponent(UxComponent.PHYSICS_ENGINE, new RenoriaPhysicsEngine());
options.setComponent(UxComponent.INPUT, new RenoriaInputHandler());
options.setComponent(UxComponent.NETWORK, new RenoriaPacketCrypto());

Ux2Engine engine = new Ux2Engine(options);

UxEngineWindow wnd = useJava2D ? (new SwingDoubleBufferedEngineWindow(engine) : new LWJGLEngineWindow(engine) );

wnd.loop(new RenoriaGameLoop());

Example screenshots of my stress testing for it:

Java2D renderer (80 FPS, 2000 sprites)

LWJGL renderer (with index buffer, vbo and texture packer) (200 FPS, 5000 sprites)

LWJGL renderer (with immediate mode and textureRect) (120 FPS, 5000 sprites)

I’m thinking about opensourcing parts of the engine later on, so other people can put it to use (once the main game using the engine is complete!)

LOl those pigs. Very neat though.

This is the first “Check out my game engine” that I was actually like, :o

Not trying to rip on those who are making there own but you are doing many things right here. Using box2D for physics instead of writing your own. That I like. I also like the java2D support even though it is basically useless. Do you have nice shader wrappers? and maybe some build in shader stuff? Lighting? Particle system? :smiley:

Glad that you are developing and engine as you are making a game. Seems really silly to make an engine before you make a game as you never quite know what stuff you need or how it should be done in an api.

Keep up the good work.

And I like the stone pigs. ;D

[quote]I also like the java2D support even though it is basically useless.
[/quote]
It’s fine for having a debug renderer while you do main logic development, waiting to do the real renderer last. To each his own, I guess.

I like those sprites! I’m sure the game engine is great, too :slight_smile: