Skip to content

Frequently Asked Questions

Quick answers to the most common questions about LITIENGINE architecture, performance, mechanics, persistence, and distribution.


General & Architecture

Is LITIENGINE a library or a full game engine?

LITIENGINE is a modular 2D Java Game Library and Framework. It provides everything needed to build commercial-grade 2D games: a high-performance game loop, 2D physics with spatial quadtrees, AWT graphics pipeline, 2D positional audio, entity lifecycle management, and the companion utiLITI Editor.

What Java version is required?

LITIENGINE requires Java 25 or newer. It leverages modern Java features including Java Panama Foreign Function & Memory (FFM) APIs for low-latency gamepad polling via Input4j with zero native JNI libraries.

Why pure Java with AWT instead of OpenGL/Vulkan bindings?

By relying on pure Java AWT 2D graphics without heavy native dynamic C/C++ libraries (like LWJGL or libGDX bindings), LITIENGINE games run identically across Windows, macOS, and Linux without native DLL hell, driver crashes, or platform-specific compilation hurdles.

How does the game loop work?

LITIENGINE coordinates game updates, input polling, and rendering through a unified loop (Game.loop()):

  1. Invariable Update Phase: Polls connected hardware devices (Input.keyboard(), Input.mouse(), Input.gamepads()) and updates internal runtime state.
  2. Update Phase (super.process()): Executes registered IUpdateable components, physics simulation, spatial quadtree indexing, entity behaviors, and tweens.
  3. Timed Actions: Dispatches scheduled delayed callbacks registered via Game.loop().perform(...).
  4. Camera & Rendering Phase: Calculates camera target focus/trauma shake and renders the active Screen, map layers, entities, and UI components on the AWT Graphics2D pipeline.
  5. Metrics: Records tick execution times and frame rates.

The target tick rate is configured via config().client().getMaxFps() (default: 60 ticks/second).

Does LITIENGINE collect any telemetry or user data?

No. LITIENGINE and the utiLITI Editor contain zero telemetry, tracking, or analytics code.


Graphics, Scaling & Display

How do I handle pixel art scaling and high-DPI displays?

LITIENGINE provides integer pixel scaling through the camera and render component:

// Set base camera zoom to 3x for crisp pixel art on 1080p/4K
Game.world().camera().setZoom(3.0f, 0);

// Clamp coordinates to whole pixel integers
Game.world().camera().setClampToMap(true);
Can I toggle fullscreen mode at runtime?

Yes! You can toggle between borderless windowed, windowed, and exclusive fullscreen:

// Toggle fullscreen mode
Game.window().getRenderComponent().setFullscreen(!Game.window().getRenderComponent().isFullscreen());
How does LITIENGINE's coordinate system work?

LITIENGINE uses a top-left origin (0, 0) convention inherited from Java AWT/2D. +X increases to the right, and +Y increases downward. The engine differentiates between Tile Grid Coordinates (discrete integer indices), World/Map Coordinates (continuous pixel coordinates), and Viewport Coordinates (screen pixels adjusted by camera zoom and focus). See our guide on Coordinate Systems & Spatial Spaces.

How do I convert between Screen, World, and Tile coordinates?

Use the Camera and map dimensions:

  • Screen (Mouse) → World: Game.world().camera().getMapLocation(Input.mouse().getLocation())
  • World → Screen: Game.world().camera().getViewportLocation(entity.getLocation())
  • World → Tile Grid: (int)(pos.getX() / map.getTileWidth()), (int)(pos.getY() / map.getTileHeight())
Why are my collision checks or tile queries off by half a tile?

entity.getLocation() returns the top-left corner of an entity's sprite bounding box. When checking tile-based collision, pathfinding, or distance, use entity.getCenter() or entity.getCollisionBox() instead of getLocation().


Mechanics, Audio & Persistence

What audio formats are supported and how are they cached?

LITIENGINE natively supports .wav and .ogg (Vorbis) audio files. Sounds are loaded once via the unified resource manager (Resources.sounds().get("sfx/hit.ogg")) and cached in memory. The audio engine supports 2D positional distance falloff, background music playlists, and volume master buses.

How do I save and load game states?

LITIENGINE supports state persistence via the Savegame API or by serializing custom entity state to JSON:

// Built-in Savegame class
Savegame save = new Savegame();
save.setString("player_name", "Hero");
save.setInt("coins", 42);
save.save("saves/slot1.sav");
Can I create multiplayer or networked games with LITIENGINE?

Yes. Because LITIENGINE is pure Java, you can integrate standard Java networking libraries such as Netty, Java NIO (WebSockets/TCP/UDP), or gRPC. LITIENGINE's deterministic tick loop makes client-side prediction and server reconciliation straightforward.


Platforms & Deployment

What platforms can I deploy my game to?

You can package and deploy standalone desktop games for Windows, Linux, and macOS (including native Apple Silicon M1–M4). Because the engine uses standard Java AWT graphics, mobile platforms (Android/iOS) and web browsers (WebAssembly) are not supported.

Can I sell my LITIENGINE game commercially on Steam or itch.io?

Yes! LITIENGINE is licensed under the permissive MIT License. You retain 100% ownership of your game source code, assets, and commercial revenue. You can freely sell your games on Steam, itch.io, GOG, or your own store.

How do players run my game without installing Java?

You can bundle a lightweight Java Runtime Environment (JRE) directly with your game using jlink, jpackage, or Launch4j. The player receives a standalone .exe, .app, or .zip bundle (~35 MB) and simply double-clicks to play. See our Deployment Guide.


Tooling, Editors & AI Integration

Do I have to use the utiLITI editor to make a game?

No. You can build complete games purely in Java code using procedural generation or raw Tiled maps. However, utiLITI significantly accelerates level design, entity placement, tileset Wang autotiling, and binary .litidata resource archiving.

Can I use AI coding agents like OpenCode or Antigravity with LITIENGINE?

Yes! utiLITI includes an embedded Model Context Protocol (MCP) server on port 8088. AI agents can inspect loaded maps, place entities, configure colliders, and generate code directly. Check out our AI-Assisted Game Development Guide.

Can I use Tiled Map Editor alongside utiLITI?

Yes. LITIENGINE natively parses .tmx map files and .tsx tilesets exported from Tiled Map Editor. You can import .tmx maps directly into your .litidata projects in utiLITI.


Community & Support

Where can I get help, report bugs, or share my game?