Skip to content
Tom's Software Emporium

Modular Engine

A Lightweight 2D Game Engine for Retro Game Development

Modular Engine is a highly efficient, modular game engine tailored for creating retro-style, pixel art games. Its streamlined architecture, optimized rendering systems, and powerful sprite handling make it an ideal tool for indie developers and retro game enthusiasts. Whether you're a seasoned game developer or someone with a passion for 16-bit style games, Modular Engine offers the tools and optimizations you need to bring your vision to life.

Lightweight, Modular Design for Optimal Performance

At its core, Modular Engine is designed with a modular architecture, which allows it to swap in only the necessary components at runtime. This makes the engine highly memory-efficient and adaptable for different types of games. The engine avoids bloat by only loading what is required, reducing memory overhead and allowing your game to run smoothly on the most limited of hardware. Practically any computer produced in the last 25 years can run the engine, even systems without hardware accelerated graphics.

Two-Stage Rendering System

One of the standout features of Modular Engine is its sophisticated two-stage rendering system, which splits drawing logic into two modes: Text Mode and Graphics Mode. This approach optimizes the way both text and graphics are handled, tailored to the specific needs of retro games.

 [CMD] Graphics Demo Screen 
Screenshot showing Modular Game Engine's drawing modes, with a dither pattern visible in graphics mode and example shapes like triangles and rectangles made out of hash characters in text mode

Text Mode

Text in retro games is often static or changes less frequently compared to graphics. Modular Engine's Text Mode is optimized for this, minimizing redraw operations and ensuring efficient text handling. Since text is drawn after graphics, you never have to worry about important information being obscured by on-screen elements. The simple, printf-like function allows you to print text with just two additional parameters: the x and y coordinates of the screen.

Graphics Mode

Unlike text visuals and graphics tend to change every frame in fast-paced games, therefore Graphics Mode is optimized for high-speed sprite rendering and pixel-perfect blitting. Designed to handle the quick drawing of retro-style pixel art, the system efficiently manages repetitive objects like tiles, bullets, and enemies using Instancing, allowing objects already on screen to be quickly redrawn.

Scanline Effects and Distortions

Modular Engine excels at recreating classic scanline effects seen in iconic retro games like Earthbound, Castlevania IV, and others from the 16-bit era. These effects were critical for adding visual depth and movement to environments, but can be challenging to replicate pixel-perfectly. With parameterized rendering, Modular Engine allows you to recreate these effects effortlessly.

For instance, the wavy backgrounds in Earthbound's battle scenes or the swirling tunnel in Castlevania IV are made possible with vertical and horizontal oscillation parameters. Many top-down games use scanline effects to create transparent water with wavy refraction. Modular Engine offers control over these effects using a variety of wave types (square, sine, triangle, sawtooth) along with customizable amplitude, frequency, and phase. Developers can tweak these parameters to achieve a pixel-perfect reproduction of classic effects or create entirely new ones with ease.

 [CMD]Water Refraction Demo Screen 
Screenshot demonstrating how Modular Game Engine's horizontal and vertical scanline effects can be combined to simulate wavy water refraction.

Any effects can be combined to create unique animations!

Horizontal Oscillation

Screenshot demonstrating Horizontal Oscillation

Vertical Oscillation

Screenshot demonstrating Vertical Oscillation

Horizontal Amplitude Modulation

Screenshot demonstrating Horizontal Oscillation with Amplitude Modulation

Infinite Scrolling in all directions

Screenshot demonstrating infinite scrolling in all directions by scrolling the contents in a circular pattern

List of all Horizontal Effects

Table demonstrating Modular Game Engine's horizontal scanline effects

List of all Vertical Effects

Table demonstrating Modular Game Engine's vertical scanline effects

Region Blitting Modes

Table demonstrating Modular Game Engine's region blitting modes

Bringing Retro Games to Life

Modular Engine is a powerful, highly optimized platform for building pixel-art-style games. Its efficient modular architecture, sophisticated two-stage rendering system, and focus on high performance make it a must-have for game developers who want to create pixel-perfect retro experiences. With support for advanced scanline effects, easy sprite handling, and performance optimizations, Modular Engine gives you the tools you need to craft engaging, high-performance games that harken back to the dawn of home console gaming. Check out some tech demos below of the engine in action.