Saturday, 30 July 2016

First useful MERPG game engine release


Memapper/merpg-engine (I really should rethink branding of this thing) version 0.1.3, the first one without glaringly obvious bugs AND in which you can make games you can deploy to users, has been released. Pick it (and the accompanying emacs mode if you wish to script your games) up from the github.

A long long time ago

Back in the dark age of 2010 I thought "Hmm, Pokemon Mystery Dungeon is an awesome game. I want to make a clone of its mechanics". I began hacking the engine with C++/SDL, because big boys had told me that you're not anyone unless you're hacking games in C++. Well, they forgot to mention that hacking C++ in Windows (which was my sole OS at the time) is a pain in the arse compared to Linux ("whaddaya mean you want the *.lib files (or whatever Windows called object files) available EVERY time you compile?" - Visual C++ 2010). Alongside I began to write the map editor using Best Software Engineering Practices™ in Java, because at the time I had my first course in Java starting in a month.

A shorter while ago

In about half a year I grew tired of VC++ 2010 ("what the fuck is a multithreaded apartment and why does my code break with 'MERPG STOPPED WORKING - LOOKING FOR SOLUTIONS' if I don't want to live in one?" - Me, 2010) and instead of doing the right thing and migrating to a sane build environment (Emacs, gcc, Linux with modern repositories (ie. not CentOS nor debian), scons or make) I decided to scrap that codebase and either write the whole game in Java or not write it at all. That was a passable plan for a while, but then I got employed and saw what a mess software written in languages without metaprogramming, introspection and macros will become. Always.

I learned to Clojure and rebooted the project. I did that for half a year and found out painfully that using a not useless language is not magical fairy dust you can sprinkle over a project and save it from the certain doom

After half a year of meditating and doing everything but this project, I had an idea: game in which I've cloned the mechanics of another game ISN'T A VIABLE DESIGN DOCUMENT. After that realization, I scrapped the first clojure codebase that had gone bonkers and rebooted the project, with the aim of creating an editor in which you can edit maps and put sprites in a GUI and script the live instance like you'd script Emacs. I like to think that this idea began already a year before with this blogpost, but that post's ideas are mostly either evolved or still unimplemented (because that'd make this engine too specialized lazy developer without enough time).


That particular reboot has finally brought some results. I published memapper 0.1.2 in github a few hours ago, and an hour later I did a bugfix which made the mouse api usable. You can import scripts, sprites (both animated and static) and everything gets saved in the project file. There's an embedded nrepl-server which extends the protocol by adding a few nrepl ops that cider-merpg (the emacs mode that knows how to find and save script files inside the live editor) requires. Thus if you need to run the editor from the source, use 'lein run' and connect manually with M-x cider-connect (or C-c M-c). When you need to run the final game, mark a map as initial map, save the image, copy the editor's jar next to the image and run 'java -jar ./editor.jar --image ./project.memap' in the shell.

I realize that this way of deployment leaves Windows users in a difficult position, with cmd.exe being a piece of shit and Oracle's jre being too dumb and stupid to actually install the relevant binaries in tha %PATH%. I'm sorry about that, and I'm searching for a better way to deploy, but the desktop deployment is the JVM's achilles heel mostly because of Windows. If anyone knows how to generate a jar-archive that runs on double click on explorer.exe AND an installer that for sure installs the jre-dependency in an unbroken state, let me know!

Download MEMAPPER-0.1.3 from github

No comments:

Post a Comment