A game engine built using libGDX.
These tools are built to benefit us in our game development process, but we feel that it can benefit you as well!
The following is provided by Osmigine and works for both Android and Desktop:
InputSystem,ControllerSystem,InputMap- For keyboards, mice, touchscreens, controllers
- Allows for remapping/mapping to specified keys (like an
ObjectMap) - Superior controller input handling (with null-safety and less direct controller-mapping usage)
- Uses
InputProcessorandControllerListenerfor superior input-polling
AudioSystem,SoundInstance,MusicInstance- Position-based Sounds
- Get the duration for both
SoundandMusic - Full control for individual sound instances played off a
SoundviaSoundInstance - Use
Musictracks as individual instances for more control - Handles loading all provided sounds and music automatically via an
AssetManager
SceneManager,Scene- Allows for cool screen-transitions from scene to scene via
ScreenManager - Handles previously mentioned systems for you and provides easy access to them
- Handles screen disposal and screen-clearing for you
- Built-in tick-rate system (choose to render, tick, or both!)
- Allows for cool screen-transitions from scene to scene via
ScalingSystem,ScalingElement,ScalingSprite,ScalingLabel- Used to handle scaling UI systems using a target screen dimension.
- Create your own elements via
ScalingElementor use the pre-built options. - Pin any element to an anchor or use percentage-based positioning.
ScalingSpriteallows you to automatically scale any texture provided to it.ScalingLabelefficiently handles scaling your text via aBitmapFont.
- And More! (WIP)
The following is to be done with the gdx-liftoff tool.
NOTE: On Linux run gdx-liftoff by calling __GL_THREADED_OPTIMIZATIONS=0 java -jar gdx-liftoff.jar!
- CORE
- DESKTOP
- ANDROID
- SERVER
- SHARED
- Controllers
- Freetype
- KryoNet
- ScreenManager
- ShapeDrawer
- SteamWorks4J (EXTERNAL)
- jAudioTagger (EXTERNAL)
- LIBGDX VERSION: 1.14.0 or latest
- JAVA VERSION: 11
Once the new project is generated, make sure to do the following:
- Make sure to use JDK-17 (Eclipse Temurin, etc.) with language level 11.
- For SteamWorks4J:
- Add
steamworks4jVersion=1.10.0togradle.properties. - Inside the lwjgl3
build.gradle, add the following dependencies:implementation "com.code-disaster.steamworks4j:steamworks4j:$steamworks4jVersion" implementation "com.code-disaster.steamworks4j:steamworks4j-gdx:$steamworks4jVersion" implementation "com.code-disaster.steamworks4j:steamworks4j-server:$steamworks4jVersion" - Inside the server
build.gradle, add the following dependencies:implementation "com.code-disaster.steamworks4j:steamworks4j:$steamworks4jVersion" implementation "com.code-disaster.steamworks4j:steamworks4j-server:$steamworks4jVersion"
- Add
- For jAudioTagger (necessary for AudioSystem):
- Add
jaudiotaggerVersion=2.3.15togradle.properties. - Inside the core
build.gradle, add the following dependency:api "com.github.Adonai:jaudiotagger:$jaudiotaggerVersion".
- Add
- For KryoNet:
- Cut
api "com.github.crykn:kryonet:$kryoNetVersion"from the corebuild.gradledependencies. - Paste
api "com.github.crykn:kryonet:$kryoNetVersion"into the sharedbuild.gradle.
- Cut
- To fix the
Error: Module java.base/sun.nio.ch not founderror when using Construo to package your game, make sure to:- At the top of
build.gradlein lwjgl3, under thebuildscriptblock, inside thepluginsblock, addid "io.github.fourlastor.construo" version "YOUR VERSION HERE". - Scroll down to the construo block, inside it, at the very top add:
jlink { // add arbitrary modules to be included when running jlink modules.addAll("jdk.zipfs", "jdk.unsupported", "java.management", "java.logging") // guess the modules from the jar using jdeps, defaults to true guessModulesFromJar.set(false) // include default crypto modules, defaults to true includeDefaultCryptoModules.set(true) }
- At the top of
- Remove
configuration.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.ANGLE_GLES20, 0, 0);fromLwjgl3Launcher.javato preventEGL: Failed to clear current contexterror on Linux. - Replace
configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate + 1);inLwjgl3Launcher.javawithconfiguration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate + (SharedLibraryLoader.os == Os.MacOsX ? 0 : 1));to prevent slight stutters on MacOS.
You can now copy over the Osmigine source code into each libGDX platform module that requires it.
For example, the lwjgl3 module has platform-specific code for precise cursor position handling via
the GlfwCursorProvider.java, make sure to copy it over!
I will try my best to write some general documentation for each class provided by the engine in the form of mark-down files: