Windforge

Windforge

View Stats:
Elcoron Aug 19, 2014 @ 4:59am
Modding BIG.FILE and others
Dear Developers,
You are planning to add features like modding support and creative mode but there already are some ways for the curious (like me) or impatient to change the game's behaviour.

I would like to use this thread to discuss findings and post instructions to change things in the game by modding the game files - namely the BIG.FILE.

If you are willing to allow this of course. I am asking for permission to do so because on the one hand modding the game files directly can allow access to things that all or some players are not supposed to access but on the other hand it can allow players change things to their liking and improve the game experience. Also getting to know how the game works might be benefitial for later modders.

Please let me know what you think.
< >
Showing 1-2 of 2 comments
asdfasdf Aug 21, 2014 @ 1:34pm 
I'm totally fine with this. Thanks for asking :) Once I get the mod support in, people will be able to do this anyway. I'm also planning on making many of our console commands available for people to use in the next patch.

Please back up your stuff if you hack things. Also, if you run into any bugs, please reverse any changes and retest it before letting us know.

Elcoron Aug 21, 2014 @ 4:57pm 
Thanks for allowing this! And thank you for the reminder to make backups before messing around! That bugs/errors/glitches in a modded game are not representative for the unmodded game should go without saying.

MASSIVE EDIT:
So, let's get started!

It seems that *everything* that is related to the game's content - like .lua-scripts, predefined areas and even graphics - is kept in "BIG.FILE". The file is located in the "Data" folder in the main Windforge directory. It can be interpreted as an uncompressed archive. (Almost) every file of the game is put there byte by byte and one after the other. A header at the beginning defines for each individual file (in this order) its length in bytes its position (in bytes) and the full path name (like "../Data/Objects/Characters/Inventories/Chapter1StartInventory.lua).

As I learned more about the file and the game handling its content I realized that it is not advisable to edit the file itself primarily because there is a much easier and moe flexible way to change how the game behaves. If you edit "BIG.FILE" you must ensure that the information in the header matches the content. Adding or removing just one byte in the file will most certainly break it. It is safe however if the start and end of (for example) a .lua-script remain in their exact place. I will still explain the basics though.

Example:
To have most items in the game one could change the player's starting inventory and then start a new game. This can be done by searching for the line
startingInventory = "../Data/Objects/Characters/Inventories/Chapter1StartInventory.lua"
and replace it with
startingInventory = "../Data/Objects/Characters/Inventories/BuildingInventory.lua" -- a
Note the two dashes at the end followed by a letter. This is a comment and will be ignored by the game but it is needed here to fill the bytes that were deleted by changing the inventory to load. "BuildingInventory.lua" is already defined and we just selected it instead of the regular "Chapter1StartInventory".

Though keep in mind the following:
One can not simply open the file in any text editor because of is size and binary content. Unfortunately Notepad++ is one of those editors that refuse to open it because of the first reason. The regular Notepad that comes with Windows may be able to open and display the file but saving it - even without changes - will break it. The game crashes on launch.

I used Vim[www.vim.org] to view the file though it still 'fixes' the end of the file with an additional byte (which should technically have no effect on the game). To be save I would recommend an actual binary/hex editor (I used HexEdit[www.hexedit.com]) to make changes.

Now the easy way:
The game already offers some sort of modding support. It can load files from "BIG.FILE" or from actual folders. "BIG.FILE" defines in its header were the files should be if they were not part of "BIG.FILE".

Placing a file in its correct folder and making sure it is not defined in "BIG.FILE" makes the game load the file without the restrictions of the archive in size and position. "BIG.FILE" is checked first.

The only problem: Extracting the archive's content first.
Fortunately all needed information is there and I was able to write a small program that does exactly that. (Right before I saw here that someone else has done that before me. Why?!?)

After extracting all 15260 files move or rename "BIG.FILE" so the game does not find it anymore and uses the separate files instead.

The separate files can be modified easily. To switch to the "BuildingInventory" like before just open the file "Data\UI\Pages\PlayerCustomizationPage.lua" in a text editor (Notepad++ works now! Yay!) and change the line
startingInventory = "../Data/Objects/Characters/Inventories/Chapter1StartInventory.lua"
to
startingInventory = "../Data/Objects/Characters/Inventories/BuildingInventory.lua"

You can also edit the inventories themselves or create a new one like "MyModdedInventory.lua". They are all found in "Data/Objects/Characters/Inventories/". Maybe you want to add items that "BuildingInventory.lua" does not contain like "AetherkinAmmo" or "AetherkinHeavyAutoTurret". In addition the "BuildingInventory" contains some items that do not exist like "King" but there is a placable item called "KingSiegmund" (maybe an outdated name?) these are just noted in an error message in your error log. You will find a complete list of all items in the game in "Data\Objects\Crafting\CraftingItems.lua".

Said file enables you to modify the items too! How about a Sausage that destroys ilands of the size of the whole screen in one single hit? No problem. Just look for the item and change the corresponding value.

If you are aiming for an inofficial creative mode you might want to unlock all the recipes too. Either give yourself the corresponding recipe books or edit "Data\Objects\Crafting\Recipes.lua". To unlock all of them from the start change the line
startLocked = true,
to
startLocked = false,
for every recipe exept for "FireBlaster", "Grenade360", "DieselArmour", "AntiGravityBoots". This has two reasons. Firstly the game will crash if you do and secondly these four items are the reward for backers who reached a specific tier during the kickstarter campain. Unlocking them if you are not a backer of that tier or higher would be disrespectful to those who actually supported the game in that way.

All recipes that you unlocked by editing "startLocked" will be available to every character you play even if you load a saved game.

To have your creative mode without interfering with the rest of the game I suggest you make the changes you like to the recipes and the starting inventory. Then start a new game and save it as your "Creative Mode". After that revert all changes that you made to the files by restoring the backups (that you hopefully made) or simply put the unmodified "BIG.FILE" back in its place. Load the saved game and enjoy building freely.

Combination of the editing methods to change the starting Inventory:
If you do not want to extract everything from "BIG.FILE" for some reason then you can combine both methods for flexibility. Just copy the definition of "BuildingInventory.lua" into a new file "MyModdedInventory.lua". To find it search for "ItemList =". The definition consists of
ItemList = { [...] } QuickSlots ={ [...] } EquipSlots = { [...] } Clothes = { [...] }
Make sure to copy everything into your modded inventory, change it as you like and replace in "BIG.FILE"
startingInventory = "../Data/Objects/Characters/Inventories/Chapter1StartInventory.lua"
with
startingInventory = "../Data/Objects/Characters/Inventories/MyModdedInventory.lua" -- a
similar to the first example.
Last edited by Elcoron; Sep 7, 2014 @ 4:50pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50