11 March 2016 - Forum Rules

Main Menu

how to decompress text in a ps2 game?

Started by the_phoenix_mirror, January 18, 2022, 06:53:57 PM

Previous topic - Next topic


I was wondering what is the best way to decompress text in a PS2 game? I can't find a program on it. Thanks.


There is none.

Unlike some later systems (I don't know if you are coming to us from post N64 Nintendo stuff, or later Microsoft) Sony did not really provide a means in the SDK (poke around in whatever leaked stuff there is if you want but it is not going to do too much for you) or BIOS that devs drifted towards such that you could reasonably have a one size fits basically all program/suite.

Devs were then left to their own devices to create such a thing. There were a few libraries that game dev tool making companies put out, and some of the open source stuff also gets a feature.

Text was not often compressed either -- several gigs of DVD means a few hundred kilobytes (a lot for a game, a lot for a book even) of text is not going to do much for the overall storage, nor is it likely to gobble all your RAM when you have what you want in it. This means compression mostly happened because the dev did it/was used to doing it just because (force of habit as it were*), because they thought it would give them a modicum of protection against people like us or because the smaller size clogged up the read pipe (you are still on the slower side of DVD read speeds, and if this text was somewhere far away from streaming audio/video then... yeah random reads on optical media are second only to tape in terms of latency) for less time.

*things were still quite different between platforms but enough stuff crossed from whatever PC version that if you are hacking a game with a PC version it can pay to have a look at what goes. Certainly I would also be looking at whatever contemporary or covering contemporary PC games documents are around.

My usual "intro to compression" choice of document, while it is named for LZ it does cover the other major classes.
You are unlikely to find a zip/rar/7z/ace/whatever the Japanese were doing at the time (this was still peak Japan is a separate computing world) in the game, or if you do it is more likely to be something the devs left in as a treat for the curious or as an accident (such developer leftovers being the bread and butter of ). You might however find the likes of and its contemporaries in there. Any compression used is likely to be on the basic side -- while I noted oodles of RAM earlier you are still quite sharply limited compared to what you might be used to on PC, and you presumably want this game lark to happen in real time so can't really be wasting time on one of those borderline AI and hours to decompress a file things from compression contests.

Poke around as well as they could detail some things and while it will not do you much good then for the sake of being complete. is for the gamecube and mostly deals with stuff seen on there but could be worth a look if you want some examples of things.

You can reverse engineer compression effectively without a debugger (usually if you can get a decompressed version, say because it exists in RAM when the game needs it, and a compressed version you can compare the two), though if you can use one then great as it can be quite tedious. You will probably want enough programming skill to write a decompression program or adapt an existing one (LZ is mostly LZ and it can be as simple as a difference in flags and pointer vs read amount split) but decompression at least is quite basic, horrific though to do by hand beyond that what you do to make sure you cracked the code as it were.

You do also have cowboy methods if you wanted -- some of the LZ based stuff will be so many flags, with a flag saying "skip to the next one". Make everything a "skip to the next one" and while you cost some space you have a "compressed" file without the need to figure out how to write a compression algorithm.


Quote from: the_taco_shell on January 18, 2022, 06:53:57 PM
I was wondering what is the best way to decompress text in a PS2 game? I can't find a program on it. Thanks.

Are you talking about extracting text from a PS2 game?
For my translation project i'm using "abcde"'s tool called "Atlas" and "Cartographer":


thanks for the direction to the answer  ::)


I should've posted a pic before.

Here is the normal text

And here is another string of text with the messed up code.


It's probably not "messed-up code", just data.
Old console games didn't use plain text files. They used files that likely bundled various related data together, including text. Text data, at minimum, usually doesn't stand alone, because the game needs a way (usually pointers) to locate a particular string without running through the whole text all the data.


Don't use a text editor to look at data files.
That's why it's not going to make sense.
"My watch says 30 chickens" Google, 2018


Quote from: KingMike on January 20, 2022, 12:28:47 PM
Don't use a text editor to look at data files.
That's why it's not going to make sense.
What should I use then?


You are generally supposed to use a hex editor, since games often use binary code to control how text is organized and formatted; in an ordinary text editor, those binary codes will not display properly (or not display at all). If you opened an old Microsoft Word document in Notepad, it wouldn't display properly either.

Did you read the Getting Started page?
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!