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

Author Topic: Berserk PS2 how to get the alphabet values?  (Read 18922 times)

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #40 on: April 22, 2013, 01:59:24 am »
I don't know what to answer you.
I told you what to do many times but you are not listening to me, I not see once in this thread that you have done what i told you :(

You think you can just change 1 part of the font and it will work when i told you already the 18 and 19.4.2013 that you need to change 3 parts in the file with that text "sample font...." to get it to work.

For the files you posted 2 posts ago with the pointers, things are more easy because you need only to translate it but you need to find/correct the font anyway if they are not working correctly.

So before you not make a list with which file uses which font or you choose 1 file and you work only on that one till it works, i will not answer you anymore!!
If you not follow what i say and you jump from file to file, it just make confusion and nobody will get anywhere.

UPDATE:
i make this update only because i just came by the pc that has this pic on it from some days ago.
As you maybe noticed in your last pic you posted, the "P i" and "O" are using way to much space.
To correct that, you need to correct the "font width table" that is the last and 3° part you need to correct.
By the way this table is why you got all those "massacrated" letters in your test.
By finding out the format of that table and change the right values, you can change the height of the text:



or more important for you, how much space every letter takes:


Another little detail i wanted to show you with this pics is that there are at least 3 different fonts in those screenshots:
1) the cut font with "options, continue, ..."
and the others intact:
2) "screen title" = PAUSE
3) Descriptions = the text in the box
and maybe 4) the "navigation" = the text below the box.
« Last Edit: April 22, 2013, 01:46:34 pm by Auryn »

Puck

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #41 on: April 22, 2013, 05:57:47 pm »
Interesting.

But how exactly did you accomplished that?

I found some documents about font widths and figure that most of these values are next to each other, and that the width correspond to a value in hex of the number of pixel a particular character uses in width and height.

Now, as you said that at the bottom of the "font_sample" file, there could be the width values, I tried to find them.



First, in rows "2 and 3" there are a bunch of "1500" values. They don't change, so I don't think these could be the width values.

Second, from row "6 to 9" there are values with great similarities. These cannot be pointers, because their values are not enough to point to any character. They could be either the width or height. However, I'm not sure as my testing in CrystalTile2 gives me others pixel width for the characters. For example, the Hiragana "Ga" has a 10 pixel width (in CrystalTile2) which would be 0A in Hex value.

Third, from row "A to D" there are values similar to the last rows, only that row "A and B" has mostly 0000's and two "FFFF". The others values look kind of the same to the last rows and I can't be really sure what they refer to.


Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #42 on: April 23, 2013, 08:44:06 pm »
Quote
Interesting.
But how exactly did you accomplished that?
I love when people ask questions and they answer themself :p
Quote
I found some documents about font widths and figure that most of these values are next to each other, and that the width correspond to a value in hex of the number of pixel a particular character uses in width and height.
So yes, i changed the right values in the right place.


Quote
Could this possibly be the width and height values of each character in the font??
Sorry if i am am sarcastic but you are re-discovering hot water (paste from my post on 19 April):
[/URL]
Quote
....Then there is all those rectangles with the dots in it after the font. If you didn't notice, that is your width table so that you have a VWF in your game.
Yes they are with the little difference that you don't have only height and width but somethings more that you need to discover. I will help in this: 15 is the height and you don't need to change that. One will be something that will cut the letter in diagonal, one with be the width and what is left to discover is those FFFF.
Now you can try change some value and go look on the game what happens (if you know where this font is used).


Quote
These cannot be pointers, because their values are not enough to point to any character.
Mixing things up??
When you are writing a list, you not use pointers....right?? You just make the list and if you cross check with another list, you will check line1 with line1, line2 with line2, etc...
This is nothing else that a list with the "graphical" specification of each character and if this list follow the same sequence as the font, you need just a pointer that tell the game where this list start and nothing else.
By the way, an index or ID for each character can be a "pointer" as well but it's not the case here.


Puck

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #43 on: April 25, 2013, 02:27:59 am »
Fine, I got the width, height and diagonal values.

The value in row "C" contains the width, and the values are in HEX to how many pixels has in width.

It wasn't the big deal to keep it so secretive  :-X

I had to use CheatEngine plus the PS2 emulator to save time  :/

I might have found the pointers, but haven't fully figured out yet.

For example in the 2nd cut-scene font, the value "00" refers to Hiragana "Ga" which is the first tile for the string "Gatsu"
The value "01" refers to the small "tsu" and "02" refers to the big "tsu" and "03" refers to exclamation symbol "!"

However, they are not in order.



I suspect that the red area could be a "pointer" or index (not sure) of each character inside the font.

Now, the highlighted part has like the first line of the cut-scene. When I changed a value in there a letter changed.

Now that the width can be controlled, what step should I follow to translate this cut-scene?

 :thumbsup:

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #44 on: April 25, 2013, 07:01:45 am »
Quote
Fine, I got the width, height and diagonal values.

The value in row "C" contains the width, and the values are in HEX to how many pixels has in width.

It wasn't the big deal to keep it so secretive 
Good that you found them and hopefully understand what you will need to do with them when you will have fixed the graphical part of the font.
I don't want to keep it secreteve Puck, I just want you to understand how they work, apart that it's actually your project and you should do all this work and not me but to help you, i had to do the same research as you.


Quote
I might have found the pointers, but haven't fully figured out yet.
Forget about those pointers at the moment. You have already the 3 important part that you need to correct so do that first and then you can fix the rest.


Quote
For example in the 2nd cut-scene font, the value "00" refers to Hiragana "Ga" which is the first tile for the string "Gatsu"
The value "01" refers to the small "tsu" and "02" refers to the big "tsu" and "03" refers to exclamation symbol "!"
I not stay on the pc with the game to check this but I believe you are wrong. You can see the text when selecting UTF-8 in mad edit so your "letter" <> value connection is this (by the way it's crucial you understand this connection for the last step you need to do when correcting the font):
http://www.utf8-chartable.de
from the drop down window choose Hiragana or Katakana and there you will see the values for each letter.

Quote
However, they are not in order.
Well, nothing new again here, I told you longtime already that those fonts are in the order as each character appears on screen.

Puck

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #45 on: April 26, 2013, 04:13:47 am »
This is the result I got using the new findings  :)



The "G" looks a little weird but I think I could fix it.

Basically what I did was modifying the original cut-scene font with the characters from the "working 40kb font"
Used some spacing to fit the characters and I tried differents width values. I didn't changed any values from the dialogue and just used the modifications on the font itself to make the "translation"



These are the new width values I put to make it "worked"



Now, am I in the right path or I'm still missing something?

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #46 on: April 26, 2013, 07:24:20 am »
Well, you will not get far with this method.
You have to choose what way you want to go before you make such changes:
you want to put the font in the order of when the letters appears on screen (as the game do)
or
you make a nice and clean alphabetic order.

Anyway, this font is alineated so you need to put each letter in each rectangle ("G" in one rectangle, "a" in the second, and so on) and not like you did.

Did you understand that thing i told you about "value" <>"letter" with the table i send to you??


Puck

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #47 on: April 26, 2013, 10:57:11 pm »
The way I did it was to utilize the available space, by using 2-3 letters per tile with the same hex values in the dialogue file.

Doing it the way you propose would need more tile spaces and more space in the dialogue file. The size of the files cannot be increased, it has to stay the same. Only the dialogue strings can be adjusted by where they start and where they end, but always having to depend on the original size of the whole dialogue file.

Translating by modifying the font and using the 3 bytes UTF-8 values and one tile per "letter" would end in a shortage of space. I know that the pointers can be adjusted but the there is not enough room in the file. Just the first text string that translates to "Guts! Guts! Hey, wake up already" needs  96 bytes of UTF-8 values.

I tried using the Latin values from the table you send me, but the game didn't recognized them while playing the cut-scene. The first tile on the font will only be recognized as "e3 81 8c" and so on.

Is there a way to make the font file recognize another value other than "e3 81 8c" as the first tile?
I don't know

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #48 on: April 27, 2013, 12:55:26 pm »
The size of the files cannot be increased, it has to stay the same. Only the dialogue strings can be adjusted by where they start and where they end, but always having to depend on the original size of the whole dialogue file.
Wrong, you still didn't analize the beginning of pac file and continue to ignore that all you need to know is between the "memory card font" and the " UPDATE " in my old post.
HINT: Recheck my detailed listing of bytes.

Quote
Translating by modifying the font and using the 3 bytes UTF-8 values and one tile per "letter" would end in a shortage of space. I know that the pointers can be adjusted but the there is not enough room in the file. Just the first text string that translates to "Guts! Guts! Hey, wake up already" needs  96 bytes of UTF-8 values.
You can insert ASCII in there so that you will need 1 byte/letter meaning you have 3 times as much space as you have now.

Quote
Is there a way to make the font file recognize another value other than "e3 81 8c" as the first tile?
I don't know
OMG, you still don't get it and continue to ignore that all you need to know is between the "memory card font" and the " UPDATE " in my old post.
To be more exact, the last paragraph before UPDATE.

If you still not see the connection, try put this image in half of your screen:


and this one in the other half:


now open your eyes and look carefully!!!

HINT: the center block of the first pic and forget about the "psx buttons tiles" in the second pic.
Do you finally see it??

Puck

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #49 on: April 27, 2013, 04:30:26 pm »
I understand what you're saying but the memory card font and dialogue is a little bit different to the ones of the cut-scene.

This is the dialogue of the cut-scene:

The purple indicates the last pointer which refers to the last text string. Unlike the memory card dialogue file, the red square in this case would be the whole strings of Japanese texts.

This is the font of the cut-scene:

This font doesn't recognize ASCII values. I tried a bunch of them and none were recognized.

Now, the font that worked in the "events.pac" dialogues was this one.


Are you perhaps suggesting I should modify the working font file instead of the actual cut-scene font file, so it can accept ASCII values?

Quote
you still didn't analize the beginning of pac file
I don't have the knowledge about files structures and how that works. I am in the newcomer's section after all  :-[

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Berserk PS2 how to get the alphabet values?
« Reply #50 on: April 27, 2013, 07:28:36 pm »
Ok, i agree that file is not identical to the one i posted but, try to follow me now.
E382AC= ga
E38383= small tu
E38384= zu
this is all UTF-8 and till here no problems.
Now the game has different fonts, all different one from the other or at least in different graphical order....you agree??

Good if yes :)

Now, the game reads E382AC but he doen't know what to put on screen (see custom character encoding).
There must be somewhere in the game a place that connect that value to the corresponding graphic rappresentation (the correct tile)...agree??

Good again.

Because of what you see in my pic and because we have so many fonts, it's natural to think that this connection is not far away from the text or the font.
I agree it's not on the same spot as the one i pointed out but it has to be there somewhere in some form....agree??

Now, usually this connection is in this format
encoding value > tile offset > (sometimes) width table values

but there are many ways to make this connection.
The one i was trying to make you see is the one in my last post:
if the game know where the encoding values start and where the tiles start, he need just to make connection 1 to 1
In my pic:
53 > tile 1 "S" (i don't know if it's really tile one or tile x but the concept it's the same)
50 > tile 2 "P"
30 > tile 3 "0"
So if my thinking is not completely wrong, if you would exchange that x53 with x50, you write in the file "SP0", you should get "PS0" on screen.

Now, back to cut scene:
last resort for you can be to say:
E382AC= A
E38383= B
E38384= C
and so on.

Yes, i understand what you said before but you are wrong and the answer is in the next paragraph.

Quote
I don't have the knowledge about files structures and how that works. I am in the newcomer's section after all  :-[
There is no good school for this and there is not a formula X that will tell you how this work.
This is a good % of what make the difference between a good hacker and a bad hacker.
Actually it's not much different as finding the text pointers only that you are looking for size, offsets, numbers (counts) etc..
In your file as example:
FF 00 00 00 4 bytes Unknow (could be a flag of some kind example if the file is compressed or not)
09 00 00 00 4 bytes probably the number of pointers in this file
A0 00 00 00 4 bytes probably the first pointer in this file
38 00 00 00 4 bytes length of this text in bytes (including the terminal 00)
here start the interesting things
28 00 00 00 4 bytes
51 00 2 bytes
7D 00 2 bytes
All unknow but they really look like pointers as well, are they connected to font file somehow??
Or there is another file inside this pac??
Anyway it looks like you can expand this file as you want (or have place :p)

Just to teach you, not always the values are so clear like you see them here. Always remember that we human tend to start count from 1 but pc usually start from 0. Especially sizes are many times hidden behind a formula: as example, all text sizes in AAI2 are saved as:
saved size= (actually file size in bytes / 2) -1