Command Line Interface


Jump to: navigation, search

A Command Line Interface (CLI) is a way to communicate with/use a program exclusively through a command line, or terminal. This is especially useful in a Headless system or for scripts, such as performing operations in bulk, or for users who prefer the command line or don't have a Graphical User Interface (GUI). Because of this, most compilers and linux software provide a CLI in addition to, or in place of, a GUI.

Brief ENIGMA history

Enigma started out as a CLI exe only. LateralGM was forced to communicate to it through this limited fashion, writing the game to a file, passing the filename to the exe, and pipe-reading ENIGMA's output from the exe and files that it produced, which was much slower than it had to be.

One day, IsmAvatar figured out how to get Java and C++ to communicate via DLL with the use of JNA, which allows LGM and ENIGMA to share memory structures and make interactive calls to each others functions, which is much faster and much more dynamic. Since then, ENIGMA has redirected itself towards being a DLL, and the build process has been streamlined for that purpose. As a result, ENIGMA became almost exclusively a GUI program.

Due to the thee-tier architecture of LateralGM (front-end back-end separation), it isn't hard to use a headless LateralGM - that is, just the data and logic tiers, without the front-end presentation tier. As such, it wasn't long before this fact was exploited, and combined with the Plugin to communicate with the dll, to construct a Java CLI for ENIGMA.

Native Command Line

The native command line interface project on Windows 8.1

In preparation for the development of a compiled and native IDE a native command line project was started. So far it can load basic GMX games but has quite a few bugs. It links against compileEGMf, lodepng, and zlib for compression. It is intended to work cross-platform but it may take a few extra steps until the kinks are worked out.

A few things that need completed:

  1. Font glyphs, we need a way of having a default font, could probably just store it with the CLI, and we need to convert GMX glyphs to ours which also may be a waste we may need to consider passing the already packed font texture to ENIGMA instead of asking it to pack it for us.
  2. Tiles, these are not loaded yet probably because there is a bug that stops them from loading in LGM as well.
  3. Postponed references system needs worked out.
  4. Drag and drop action parsing is not completed.
  5. Certain kinks such as specifying the file path and command line arguments need standardized and approved by everyone.
  6. A way to modify ENIGMA settings needs worked out, or we should hack the GMX format to store the settings in there.


Currently, ENIGMA's CLI is very primitive. Its usage is as follows:

  1. Ensure that ENIGMA is already fully checked out and compiled
  2. cd to ENIGMA's directory.
  3. java <jvm options> -jar plugins/enigma.jar <>

The only options available are optional jvm options (e.g. max heap size, so you don't run out of memory: -Xmx=500m) and the game file that you wish to compile (mandatory). Everything else is assumed as defaults, such as the compilation platform (usually the same platform that you're running from) and the outname (simply replaces game_file's extension with the target extension, like exe on windows).

Personal tools