Threads
Bretagne, Francerezoons7 years ago

Hello everyone!

A few days ago, thisishowmymindswork made another HUGE discovery. (Thank you a lot!) He found a flash decompiler software that allows us to actually make some modifictions to the file itself. Since all the game is basically contained in the ots.swf file in the game folder it means that we could potentially modify the game how we want. In practice we're still limited a bit so i'll try to explain all the things that we CAN and CAN'T do, as well as talking about what we should do about the different possibilities of abuse with it.

The software used is JPEXS Free Flash Decompiler that you can download here: https://www.free-decompiler.com/flash/download/

After finishing installing it, launch it then load the file ots.swf and you should get this:

http://puu.sh/pUJ6Y/1c5c6b3478.png

The folders images/sounds/binaryData contains all the sprites/music/SE/text data of the game. We can very easily modify these files. Right click on the file then select "Export selection". This will make a copy on your computer that you can modify how you want. After finishing modifying it, right click again on the file you want to replace then select the one on your computer you just modifed.

http://puu.sh/pUJxa/0d9b71ecc2.png

After finishing your modifications, just save (it will take a few seconds) and that's it! (BTW, i think that's the right moment to warn you that you should keep a back-up copy of ots.swf) Modifying the image/sounds assets is pretty straighforward. Replacing the text data (that contains all the room names, NPC dialogues etc...) is a bit more tricky and i detail it in my (updated) guide on how to make custom levels you can find here http://www.speedrun.com/ots/thread/n64k0 This allows us to do all kind of modification. Here is a little showcase of some of them:

Now, let's take a look at the "script" folder that contains all the game code. Clicking on a file will show it's content.

http://puu.sh/pV0ik/d5339878cd.png

Unfortunately, we can't modify it directly. (Well, you can do it but it will corrupt the file) In order to change something you have to click on the part you want to modify. This will open a second window with an alternative (and less comprehensible) code in it.

http://puu.sh/pV0rC/3d90c4ec04.png

If you want to modify something you have to modify it there. If it's just changing a constant it's pretty easy.

http://puu.sh/pV1ec/e267157e81.png

Then saves and enjoy!

http://puu.sh/pV1aw/f8d3d9997e.gif

Now, i don't have a good enough knowledge to tell if we can make more complex changes in the code than just constant changes and deleting stuff. I'll let people with actual knowledge of programming telling this.

Anyway, the introduction of this new tool raises several points that we would like the community to discuss together.

  1. What should we do about the potential abuses? Imposing more iconvenient rule that would make cheating impossible or changing nothing and just letting the mod be more vigilant? Also:

  2. Is it possible to detect someone cheating, even if he just did minor changes?

Finally,

  1. Is there some modifications that would be considered authorized in a speedrun? Like changing some textures, some room names or making the game not auto-saving by default.
AfterDarq, MIDIbusker, and PrettzL like this
Bretagne, Francerezoons8 years ago

Hello everybody,

I don't know if it was known before but i found out that you can go over Forgotten Ruins very similarly to the OOB over Jumping Over (http://www.speedrun.com/ots/thread/v4a9s) like this:

The timing needs a lit bit of training to get used to but it's not that difficult. The hardest part is the very short time window you have to <shoot right>+<jump right> at 0:11.

It's pretty useless for any% runs. The current any% route is 5s faster (IGT). It's even worse for real time because there is a life capsule in the way which pops up some dialogue.

But for collectible%, it's a gain of about 10 seconds because it's on the path of a life capsule. It also means that you can fail it 1~2 times (depending how you fail) and it would be still worth it.

(P.S. Dont forget to jump over the two OOB screens or you'll get a collision glitch.)

Edit: Apparently, it's possible to do it faster and for this OOB to be beneficial for any% runs. More details here: http://www.speedrun.com/ots/thread/edlcz/1#yq3hx

PrettzL likes this
Bretagne, Francerezoons8 years ago

It was discovered a while ago that level files are just XML files easy to edit. Then, megadrive identified the software the levels mare made on. Next, prettz managed to get us all the assets of the game and finally, thisishowmymindworks found a software allowing us to mod the game. Using all these ressources, we can now make our own custom levels. Of course, since the game was not programmed for that it's a little bit tricky.

I'll then try explaining how to make custom levels as easily as possible. For the moment we are still limited to what we can do but i'll update everything as soon as possible.

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ I) Setting-up the level editor ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

First, start by downloading Ogmo editor ( http://www.ogmoeditor.com/ ). Then download these files that will be necessary to work with the editor. https://www.dropbox.com/s/4b3lkrtmmtfo3bl/OTS%20level%20editor.zip?dl=0 (keep all these in the same folder)

After downloading everything, open ogmo then go to Project->Open Project...->OTS level editor.oep You should get this:

http://puu.sh/jv4XL/d1f841b52e.png

Before starting to create your level you have to set-up it's properties. Go to Level->Level Properties... Here, you can configurate these level properties:

Level Size: The level size. You can have bigger level but it makes level transitions more complicated so, i would highly suggest not using it. Backgound: Change the background of the level rain: Choose if there will be rain in the level. thunder: Choose if there will be thunder in the level. message: If you want a pop-up message to be triggerred after entering the area, put its label here. See the "Adding custom text" section. messageOnce: Not important. darkness: Choose if there will be darkness in the level. right/left exit: See the "Connecting multiple levels" section music: Choose the music that will be played during the level.

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ II) How to create your own levels ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

After finishing the set-up, you can start to make the levels. Go back to the main tab and look at the layers on the upper left of the screen. They correspond to different layers of the level. I'll start by explaining the more important one:

Solid: With this layer you create the solid blocks of the level. Basically, everything your character can touch, walk on, etc... For example:

http://puu.sh/juzlH/ee8b8c02e6.png

(Warning! Slopes are not solid block)

Left click on a block make it solid and right click do the opposite. You also have different tool in the upper right corner to help you.

https://cdn.tutsplus.com/gamedev/authors/porter/ogmo-editor-guide-07.png

Front: This layer contain the tiles of the level. Make sure the Tileset is set to "Front01" in the Tile Palette. The tiles are all the blocks you see on the screen when you play. Solid Block are all invisible so you should probably put tiles on all your solid blocks. (unless you want to make invisible wall or stuff like this) In order to do that, choose a type of block in the tile palette in the bottom left corner then click on the square when you want to put it. For example:

http://puu.sh/jv6sc/896da49f31.png

Same as before, you have different tools in the upper right corner to help you.

https://cdn.tutsplus.com/gamedev/authors/porter/ogmo-editor-guide-08.png

Objects: This layer contain all the interactive stuff you can encounter. To put them on the level, it's the same as for the tiles, click the entities then click on the level but if you want to remove them you'll have to use the eraser tool.

For example:

http://puu.sh/jv5Dv/98628206b3.png

Warning! The comportment of some objects is different depending on what's written in the "selection" tab (bottom right corner) which appear when you select an object.

door: If it's a door you go into, uncheck "exit" then write the coordinate of the level the door makes you go to in "destinationX\Y". If it's a door you exit, check "exit". The coordinate of a level are in it's name. All level have a x_y.oel name with (x,y) their coordinate. door2: Enter an id for the door. It will open when you'll talk with the alienGuard npc with the same id. door3: It's the door that closes when the boss spawn. I have no idea how it works so avoid using it. brute: If you want it to face right, let side=1. If you want it to face left, put side=-1. block fragile: If you check "extra fragile" you'll get it's extra fragile equivalent. all npc except grigori: Put the label of the message they'll say. See the "Adding custom text" section. alienGuard: Enter the id of the door they will open when talked to. sp_messageArea: Put the label of the message that will trigger when entering the area. See the "Adding custom text" section.

Note that for the slopes you need to put the object AND the tile otherwise you'll get invisible slopes. Moreover, lava/water are handled a bit differently than other objects. Instead of putting a lava/water in each square you should only put one and then use the "resize" tool on them.

And finally, you also have some tools for this layer

https://cdn.tutsplus.com/gamedev/authors/porter/ogmo-editor-guide-09.png

(Ignore "Add node/Insert Node". Also, the "resize" option only works on: water, lava, reference, bg_mountais, sp_messagearea and sp_endgame.)

Finally, we finish we the less important layers:

Reference: In this layer, just choose if you want to put the "reference" entity in the level or not. It gives a little cool effect in the level. All OTS levels have it even if it's not really noticeable. FarBack: In this layer you can put one of the four bg_mountain if you want. Back: Make sure the tileset is set to Back01 in the Tile Palette. In this layer you choose the tile that will appear in the background. BackDetails: I don't understand this one yet. Ignore it. BackDrop: In this layer you can put any object starting with "bd_". They are backgrounds details. FrontDetails: Make sure the tileset is set to Details01 in the Tile Palette. In this layer you add little details to the level and the front tiles.

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ III) Integrating your level into the game ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

After finishing your level, the next step is to integrate it into the game in order to play it. First, go to level->Save your level as... and save it as "x_y.oel" with (x,y) being the coordinate of your level. Be carefull not choosing an already used coordinate in the game unless you want to overwrite a specific level. The less intrusive way of putting your level into the game is by making a door at the starting area that goes into the level (in this case, don't forget to add an exit door where you want the player to start your level). In order to do so, go to Level->Open level... and open the level 5_5.oel (the starting area) in the game level directory (C:\Program Files (x86)\Steam\SteamApps\common\outtheresomewhere\level).

http://puu.sh/jwqLB/ca74bec6dd.png

Then add a door leading to your level as i explained before, save then exit. (Of course don't forget to have an exit door in your level) After finishing everything, add your level into the game level folder and if everything was done correctly you should be able to play it.

http://puu.sh/juATE/77984b281d.jpg

http://puu.sh/jv5Wq/7d3f115c5a.jpg

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ IV) Connecting multiple levels ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

So, now you know how to make a level. That's great! But that's not enough. You probably want to make multiple levels connected between each other. Here are the three ways of doing it:

Using screen transitions: First, you need to know a little bit more about level coordinate. All level are saved as x_y.oel with (x,y) being their coordinate. These coordinates represent the position of the level on this giant map:

http://puu.sh/jxtoh/26798337dd.png

I put in black all coordinates used by the game. You can find the full map with all levels and their coordinates here https://www.dropbox.com/s/5dmvb0e2uh6vywq/OTS-Map_num.png?dl=0 (made by Timbouton)

When moving from a level to another using screen transiton it's the same as moving from one case on this giant map to another. So: if you're in level x_y.oel and exit to the right you'll appear in level (x+1)y.oel if you're in level x_y.oel and exit to the left you'll appear in level (x-1)y.oel if you're in level x_y.oel and exit up you'll appear in level x(y-1).oel if you're in level x_y.oel and exit down you'll appear in level x(y+1).oel

For example, here is level 19_4.oel and it's surronding.

http://puu.sh/jxubj/d072585856.png

Using Doors: As explained before, you can put door leading to a specific level. If this level contains an exit door, you'll appear there. If this level doesn't contain anything, you'll appear on the same level coordinate of the door you entered. (I highly suggest putting an exit door anyway)

Using special transition: It's used only once in the game. Here:

http://puu.sh/jxv99/d74693b441.jpg

It's when you want to bypass the game transition system. You can only do it for righ/left transition. In order to do that, go to level->Level properties... and write in right_exit the name of the level ("x_y") you want to transition to when you go the right. Same thing for left.

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ V) Adding custom text ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

In this section, i'll explain how to add custom text (Room names, NPC dialogue, pop-up messages) into your custom levels. Since these data are stored deep into the ots.swf file we need to use another software in order to edit them: JPEXS Free Flash Decompiler (https://www.free-decompiler.com/flash/download/)

After installing the software, launch it then open the "ots.swf" file in the gmae folder. (Don't forget to keep a back-up, all the game code is in this file!) The only files we're interested in are these two:

http://puu.sh/pTvHx/c3ae7e73b4.png

Right click on them then choose "export selection". This will create a folder on your computer called "binaryData" with a copy of these files. You can then open them with a text editor and modify them.

Let's break down these files: 57_assets.XmlAssets_MESSAGES_XML.bin The first part of the file contains all the pop-up messages of the game. These are the messages that appears in the game after you entered a room. Their syntax are <label> <timer value="0.5"/> <once value="true"/> <text portrait="yuri"> <en>Message in English.</en> <br>Message in Portuguese?</br> <fr>Message in French.</fr> <hue>I have no idea what this is.</hue> </text> </label>

label-> This is a tag to identify the message. Make sure that all your text have an unique one. timer value -> The time it wil take to trigger the message after you entered the level. once value -> Don't touch it. text portrait -> Who is talking. Usually it's yuri for these messages. <en/br/fr/hue> -> The message in the different languages. If you only use one language just put the same text everywhere. You can change the color of the text using {color:#FFFFFF}, forcing a line break using \n and changing the text speed using {cooldown:5}. (bigger number=slower text with 1 being the default speed)

For example, the first message of the game has this syntax: [quote] {color:#F2960B}Captain's Log:{color:#FFFFFF}\nIt looks like I've landed on an inhospitable planet. I have to find a way to fix my ship and defeat {color:#FF0000}{cooldown:5}Grigori{cooldown:1}{color:#FFFFFF}, for the sake of Mother Planet!</en> [/quote] giving us http://puu.sh/pTwWa/5eac7002ed.png

The second part of the file contains all the NPC messages of the game. Their syntax is pretty similar: <label statistic="alien"> <text portrait="worm"> <en>Message in English.</en> <br>Message in Portuguese?</br> <fr>Message in French.</fr> <hue>I still have no idea what this is.</hue> </text> </label>

Don't forget to put the label and choose a matching text portrait with the NPC (worm/wormGurad/treeMan)

Finally, the file also has the texts for other triggers with very similar syntax.

After finishing all the modifications, go to JPEXS Free Flash Decompiler right click on the file 57_assets.XmlAssets_MESSAGES_XML.bin then replace it with your modified version. http://puu.sh/pTxUK/aba1d344c1.png Then, don't forget to put the label of the new messages you made into your custom levels. For a message triggered after entering a level -> Put its label into level>level properties>message For a message triggered after entering an area of a level -> Select the area (object) then enter the label into the "message" section. For a NPC talk -> Select the NPC (object) then enter the label into the "message" section.

65_assets.XmlAssets_ROOM_NAME_XML.bin This file is way easier to deal with. All the rooms names are here with the sintax <r10x6> <en>English name</en> <br>Portuguese name?</br> <fr>French name</fr> <hue>??????????</hue> </r10x6> "r10x6" means that's the message associated to the room 10_6.oel. So put the right coordinates and your text. After finishing editing the file you can put it back into ots.swf as described above and that's it!

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ IV) Miscellaneous ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

Another use for OGMO is to edit game levels. If you want to do this you may notice that some levels can't be opened in OGMO and other correspond to nothing in the actual game. Here is why:

Unopening levels: 10_5.oel: The most complicated one. The line causing issue is line 13: <rect x="0" y="-1" w="26" h="1" /> It adds a line of invisible solid blocks above the level and OGMO doesn't like it. If you want to edit the level you need to remove this line with notepad, edit the level, then put the line back.

12_6.oel The line causing issue is line 245:

<!-- <sp_messageArea id="11" x="288" y="0" width="160" height="160" /> -->

You can just remove it. It affects nothing in the game.

25_5.oel The line causing issue is line 81:

<!-- <env_blockFall id="10" x="160" y="256" /> -->

You can just remove it. It affects nothing in the game.

27_6.oel The line causing issue is line 46:

<!-- <sp_messageArea id="15" x="96" y="64" width="32" height="192" message="" /> -->

You can just remove it. It affects nothing in the game.

Unknow levels: 20_5(new).oel It's an alternate version of 20_5 that was never used in the final game.

20_6.oel It's the foundation of a level that never made it into the final game that you were supposed to access from 20_5(new). The level is still here but unaccessible.

31_6.oel It's an alternate version of level 36_1.oel. Once again, it's unaccessible in the game.

¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤ Final Words ¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

Thank you for everyone who helped making this! Thank you megadrive, prettz and thisishowmymindworks for identifying all the software needed to make this possible. Thank you Timbouton for making the map with coordinates. It helps a lot when messing around with the game levels. Thank you Natos for testing all this and making the first custom level you can find here: http://www.speedrun.com/ots/thread/k0o7u

If you have trouble, questions, you don't understand something or want more detail on something else, ask away!

P.S. if after modifying the game file you're unsured of what you did it you can just uninstall the game then reinstall it. Steam even keep your save files!

PrettzL likes this
About rezoons
Joined
8 years ago
Online
1 year ago
Runs
28
Games run
Out There Somewhere
Out There Somewhere
Last run 7 years ago
26
Runs
Another Perspective
Another Perspective
Last run 7 years ago
1
Run
Westerado: Double Barreled
Westerado: Double Barreled
Last run 7 years ago
1
Run
Games followed
Out There Somewhere
Out There Somewhere
Last visit 1 year ago
3,107
visits
Games moderated
Out There Somewhere
Out There Somewhere
Last action 5 years ago
141
actions