Skip to content

RivelBop/Osmigine

Repository files navigation

Osmigine

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!

Features

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 InputProcessor and ControllerListener for superior input-polling
  • AudioSystem, SoundInstance, MusicInstance
    • Position-based Sounds
    • Get the duration for both Sound and Music
    • Full control for individual sound instances played off a Sound via SoundInstance
    • Use Music tracks 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!)
  • ScalingSystem, ScalingElement, ScalingSprite, ScalingLabel
    • Used to handle scaling UI systems using a target screen dimension.
    • Create your own elements via ScalingElement or use the pre-built options.
    • Pin any element to an anchor or use percentage-based positioning.
    • ScalingSprite allows you to automatically scale any texture provided to it.
    • ScalingLabel efficiently handles scaling your text via a BitmapFont.
  • And More! (WIP)

Generate New Project

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!

ADD-ONS

PLATFORMS

  • CORE
  • DESKTOP
  • ANDROID
  • SERVER
  • SHARED

EXTENSIONS

  • Controllers
  • Freetype

THIRD-PARTY

  • KryoNet
  • ScreenManager
  • ShapeDrawer
  • SteamWorks4J (EXTERNAL)
  • jAudioTagger (EXTERNAL)

SETTINGS

  • LIBGDX VERSION: 1.14.0 or latest
  • JAVA VERSION: 11

Initial Project Setup

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:
    1. Add steamworks4jVersion=1.10.0 to gradle.properties.
    2. 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"
      
    3. Inside the server build.gradle, add the following dependencies:
      implementation "com.code-disaster.steamworks4j:steamworks4j:$steamworks4jVersion"
      implementation "com.code-disaster.steamworks4j:steamworks4j-server:$steamworks4jVersion"
      
  • For jAudioTagger (necessary for AudioSystem):
    1. Add jaudiotaggerVersion=2.3.15 to gradle.properties.
    2. Inside the core build.gradle, add the following dependency: api "com.github.Adonai:jaudiotagger:$jaudiotaggerVersion".
  • For KryoNet:
    1. Cut api "com.github.crykn:kryonet:$kryoNetVersion" from the core build.gradle dependencies.
    2. Paste api "com.github.crykn:kryonet:$kryoNetVersion" into the shared build.gradle.
  • To fix the Error: Module java.base/sun.nio.ch not found error when using Construo to package your game, make sure to:
    1. At the top of build.gradle in lwjgl3, under the buildscript block, inside the plugins block, add id "io.github.fourlastor.construo" version "YOUR VERSION HERE".
    2. 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)
      }
      
  • Remove configuration.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.ANGLE_GLES20, 0, 0); from Lwjgl3Launcher.java to prevent EGL: Failed to clear current context error on Linux.
  • Replace configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate + 1); in Lwjgl3Launcher.java with configuration.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!

Documentation

I will try my best to write some general documentation for each class provided by the engine in the form of mark-down files:

About

A game engine built using libGDX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages