News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Legend of Oasis/Story of thor 2 - compressed font  (Read 10219 times)

CUE

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Nasío pa'jakear
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #20 on: October 12, 2013, 02:57:09 am »

Tell me, you do not want to try to write at least a simple data compressor?
No make sense. There is no guarantee that the new compressed files have less size as the original encoded file.

All: http://www.mediafire.com/?92mje9bf6zf2f9g (decode2 is the new tool, source and executable included)

Syntax: decode2 filename offset
"filename" is the file with the encoded data
"offset" is the offset where the encoded data starts
Output: a filename named "xxx.raw" with the decoded data. "xxx" is the 8 digits hexadecimal offset.

"test.bat" is an example to decode/extract some files

paul_met

  • Full Member
  • ***
  • Posts: 194
    • View Profile
    • Meduza Team
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #21 on: October 12, 2013, 03:40:24 am »
No make sense. There is no guarantee that the new compressed files have less size as the original encoded file.
I do not agree. Let's understand then. In fact you need to repack just two blocks from the compressed data. This is the font number 2 and the inscription "Game Over". All of these units, we can reduce (from the font throw pacifiers, and the inscription itself make less). Optimal packing new data, we have to get up to 99% smaller.

All: http://www.mediafire.com/?92mje9bf6zf2f9g (decode2 is the new tool, source and executable included)

Syntax: decode2 filename offset
"filename" is the file with the encoded data
"offset" is the offset where the encoded data starts
Output: a filename named "xxx.raw" with the decoded data. "xxx" is the 8 digits hexadecimal offset.

"test.bat" is an example to decode/extract some files
Thank you. I found a trick. The title screen is divided into 2 parts, which are separated from one another byte "0x01". If it is not replaced by "0x00", the program will give an error. Incidentally, the palette is in the same file, and it is also compressed.

CUE

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Nasío pa'jakear
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #22 on: October 12, 2013, 05:56:44 am »
You are wrong. You just want to modify 2 images to translate the game to your language, but what happens if I want to modifiy other graphics (icons, title screen, ...)? I don't want to create a tool to work with only 2 graphics.

Anyway, it's a very simple compression and the method and the decoded source code is available, so anyone can create a compressor.


paul_met

  • Full Member
  • ***
  • Posts: 194
    • View Profile
    • Meduza Team
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #23 on: October 12, 2013, 08:41:18 am »
Your position is clear.
In that case, I would like to learn more on the example of what it means:
Code: [Select]
- 011 + nnnnn ..................... copy 'nnnnn' more decoded bytes"
October 13, 2013, 12:33:32 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
That's interesting. By reducing the size of the font #1 to 4 bytes, managed to increase the space for the font #2 to 3502 bytes. It seems that a limitation is imposed only on the amount of all the blocks of compressed data that come one after another. But not on a separate block.
« Last Edit: October 13, 2013, 12:33:32 pm by paul_met »

CUE

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • Nasío pa'jakear
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #24 on: October 15, 2013, 11:05:31 am »
Your position is clear.
In that case, I would like to learn more on the example of what it means:
Code: [Select]
- 011 + nnnnn ..................... copy 'nnnnn' more decoded bytes"
October 13, 2013, 12:33:32 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
That's interesting. By reducing the size of the font #1 to 4 bytes, managed to increase the space for the font #2 to 3502 bytes. It seems that a limitation is imposed only on the amount of all the blocks of compressed data that come one after another. But not on a separate block.
011 must be preceded by another 011 or 1nn code.
With code_1nn you can copy only 7 bytes maxim ('111'). To copy more bytes you need split the size in some parts, 7 bytes for code_1nn, 31 bytes maxim for each code_011.

An example: If you need copy 50 decoded bytes from offset actual - xxxxxyyyyyyyy:
111 xxxxx yyyyyyyy <-- copy 111 binary = 7 decoded bytes from offset actual - xxxxxyyyyyyyy
011 11111 <- copy 11111 binary = 31 more bytes
011 01100 <--- copy 01100 binary = 12 more bytes

You can check "decoded.log" to see more examples.

paul_met

  • Full Member
  • ***
  • Posts: 194
    • View Profile
    • Meduza Team
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #25 on: October 23, 2013, 01:51:34 pm »
So, I wrote a simple compressor for the font number 2. I adapted the font size under the current restrictions and everything works. For the title screen and the inscription "Game over" needs an efficient compressor.
Spoiler:

CUE - you have not changed your mind?

paul_met

  • Full Member
  • ***
  • Posts: 194
    • View Profile
    • Meduza Team
Re: Legend of Oasis/Story of thor 2 - compressed font
« Reply #26 on: December 30, 2013, 06:08:42 am »
In general, the release took place. Thanks again to CUE!