FAQ: Things I made with Haxe

A wireframe Haxe icon on a familiar calm blue background

Recently someone pointed out that they never knew that GMEdit was made in Haxe, and that you often don't even know that something was made in Haxe. Which is a pretty good point - for instance, you might suspect that a lot of things that I do have some parts of them written in Haxe, but never exact.

So, as for my activities, I looked over the local projects and formed a semi-comprehensive list of which of my works to date were made in Haxe, and to what extent (excluding ones still under non-disclosure agreements, obviously).

Also includes an opening on why I like Haxe anyway.

What is Haxe

Haxe is a high-level, strictly typed programming language with a powerful cross-compiler.

As far as my intents go, its value is in:

  1. Being able to write for different platforms, but without touching their respective languages (which often lack in high-level language features)
  2. Being able to reuse code between platforms that have no shared languages
    (pretty valuable when writing both games and tools for them, and for client+server uses)
  3. Macros! There's a running joke that virtually any syntactic omission in Haxe can be correct with a macro, and... that isn't wrong.

    Most languages offer either text, token, or expression level macros, each of which has it's own advantages and disadvantages.

    Haxe's macros are functions which return expressions (in other words, you can have custom logic to decide what to return). And if you want to get really fancy, you can even construct fields or types with macros. Or even introduce new compiler targets!

Libraries

  • OpenFL-bitfive (Haxe ➜ HTML5)
    My application-oriented HTML5 backend for OpenFL, eventually retired due to too many breaking changes being introduced with each new OpenFL release.
  • hxpico8 (Haxe ➜ PICO-8 Lua)
    Compiles Haxe to PICO-8's Lua subset. Strong focus on laconic output.
  • sfgml (Haxe ➜ GameMaker)
    Compiles Haxe to GameMaker's scripting language (GML).
    As GML is roughly equivalent to JS in it's features (and not ES6 JS, mind you), having any actual compile-time checking is very welcome (if not essential) for higher-complexity work.

Tools

  • HaxMin (Haxe ➜ Neko VM)
    A Haxe-specific JavaScript obfuscator with Reflection/Type API support.
  • LDLS-m (Haxe ➜ JS + NW.js)
    A purpose-specific IDE that I developed for use in local universities.
  • BitFontReader (Haxe + OpenFL-bitfive ➜ HTML5)
    A tool that allows you to draw your BitFontMaker2 fonts in a conventional image editor and convert to BFM2 format. Also the last project that I used OpenFL for.
    There's also a fancier version that I didn't get around to publishing because I'm meaning to rewrite it all to use FontStruct's library to pipe out TTF files directly.
  • Pixel font generator (Haxe ➜ JS)
    A direct successor of BitFontReader, this tool uses fonthx library (by creator of FontStruct, which itself is written in Haxe) to allow drawing arbitrary-resolution pixel fonts and converting them TTF.
  • Pixel image upscale tool (Haxe ➜ JS)
    A small tool for re-fitting pixel images to specified resolution, generally for use as wallpapers.
  • The Ministry of Fancy Text (Haxe ➜ JS)
    Converts input text to one or other set of decorative Unicode glyphs.
  • Terrasavr (Haxe + OpenFL-bitfive ➜ Flash, HTML5)
    I'm somewhat known in Terraria-related communities for having made one of the most popular tools for the game. As of writing this, the web version had just recently passed 10 million pageviews. The tool allows to customize character files, add items, and generally search the game's item database.
  • Terranion (Haxe ➜ JS)
    Another web-based tool for Terraria, this one focused specifically on viewing stats and relationships between the game's various elements. A largely automated wiki, if you may - can't have inaccuracies when your data is polled directly from the game through .NET API.
  • HeatSigEdit (Haxe ➜ JS)
    A web-based character file editor for Heat Signature.
  • DocMD (Haxe ➜ Neko VM) (screenshot)
    A Markdown variant that I use for most of my documentation pages and blog posts. It's mostly regular Markdown, but supports nested sections (which also nest in output) and has a number of other small tweaks/extensions.

Games

  • Untitled hexagon game (more) (Haxe + OpenFL-bitfive ➜ JS + HTML5)
    I was testing out whether you could have complex levels in mobile web games by baking layers of scenery into static bitmaps. Also, lots of easing.
  • Light & terrain tests (more) (Haxe + OpenFL-bitfive ➜ JS + HTML5)
    Marching squares terrain and a very fancy lighting system.
  • POOL (of doom!) (Haxe + sfgml ➜ GameMaker)
    A first person game that I made for a jam.

Game components

As in, cases where the actual gameplay code is written in another language, while some complex bits are written in Haxe.

  • Mods & collabs (Haxe ➜ GameMaker (mostly))
    Most of my mods use variations and iterations of the same shared netcode base that offers deterministic networking over UDP with order/integrity control and fast resend.
  • Caveblazers Together (Haxe + sfgml ➜ GameMaker)
    As with most of my other mods, netcode is written in Haxe.
  • Nuclear Throne Together (Haxe ➜ GameMaker, C#)
    The mod's patcher, netcode, and modding API bindings are all written in Haxe.
  • Nidhogg (Haxe + sfgml ➜ GameMaker)
    Most of the game's updated netcode is written in Haxe.
    This also allowed for a Discord Store version without substantial rewriting.
  • Nidhogg 2 (Haxe + sfgml ➜ GameMaker)
    Majority of the game's netcode is written in Haxe; console-specific networking uses GM's equivalent of reflection to bind to one or other set of functions.
  • Rivals of Aether (Haxe + sfgml ➜ GameMaker, Neko VM)
    In-progress overhauled netcode, netcode helpers (fast state saving/loading), and additional tools are all written in Haxe.
  • Knight Club (Haxe + sfgml ➜ GameMaker)
    Core netcode is written in Haxe.

Extensions (that is, things that you use from GM):

  • JSON extension (Haxe + sfgml ➜ GML, JS)
    A JSON encoder/decoder with accurate error reporting and additional features.
    When targeting HTML5, a purer Haxe➜JS version is used.
  • INI extension (Haxe + sfgml ➜ GML, JS)
    An INI encoder/decoder which maintains order, comments, supports escape characters, and iteration over sections/keys - unlike the lighter set of built-in functions.
    Similarly, HTML5 uses a Haxe➜JS build from the same source code.
  • Native Cursors (Haxe + sfgml ➜ GML, JS)
    A CUR encoder written in Haxe and paired with WINAPI C++ and JS APIs accordingly.
  • Debug log server (Haxe ➜ Neko VM)
    A miniature external log window that receives debug messages over TCP and displays them.
  • ZIP writer (Haxe + sfgml ➜ GML)
    An adaptation of Haxe's standard library zip writer for use in GameMaker.
  • cmnChat (Haxe + sfgml ➜ GML) (gif)
    The advanced chat/command log that you see in my recent works.
    Has text selection, clipboard use, command/argument auto-completion, native feel.

Smaller tools:

  • BMFontToGmx (Haxe ➜ Neko VM)
    Converts BMF font files directly into GM font resources.
  • GmxGen (Haxe ➜ Neko VM / C#)
    Updates GameMaker extensions to match hinted definitions in source files.
  • GMVisualizer (Haxe ➜ JS)
    Takes text dumps of GameMaker: Studio objects and prints them to HTML/BB code with syntax highlighting and event/action type icons (example in action).
  • YYDebugView (Haxe ➜ JS)
    A web-based tool for rescuing freshly lost source code from GM's temporary files.
  • YYTextureView (Haxe ➜ JS)
    Allows to view/export/replace texture sheets in GM games.
  • RerouteAudio (Haxe ➜ Neko VM)
    Modifies GM asset packages to automatically organize audio files into subdirectories
    (instead of dumping them into one directory by default)

Bigger tools:

  • GMLive.js (Haxe ➜ JS)
    A web-based GML➜JS compiler and tester.
    I later reused parts of its compiler for other projects, including GMLive.gml
  • GMLive.gml (Haxe + sfgml ➜ GML, Neko VM)
    A livecoding extension for GameMaker, featuring a fairly complete GML compiler and interpreter compiled to GML itself. Helper app was written in Haxe➜Neko VM.
  • GMEdit (Haxe ➜ JS + Electron)
    A high-end code editor for GameMaker - has feature-complete syntax highlighting, auto-completion, and even syntax extensions.
  • GMHyper (Haxe ➜ C++) (coming soon)
    A high-end augmentation system for C++ code generated by GameMaker - accepts hint comments and rewrites generated code to use strict types or case-specific variations of functions. Also offers enhanced debugging and C++ injection.

Related posts:

4 thoughts on “FAQ: Things I made with Haxe

  1. As someone whose gripe with GM has always been the lack of classes, privacy, and compile time checking, learning about sfGML is pretty exciting. That’s something I’ll happily pay for. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.