MS-Engine (Mhat'S Engine) attempts to be a safe, simple and fast cross-platform 2-D multimedia engine written in C++20 for Visual C++, Clang and GNU C++ Compilers. MS-Engine brings together many open-source libraries into one easy-to-use environment controlled by the LUA interpreter. Right now MS-Engine aims to operate on Windows XP and better (x86 plus x86-64), MacOS (x86-64 plus Arm64) and Linux (Ubuntu x86-64).
- Scaleable to the limits of your hardware and operating system.
- Use of LUA interpreter with configurability and infinite-loop timeout.
- Full and safe error reporting with extensive use of C++ exceptions.
- Front-end choice of Unix NCurses, Win32 console or OpenGL 2-D interface.
- Asynchronous image format loading (such as PNG, JPG, GIF and DDS).
- Support for transparent frame buffer objects and window transparency.
- Optional global 8-bit colour palette system for retro applications.
- Asynchronous audio format loading (such as WAV, CAF, MP3 and OGG).
- Full support for Theora (OGV) video with basic keying using GLSL.
- OpenAL audio with samples, streams and sources interfaces.
- Asynchronous basic HTTP/HTTPS client and SSL socket functionality.
- Optional encryption of your non-volatile data with cvars system.
- Safe directory, memory and file manipulation functions.
- SqLite database support optimised for speed.
- (De)Compression supporting ZIP, LZMA, RAW and AES encryption.
- Very fast JSon support via RapidJson.
- Better optimised binaries from semi-amalgamated source code.
- Less than half-a-second startup time to usable on a modern device.
All MS-Engine needs to run is an app.cfg
file in the directory, a non-solid 7-zip archive (ending in .adb
not .7z
) in the directory or a .7z
archive appended to the engine executable. This text file contains a list of CVars that configure the engine the way you want. It can be formatted as Windows, MacOS or Unix so it does not matter about the line ending format, but it does have to be UTF-8 (No BoM) formatted which is what all files, filenames and all strings are handled as in the engine. On Windows, Unicode filenames are automatically converted to and from UTF-8.
You also need to set the app_cflags
cvar properly in the app.cfg
to specify which subsystems you want to enable. The default value is 0
which means show an error to say you did not set a front-end value. The possible combination of flags you can specify are as follows…
Flag | Front-end | Purpose | Namespaces |
---|---|---|---|
0x1 |
Yes | Enable Win32 or NCurses Terminal. | |
0x2 |
No | Enable OpenAL subsystem. | Audio , Source , Sample and Stream . |
0x4 |
Yes | Enable OpenGL subsystem. | Clip , Cursor , Display , Fbo , Font , Input , Palette and Texture . |
Combining certain flags unlocks additional namespaces…
Flag | Purpose | Namespaces |
---|---|---|
0x6 (0x2+0x4 ) |
Enable OpenAL and OpenGL subsystems. | Video . |
The engine looks for the specified file named via the lua_script
variable which is main.lua
by default, compiles it, caches it in the database for faster future access, executes it and waits for a termination request either via a console command, operating system or the script itself and will execute continuously based on the app_tickrate
variable which is by default, every 1/60th of a second (16.6msec) and in OpenGL mode, will execute regardless of hardware limitations as an accumulator is used to skip rendering in an attempt to catchup.
System | Location |
---|---|
Windows | C:\Users\<UserName>\AppData\Roaming\<AuthorName>\<AppShortName> |
MacOS | /Users/<UserName>/Library/Application Support/<AuthorName>/<AppShortName> |
Linux | /home/<UserName>/.local/<AuthorName>/<AppShortName> |
MS-Engine does not allow the use of ..
(parent), the use of a /
(root) directory nor X:/
(Windows drive) prefix for the accessing of any out of scope assets to maintain a sandbox-like safe environment. The only exception is the start-up database name sql_db
and the working directory app_basedir
which can only be set on the command-line. In Windows, all backslashes (\
) in pathnames are automatically replaced with forward-slashes (/
) for cross-platform compatibility as MSVC's standard C library file and Windows API functions support unix forward-slashes natively.
See this automatically generated document for a complete rundown of all configuration variables and scripting functions. LUA core reference manual is here.
A remake of the classic Amiga and DOS game Diggers was made with this engine and available to play. The contents of the self-contained and portable executable are available in the diggers sub-directory.
This YouTube video is a preview of a private (quick and messy) script I made that dynamically builds a fifteen minute video carousel which takes advantage of framebuffer-objects, True-type fonts, triangle rotations, dynamic texture coordinate manipulations, Vorbis audio and Theora video streams, and Lua's incredibly versatile ability to build event and animation systems.
This engine makes use of the following open-source and commercially distributable components that are always updated to the latest versions...
Please read this document for information on how to contribute and the people who have helped contribute to the project.
Development is mainly focused by myself on the MacOS version using an M1 Ultra machine with the latest version operating system between 2020 to present. Infrequent development is on the Linux port with an old i7 Mid-2011 iMac and AMD Radeon 6970 graphics running the latest Ubuntu and uses GcEnx's CrossOver port to maintain both Windows versions since 2020 and was the main development environment between 2006 and 2020 on various high-end gaming and workstations.
Please read this document for the license and disclaimer for use of this software.