Standalone release guide/Emscripten

From MZXWiki
< Standalone release guide
Revision as of 21:25, 16 May 2020 by Lachesis (talk | contribs) (Created page with "Setting up the HTML5 MegaZeux package for a standalone release is fairly straight-forward, and a number of options exist for this. All options require that your game is packag...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setting up the HTML5 MegaZeux package for a standalone release is fairly straight-forward, and a number of options exist for this. All options require that your game is packaged into a ZIP archive. Other archive formats will not work.

DigitalMZX

The easiest way to get a working HTML5 copy of your game is to just release it to DigitalMZX. Register an account and log into the front page, then select "Upload a game!". Your game must be packaged in a ZIP archive. Once your game is uploaded, an admin can automatically configure it for the web player and approve it.

Note: the DMZX web player is regularly updated to the newest MegaZeux release, so you don't need to worry about updates.

Note: you must log in to the front page separately from the forums/wiki; DMZX still does not have a working SSO system.

itch.io

You can also create a standalone package to embed at itch.io. Download the latest HTML5 release package, drop your game ZIP into a copy of the MegaZeux ZIP, and edit this portion of index.html:

files: [
	["assets.zip", ""], // used by MegaZeux - do not touch!
	["my_game.zip", "game/"] // edit this one - should contain your game
],
config: // edit this string to set config.txt options for your game.
	"# Set the startup path and world.\n"+
	"startup_path = /data/game\n"+
	"startup_file = caverns.mzx\n"

You can also delete the docs/ folder in the archive, which will make your download package smaller. All other files in the release archive are mandatory (including LICENSE).

Finally, upload the combined MegaZeux+your game package to itch.io.

Note: you are responsible for updating your package if a new MegaZeux version is released. However, this might not be necessary if the current release of MegaZeux you are using is fairly stable.

Self-hosted/other

For other platforms (including hosting your game yourself), you may need to extract the MegaZeux HTML5 release directly into the path it is intended to be loaded from and place your game ZIP archive in the same path. Configuration is the same as for itch.io (see above). As the .js and .wasm files are large, it may be worthwhile to compress them.