Triple Town

Triple Town

Not enough ratings
Hacking Triple Town prices AKA:Breaking the game
By bobrocks
This is a guide on changing the prices in the Triple Town store. Making everything cost next to nothing does NOT make the game more fun, in fact, it makes it way too easy. The process is relatively simple if you are familiar with some basics of working with computers/light programming. You need a couple things to make this happen. JPEXS Flash Decompiler and a text editor (preferably with the ability to format JSON nicely). Once you have these things, just decompile the SWF file, export the JSON data from the prices binary file and make the desired changes.
   
Award
Favorite
Favorited
Unfavorite
Modifying Triple Town Prices
Triple Town was created using Adobe Flash which, 12 years after the game's release, is very easy to decompile. This exposes parts of the game that the designer never intended, allowing us to modify certain aspects including the price of items in the store.

This project started as a plan to write a save file editor. The relevant parts of the save file are hashed and I got bored trying to recreate the hashing method so I started looking into modifying other parts of the code. It turns out simply changing the price of everything was a lot easier than messing around with the save file. I may still come back to that project, however.

Step 1: Get everything you need.

JPEXS Free Flash Decompiler can be found on github. The creator is jindrapetrik, make sure you download from a reliable source. You can do this with a different flash decompiler, but I used JPEXS.

Notepad or an alternative text editor.

Step 2: In Steam, open your local files. You should be in a folder containing your TripleTown.exe file, you will also see TripleTownNEW.swf which is the Adobe File you need to edit. Open this in JPEXS.

On the left, you will see the folder tree, find a folder called "Binary Data". Inside this folder you will find DefineBinaryData (652: Assets_JSON_PRICES).

Right click and select "Raw Edit" which will change the panel on the right. At the bottom of the right panel, click "Edit". The Edit button will be replaced with "Save" and "Cancel"

Click on "binaryData: ByteArrayRange=xxxxx byte" and click "Extract" in the box that comes up. Choose a location to extract the data. Make sure this is a location you will remember.

Open the file you extracted in the text editor of your choice. You will see something like below if your text editor handles JSON properly.

This is it, if you have made it this far and have a basic understanding of JSON, you will be able to make all the changes your heart desires.

Here is the basic JSON format for in-game items. Under the cost object, sometimes the "desktop_price_coins" is explicitly referenced, in others, it is simply "coins". You can explicitly define the desktop price if you like.
{
// Imperial Bot
"code":"ae",
"limit":2,
"cost":[ {"currency": "coins", "price": 1, "regular_price":1000} ],
"unlimited_supply":true
},

When you are done making changes, save the text file.

Now go to JPEXS, click "binaryData : ByteArrayRange..." again and click the "Replace" button. Select your edited text file. Click "Save" at the bottom of the screen, then click "Save" in the menu bar.

Run the game and test your changes.


BONUS: If you play around a little, you will find that you can add more building types to the store which are not meant to be there. This is not a guide on doing so, but the example is in the image above to add the Sky Castle. Play around and have fun!


Tips:
Make simple changes at first and test by loading the game.

The items are referenced by a 2 character ID, for instance, the Hut is code "a3" but a house is code "a4" which is a clue to adding additional items to the storefront.

Have fun with this, you will find that there is a lot you can do like make custom capital cities like the "Hacking Triple Town" island featured in the title of this guide. I recommend you experiment, find more fun things you can do.