READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

The Evil Winthin 2

Need help translating games in other languages? Have your language problems solved here.
ripper
ultra-n00b
Posts: 6
Joined: Wed Nov 19, 2014 9:52 pm
Location: Ukraine
Been thanked: 2 times

Re: The Evil Winthin 2

Post by ripper » Tue Jun 05, 2018 6:38 pm

As i promised, here is my sources. Compiled binary in bin/Debug folder.

Usage for extract data:
1. Click PTR File "..." button and choose ptr file (note: pkr file must be placed on the same level with ptr, or 1 level above, like in game directory);
2. If needed click Extract directory "..." button and choose preferred directory.

Usage for import data:
1. Click Data directory "..." button and choose directory with extracted data (note: this program import only self-extracted files);
2. If needed click PKR/PTR File "..." button and choose preferred directory and filename.

This tool convert lanb files to txt (same as bms script format) and 48.dat font map files to xml like format.

Fonts in bimage files. If you see in xml data x coordinate more than image width it means that you need select image alpha channel.
In game little bit more than 58 763 words.
Impossible is nothing.

User avatar
GHOST DEAD
mega-veteran
mega-veteran
Posts: 195
Joined: Sat Nov 26, 2016 3:39 pm
Has thanked: 7 times
Been thanked: 6 times

Re: The Evil Winthin 2

Post by GHOST DEAD » Wed Jun 06, 2018 5:34 pm

Problem!
In .xml files; bearingX is advanceX! Not a bX to bring offset to right! Actully you set wrong name

Replace AdvanceX to bearinX, you set worng name...

And also; you must change your source to creat a new 48.dat with added characters, not inject or insert value's...
Be Good, Even in distressing or defamation and chill, Even Everyone's Called You a Bad Guy Or Lier and Mad

Zotya0330
n00b
Posts: 19
Joined: Tue Dec 16, 2014 5:47 pm

Re: The Evil Winthin 2

Post by Zotya0330 » Sat Jun 09, 2018 3:53 pm

And how to edit font files?

ripper
ultra-n00b
Posts: 6
Joined: Wed Nov 19, 2014 9:52 pm
Location: Ukraine
Been thanked: 2 times

Re: The Evil Winthin 2

Post by ripper » Tue Jul 31, 2018 7:01 pm

As i need recreate fonts (because english letters slight bolder than cyrillic) and You guys have some trouble with that, here detailed example.
There is big topic about Id tech textures, if you are interested - here link.

Before we start, you'll need some hex editor, we will put in and out image data from .bimage files.

Let's go:

1. After extracting pkr data, go to <extracted directory>\generated\textures\fonts and you'll see following folders
Image

If your writting system alphabetical, as mine, you need change next fonts
Image

If not, you might choose other fonts.


2. Go to first directory, fot_newrodinpro_db, and open 48.bimage in hex editor. You will see something like this
Image

2.1. Find Goto function (in some editors Ctrl+G) set offset to 12 (dec) or 0C (hex) and press enter (or "Go" button)
Image

2.2. Here is our image width - 1000 px
Image

2.3. Now find goto function once again and set offset to 16 (dec) or 10 (hex) and press enter (or "Go" button)
Image

2.4. Here is our image height - 2032 px
Image

2.5. Now goto find goto function once again and set offset to 62 (dec) or 3E (hex) and press enter (or "Go" button)
Image

2.6. Press Ctrl+Shift+End and copy (Ctrl+C) selected data (if nothing happened, click on the underscored symbol and press again)
2.7. Create new file (Ctrl+N), paste (Ctrl+V) data and save file (Ctrl+S). I named this file fot_newrodinpro_db.raw
2.8. Now you need create blank dds image, for these purposes I use GIMP. So open GIMP, create a new file with our image size and click OK
Image

2.9. Now click File -> Export as (Ctrl+Shift+E) choose DDS image from dropdown list
2.10. Select compression BC3/DXT5, no mipmaps, no additional options and save file
Image

2.11. Open created dds image in hex editor and goto 128 (dec) or 80 (hex) offset.
Image

2.12. Press Ctrl+Shift+Home and copy selected data (if nothing happened check 2.6)
2.13. Paste this data at the beginning of fot_newrodinpro_db.raw
Image

2.14. Save file as fot_newrodinpro_db.dds

Note: same thing with other files. Here sizes, start at 2.5 step for copy other data
fot_newrodinpro_db - 1000x2032
fot_udkakugo_large_pr6_m - 1112x2264
tng_font_cn - 860x2872
tng_font_ko - 840x1600
tng_font_lang - 368x656
tng_font_zh - 1076x2296
tng_gothic_m - 260x752


3. Now is time for edit image, i'll use Adobe Photoshop with NVIDIA Texture Tools because i'm still don't learned how to use others (GIMP, Paint .NET, Krita). You need any image editor with ability work with image channels.
Little about image. Image splitted by 2 parts, left part placed in red channel, right part - alpha channel. So real width of images are multiplited by 2, remember that, when you'll setting coordinates in xml-like font map file. Real image looks something like this
Image

When you finish save image as DXT5
Image


4. So, when you`ll finish with images, time add them to font map. Open xml-like file <extracted directory>\fonts\fot_newrodinpro_db\48.dat.xml
4.1. First thing what you need to do - update chars count, if you need add 1, 2, 5, 10 etc. chars, add to chars number. In current version fot_newrodinpro_db has 1920 chars, i need add only 8, so for me chars count is 1928.
Image

4.2. Now going to UTF-8 encoding table and Unicode characters resource and choose your range, for me is U+0400 ... U+04FF: Cyrillic. Set "numerical HTML encoding of the Unicode character" param to decimal
4.3. When i added characters to DOOM (2016) weird thing happened. If i added char at the end of list, game don't recognized it, so i recommend add chars by id order. In my case first letter with id 1028
Image

4.4. Copy closest row, paste after and set id
Image

4.5. Now go to our image and get coordinates. In my case letter on the red channel so his X=528, Y=240, width=29, height=35 (if you add chars to alpha channel add to coordinate image width). Keep in mind, in program bearing is advance and advance is bearing. I missnamed params when develop tool. If bearing(advance) value > 127 substract 256, just wrong variable type.
Image
Image


5. Now you need only put in image data to bimage file and import back to pkr.
5.1. Open dds image and goto offset 128
5.2. Press Ctrl+Shift+End and copy selected data (if nothing happened check 2.6)
5.3. Open .bimage file and goto offset 62
5.4. Press Ctrl+Shift+End, paste previously copied data (if nothing happened check 2.6) and save file.

That's all, do same with other fonts, import data to pkr and enjoy your fonts.

Note: on version 1.0 fonts changed only, if you import map and image to p1_loc_01.pkr/ptr file. So if you try import to the other file and nothing change, try import to p1_loc_01.

Sorry for this long text. I would like hide all this in spoiler, but spoiler tag doesn't work.
Oh, and sorry for my english.
Impossible is nothing.

Post Reply