Skip to content

Ekrol34/AlceEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

206 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alce Game Engine

Alce is a 2D game engine built on top of SFML and Box2D. It provides a component-based architecture with built-in support for physics, animations, lighting, tilemaps, UI elements, and persistent storage — with the goal of keeping project setup and iteration fast.


News

Full changelog

TileMap component (6/9/2025): Renders tile-based maps exported from PyxelEdit directly on a GameObject. Handles tilesets, layers, flips, and rotations automatically, and updates bounding corners for scene culling. Docs

TextRenderer component (24/8/2025): Renders styled text in world space with support for formatting, colors, backgrounds, and borders. Docs

Candle lighting integration (3/8/2025): Adds 2D dynamic lighting via Candle (radial and directional lights, fog areas, and custom light meshes). Integrates with the engine's component system and includes debug visualization.


Documentation

Documentation is still a work in progress.

Each component and module has its own .md file in the source tree. A consolidated reference is available on the project wiki.


Contributing

Contributions are welcome — bug reports, feature proposals, or code. See the TODO list for open tasks.


Components

  • Animation2d — Spritesheet-based 2D animation with configurable playback modes, frame timing, and origin.
  • Camera — 2D camera with zoom, viewport config, and smooth follow.
  • ParticleSystem (Box2D) — Physics-based particle emitter for effects like smoke, sparks, or explosions.
  • Raycast2d (Box2D) — Raycasting along a direction with hit/miss callbacks.
  • Rigidbody2d (Box2D) — Full Box2D rigid body integration: shapes, forces, impulses, and transform sync.
  • SpriteRenderer — Renders a 2D sprite with multi-texture support, position, scale, and rotation.
  • Light2D (Candle) — Radial or directional light source with configurable range, intensity, and beam angle.
  • LightMesh2D (Candle) — Light-blocking geometry (rectangle, circle, or polygon) with transform sync and debug mode.
  • LightingArea2D (Candle) — Fog-like 2D lighting area with dynamic size, color, and opacity.
  • TileMap (PyxelEdit) — Renders PyxelEdit JSON tilemaps with tileset slicing, flip/rotation handling, and culling support.
  • TextRenderer — World-space text with styling, color, backgrounds, and borders.

Modules

  • Core — Window, scene management, asset loading, input, and the main loop.
  • Audio — Channel-based audio playback with per-channel volume, pitch, and loop control.
  • Storage — JSON-based persistent storage with segmented files and size-limit enforcement.
  • Chrono — Time utility class with ms-level precision and arithmetic operators.
  • Debug — Color-coded console logging with optional async file output and rate limiting.
  • Input — Keyboard, mouse, and joystick state tracking with edge detection and enable/disable control.
  • Math — Math utilities, RNG, 2D vectors, and geometry classes (rect, polygon, circle).
  • Color — SFML color wrapper with RGB/RGBA/hex/string constructors, blending, and predefined constants.

Utilities

  • Collections — Generic List, Pair, and Dictionary with filtering and manipulation methods.
  • String — SFML string wrapper with parsing, trimming, splitting, regex, and conversion utilities.
  • Json — RapidJSON wrapper for parsing, get/set, validation, and serialization.
  • FileSystem — File and folder operations via std::filesystem with exception handling.

UI Elements

  • Animation — Spritesheet animation for UI elements with loop and single-play modes.
  • Button — Interactive button with text, mouse event callbacks, and click handling.
  • Image — UI image element with multi-texture support and origin offset.
  • Text — Styled text element with font, color, size, borders, and background.
  • TextInput — Text input field with placeholder, cursor, and submit callback.

CLI

  • Alce CLI — Command-line tool to compile, run, and generate Alce projects without a full IDE setup.
  • ARL — In-game scripting prompt for iterative debug workflows without recompilation.

Setup

See the setup tutorial for installation. Once set up:

cd build                 
./alce init <---- run once
./alce compile alias=dev
./alce run alias=dev

Requirements

  • GCC 32-bit v13.1.0+ (g++, mingw32-make, gdb)
  • Windows 10 or 11
  • Python 3.1.0+
  • PyxelEdit (optional, recommended for tilemaps)

Contact

Professional inquiries: gabrielbeguren@outlook.com
Bugs and ideas: use GitHub Issues.


Third-party libraries

Library License
SFML zlib
Box2D MIT
Candle MIT
RichText Public domain
rapidjson MIT