Official Sixty Four Wiki
Tap into the secrets of the Universe

Sixty Four Modding

From Official Sixty Four Wiki

Discord.png

Useful links:

Sixty Four Guides

Mods allow to change game code in Sixty Four and customize different aspects of the gameplay.

Be mindful that modding isnt officially supported and you do it at your own risk.

Installing mods[edit | edit source]

- Go to the game folder (reword: steam, right click on the game, manage > open local folder)

- Enter win-unpacked/resources/app/game

- Create a "mods" folder if it doesn't exist. Once you've created the folder, the contents of the "game" folder should look like this:

Screenshot from 2024-03-21 21-39-34.png

- put mods JS files in the newly created "mods" folder

- edit index.html (for example, here we include CompactShop.js, ExplicitEye.js and ConstantPrice.js)

        <!-- Existing script tags already in the file -->
        <script type="text/javascript" src="scripts/words.js?v=2"></script>
        <script type="text/javascript" src="scripts/codex.js?v=2"></script>
        <script type="text/javascript" src="scripts/game.js?v=4"></script>
        <!-- <script type="text/javascript" src="scripts/post.js?v=3"></script> -->
        
        <!-- Add your mods here, one line per mod -->
        <script type="text/javascript" src="mods/CompactShop.js"></script>
        <script type="text/javascript" src="mods/ExplicitEye.js"></script>
        <script type="text/javascript" src="mods/ConstantPrice.js"></script>

Make sure you add these lines near the top of the file, after the existing "<script>" tags. In the current version of the game this is around line 14. The mods must be added here to ensure they are available when the game is actually started, which happens in the bottom of the index.html file.

Note that the index.html file is rewritten every time the game is updated. You will have to re-insert your mods after each update. This is very likely to be improved in the future.

Finding mods[edit | edit source]

For now there is no mods library

  • Mod Autoloader : adds a "MODS" menu item and a control panel for enabling/disabling mods and configuring settings (if the mod supports the autoloader). Automatically loads all other mods that you install without adding them to the index.html file.
  • Compact Shop : make the shop even more compact when you use the compact shop button.
  • Constant Price : make machine price to be constant.
  • Explicit Eye : make the Fill Director indication more visible and useful.
  • Small Flower : make the flower smaller to easily see what's behind.
  • In-game Console : add an in-game console with several commands like teleport, resource give/take, building place, coordinate capture etc.
  • Drag to Build/Delete/Upgrade : allows you to hold down the mouse button and drag the mouse to build, delete or upgrade multiple structures.
  • Fast & Furious Rock : modify the Hollow Rock spawn rate and maximum.
  • Faster Resonators : modify the speed and power of the two lowest tiers of Resonator.
  • Improved Silos : increase (double) the charges held by the two types of silos to reduce the need to micro-manage refills. Can also make silos infinite, never needing to be refilled.
  • Individual Volume : adjust the volume of individual sounds in the game.
  • Pause : adds the ability to pause the game (and build/sell while paused) by pressing the "P" key.
  • Reload : adds a main menu item that reloads the game. Useful for mod authors as a much faster way to reload everything than restarting the game.
  • Insight : shows boxes with detailed information about entities in the game when the "V" key is pressed.
  • Build Upgrades : allows structures which are upgrades to other structures to be built without first building the lower-tier structure. Also allows building Hollow Fruit directly on a Hollow Stone. Does NOT allow one-of-a-kind structure (streaming tower, recycling tower, etc.) upgrades to be built without first building the lower tier.
  • Grid Lines : adds the ability to press "G" to toggle a visual grid, optionally with alternating colors for every 2nd and 10th grid position.
  • Darken : darkens the playfield with a configurable overlay. Supports choosing a color, intensity and blending mode for the overlay.
  • Dynamic Prices : allows to scale the base price and the price increase rate of the machines.
  • No HUD : allows to hide the interface by pressing "H". Optionally, can also hide the resource bar, resource transfers, and cursor.
  • Dynamic Background : allows to change the background color (#24242c by default). To get the changed background under the machines you also need the sprite overrides (read the stuff at the top of the mod file).
  • Industrial Furnace : adds a new machine, called Industrial Furnace, that is an upgrade to Beta-Pylene Oxidizer. Requires custom sprites (read the stuff at the top of the mod file).

About the Mod Autoloader[edit | edit source]

When using the Mod Autoloader (which is itself a mod) you only need to add this one mod to the index.html file. All other mods are loaded automatically and a new menu item "MODS" is added which allow enabling or disabling them and changing the various settings of mods, when the mods are built with support for the Mod Autoloader. The Mod Autoloader will also support loading standard/legacy mods but will not make it possible to enable/disable or configure settings for this kind of mod, and it will always be enabled as long as it is present in the "mods" folder.

A mod is made compatible with, and dependent on, the Mod Autoloader, in the following way:

  • The mod's JS file must export a class definition.
  • Properties like label, description and settings are defined as properties on the exported class.
  • If the mod must replace methods on game objects, these must be returned from the getMethodReplacements() function.
  • Any behaviors that are NOT covered by class properties or method overrides must be applied in the init() function (for example: keypress event listeners).
  • The mod must not trigger game modifications in the constructor method!

If you are a mod author and wish to add support for the Mod Autoloader, see for example the Demonstration/Reference mod. This example class is fully annotated and explains all the best practices that are currently supported.

Video guide[edit | edit source]

User "infinitebedrock" created a quick video guide that shows how to download and install the mods.

Creating mods[edit | edit source]

The game is mostly a simple web page with js classes set in global scope.

It's preferable to create a file that monkeypatch the game with restricted edits.

General advice[edit | edit source]

Most of the time you want to make modification and don't want unintended side effects, so to keep your mod isolated from the rest of the game and of other mods, it's generally better to put the code in a IIFE

(function () {
    /* your mod code here */
})()

Style modification[edit | edit source]

document.head.appendChild(document.createElement("style")).innerText = `
 /* Your modification here */
`

Code modification[edit | edit source]

/* Modify method Game renderUnfilled */
Game.prototype.renderUnfilled = function () {
 /* your modification here */
}

Codex modification[edit | edit source]

(function () {
  let _abstract_getCodex = abstract_getCodex;
  abstract_getCodex = function () {
    const codex = _abstract_getCodex();
    /* modify codex as you like */
    return codex;
  };
})();

MacOS Modding[edit | edit source]

macOS modding instructions are:

  • Install Homebrew. We need it to unpack the ASAR archive containing the game.
  • Open Terminal
  • Install Node: brew install node
  • Move to the game's resource folder, which should be at: cd ~/Library/Application Support/Steam/steamapps/common/Sixty Four/sixtyfour.app/Contents/Resources
  • Unpack ASAR file: npx @electron/asar extract app.asar app.asar.unpacked. The folder should already exist, but as far as I can see it's just from one of the dependencies updating itself
  • Move out the packed game: mv app.asar{,~}
  • Move in the unpacked version: mv app.asar.unpacked app.asar
  • Do the file edits as per the wiki. The app.asar correspond to Windows' win-unpacked/resources/app path
×
Cookies help us deliver our services. By using our services, you agree to our use of cookies.