Mechanic Miner

Mechanic Miner

Not enough ratings
Texture Packs
By Thinzy
This guide will teach you how to apply your own textures to the game.
   
Award
Favorite
Favorited
Unfavorite
Introduction
Heya, if you're here I suppose you're interested in creating and/or using texture packs for Mechanic Miner. This guide will teach you how to create and use texture packs as well as give you some knowledge on the behind the scenes of how this game loads assets. This will be done using my texture pack creation tool, MM Mod Tool.
Downloading MM Mod Tool
To download MM Mod Tool, go to it's Github repository[github.com] and then go to it's releases page[github.com].

Choose the latest version, and download the exe file.

From there, you should be able to use the tool. Windows Defender will most likely pop up since the program isn't signed, if this happens just press "read more" and then "run anyway".
Using MM Mod Tool

















The mod tool should be fairly straight forward to use, you'll need to load the mechanic miner asset files as well as specify a workspace folder in order to dump and/or repack assets.

Grabbing the asset files
The asset files are located in Mechanic Miner's local steam folder, you can get to this by right clicking on Mechanic Miner in steam and choosing properties. From there select browse local files and file explorer will open to it's directory.



As the mod tool says, it requires both main.mechanicminer_asset_64 and main.mechanicminer_asset_64_links files.

Make sure to copy the asset files and save them elsewhere
You will require your original version of the asset files if you wish to make changes to the texture pack, you'll also need this to revert changes if you want to go back to vanilla textures. I have saved both files to my desktop so it's easier to find them.

Now that you've located these files and saved them elsewhere, copy their new directory addresses (not the directory addresses of the originals!) and stick it in their respective slots in the mod tool.


See how it says desktop? For the love of all that is holy, make sure you're using the directory addresses of the copied asset files.







The Workspace folder
The Workspace folder is going to be the place where you'll either want to dump or repack assets, this has nothing to do with Mechanic Miner's folders, it's completely separate. You can call this folder whatever you want, just make sure it's empty (it doesn't have to be, I'll just judge you for it). Grab your folder's directory address and stick that in the workspace folder slot.


Once you've selected the folder you should be able to choose one of the many asset options.









Additional Notes
Currently you can only choose one workspace folder, so if you dump all the assets there AND you plan on repacking some to make a texture pack, please move the assets out of the file and only keep the assets you want to use in there. Nothing bad will happen, it'll just create a texture pack that's unreasonably large. (The reasoning is explained later on).

Repacking
The way the tool repacks is it grabs each asset by its index number, so when you're editing the files make sure to NOT rename them (e.g if an asset is called asset_3234.png leave it as is). Repacking can take some time depending on how many assets you have changed, as the additional notes above says; it will be faster if you're only repacking the assets you've edited. Once the tool is done you will see a new asset file in the workspace folder, this is your fresh texture pack. To use this just replace the one that is found in Mechanic Miner's game folder. (Make sure to have a copy of the original as said earlier, otherwise you can't make more texture packs or revert to vanilla textures)
In-depth look into asset files
Links File Overview
The links file contains 8-byte offsets which, when reversed and totalled, point to more offsets within the Assets file. These offsets provide all the asset locations and keeps them organised.

My first version of the MM Mod Tool didn't use the links file meaning that every asset that got dumped was disorganised. Trying to find all of John's sprites was a nightmare but thanks to Finn, the lead developer of the game, he helped me discover the secrets of this file which in turn has led to ordered John sprites, woohoo!

Asset File Overview
The Asset file contains PNGs of all Mechanic Miner's sprites and backgrounds, it also contains WAVE files for all the game's sound effects and music.

Asset File In-depth
Similarly to the Links file it contains 8-byte offsets, which when reversed and totalled, point to assets. Well, they actually point 4-bytes before the assets, more into that in a second. Each of these 8-byte offsets are saved in the Links file.

Before each asset is 4-bytes which, when reversed and totalled just like the offsets, reveals a number. This number is the size of the asset. Originally to find the PNG assets in the Mod Tool I made it look for the start of a PNG file (89 50 4e 47 0d 0a 1a 0a) and then stored the values until it hit the end of it at the IEND chunk. But after learning about these 4-bytes I have changed it so that it stores the values up to the size specified. This is helpful as it will allow me to rip out and repack WAVE files easier as they don't have a static end chunk, it also takes out the possibility of being locked in a loop due to not finding the end chunk of an asset.

The way my Mod Tool repacks currently is not 100% optimised, the reason being is that it attaches any changed asset to the end of the file and then modifies the offset to point to that instead of the vanilla asset. What I've been trying to do, to make it more efficient and to make the file less bloated, is to insert each modified asset where it would be located instead of attaching it to the end, the problem with this however is the fact all the offsets in both files have to be readjusted each time an asset is edited. If anyone wants to take a shot at this, feel free to!
Coming soon
  • WAVE file dumping and repacking
  • Optimisation of Mod Tool
  • Mechanic Miner Texture Pack files (.mmtp)
  • Additional dumping options

The .mmtp files will be used for a Texture Pack Manager that I am planning on making so that sharing texture packs is easier for everyone!

Now get out there and make some Texture Packs!


Happy Texture Packing!

- Thinzy