Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

This War of Mine (.binfont, .texture)

Featured Replies

  • Author
  • Localization

MerlinSVK, posted Fri Nov 28, 2014 11:30 am (2022)


So I finally managed to make a texture converting BMS scripts for both, the .binfont and .texture files.

For easier localization, there would by neat to have some tool/script to convert/import/export strings from l??n.bin file (editing is doable via hex or Notepad , but plain text would be better) :(

EDIT2: Mipmaps in .texture files are supported now :mrgreen:

Code:
# This War of Mine
# BINFONT to DDS converter
# by MerlinSVK    Nov 2014
# version 1.0
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

get SIZE asize
get NAME basename
string HNAME = NAME
string TNAME = NAME
string HNAME = ".head"
string TNAME = ".tail"
string NAME = ".dds"

idstring "\xE3\x0A\xF2\x23"
get UNK long
get TYPE byte
get COUNT long
math HEIGHT = 0

for i = 0    get TMP long
   math HEIGHT = TMP
next i
savepos OFFSET

xmath DATASZ "(SIZE / 0x1000) * 0x1000"      # length of texture data
xmath TOFFSET "OFFSET DATASZ"            # start of tail
xmath TSIZE "SIZE - TOFFSET"            # length of tail

if COUNT > 1 then
   xmath OFFSET "(COUNT * 4) (OFFSET - 4)"
endif

if TYPE == 1      # L8A8 format
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
   xmath WIDTH "(DATASZ / HEIGHT) / 2"
else            # L8 format
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x0F\x10\x00\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x08\x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
   xmath WIDTH "DATASZ / HEIGHT"
endif

putVarChr MEMORY_FILE 0XC HEIGHT long
putVarChr MEMORY_FILE 0x10 WIDTH long
putVarChr MEMORY_FILE 0x14 DATASZ long

append
log MEMORY_FILE OFFSET DATASZ
append

get DDSSIZE asize MEMORY_FILE
log HNAME 0 OFFSET            # save header
log TNAME TOFFSET TSIZE         # save tail (char descriptions)
log NAME 0 DDSSIZE MEMORY_FILE   # save DDS texture


Code:
# This War of Mine
# DDS to BINFONT converter
# version 1.0
# by MerlinSVK    Nov 2014
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

open FDDE DDS 0
open FDDE HEAD 1
open FDDE TAIL 2

get NAME basename
string NAME = ".binfont_NEW"

get DSIZE asize 0
get HSIZE asize 1
get TSIZE asize 2

math DSIZE -= 0x80            # subtract the DDS header

log MEMORY_FILE 0 HSIZE 1      # copy header into memory_file
append
log MEMORY_FILE 0x80 DSIZE 0   # append texture data
log MEMORY_FILE 0 TSIZE 2      # append tail
append

get BINSZ asize MEMORY_FILE
log NAME 0 BINSZ MEMORY_FILE



Code:
# This War of Mine
# TEXTURE to DDS converter
# by MerlinSVK          Dec 2014
# version 1.2         (added support for RGBA format & mipmaps)
# script for QuickBMS   http://aluigi.org/papers.htm#quickbms

get SIZE asize
get NAME basename
string HNAME = NAME
string MNAME = NAME
string HNAME = ".head"
string NAME = ".dds"

get WIDTH long
get HEIGHT long
get TYPE long
get MIPS long

xmath DATASZ "SIZE - 0x90"

if TYPE == "0x31545844"         # DXT1
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
elif TYPE == "0x33545844"      # DXT3
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x33\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
elif TYPE == "0x35545844"      # DXT5
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
elif TYPE == "0x15"            # RGBA8
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x0F\x10\x00\x00\x41\x41\x41\x41\x42\x42\x42\x42\x43\x43\x43\x43\x43\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\xFF\x00\x00\xFF\x00\x00\xFF\x00\x00\x00\x00\x00\x00\xFF\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
endif

   putVarChr MEMORY_FILE 0XC HEIGHT long
   putVarChr MEMORY_FILE 0x10 WIDTH long
   putVarChr MEMORY_FILE 0x14 DATASZ long

if MIPS == 1
   append
   log MEMORY_FILE 0x90 DATASZ
   append
else
   putVarChr MEMORY_FILE 0XA 0x0A byte
   putVarChr MEMORY_FILE 0X1C MIPS long
   putVarChr MEMORY_FILE 0X6C 0x08 byte
   putVarChr MEMORY_FILE 0X6E 0x40 byte

   math MIPOFFSET = 0x90               # offset of the smallest mipmap
   for i = 1       get MIPWIDTH short
      get MIPHEIGHT short
      get MIPSIZE[i] long

      set MIPSTART[i] long MIPOFFSET
      set MIPSZ long MIPSIZE[i]
      xmath MIPOFFSET "MIPOFFSET MIPSZ"   # calculate next mipmap offset
   next i
         
   append
   for i = MIPS >= 1                  # writing mipmaps in reversed order
      log MEMORY_FILE MIPSTART[i] MIPSIZE[i]
   next i - 1
   append
endif

get DDSSIZE asize MEMORY_FILE
log HNAME 0 0x90            # save header
log NAME 0 DDSSIZE MEMORY_FILE   # save DDS texture



Code:
# This War of Mine
# DDS to TEXTURE converter
# by MerlinSVK          Dec 2014
# version 1.1         (added support for mipmaps)
# script for QuickBMS   http://aluigi.org/papers.htm#quickbms

open FDDE DDS 0
open FDDE HEAD 1

get NAME basename
string NAME = ".texture_NEW"

get DSIZE asize 0
get HSIZE asize 1

goto 0xC 1                  # read number of mipmaps from header
get MIPS long 1

math DDSSIZE = DSIZE
math DSIZE -= 0x80            # subtract the DDS header
log MEMORY_FILE 0 HSIZE 1      # copy header into memory_file

if MIPS == 1
   append
   log MEMORY_FILE 0x80 DSIZE 0   # append whole texture data
   append
else
   for i = 1       get MIPWIDTH short 1
      get MIPHEIGHT short 1
      get MIPSIZE[i] long 1
   next i

   math MIPOFFSET = 0x80         # offset of the biggest texture
   for i = MIPS >= 1
      set MIPSTART[i] long MIPOFFSET
      set MIPSZ long MIPSIZE[i]
      xmath MIPOFFSET "MIPOFFSET MIPSZ"         # calculate next mipmap offset
   next i - 1
         
   append
   for i = 1       log MEMORY_FILE MIPSTART[i] MIPSIZE[i]
   next i
   append
endif

get BINSZ asize MEMORY_FILE
log NAME 0 BINSZ MEMORY_FILE



Code:
Bin file with strings, if somebody wants to look at it.
https://www.dropbox.com/s/dz1ygg7uv2koh82/l01n.7z
  • Author
  • Localization

michalss, posted Fri Nov 28, 2014 12:26 pm (2023)


Not simple text format it is text container containig all languages.. Doing the template right now...
  • Author
  • Localization

MerlinSVK, posted Fri Nov 28, 2014 12:36 pm (2024)


Yep. 4503 (4505 after update) files O.o

And I also have partially done font description reader, for those who would like to add new letters into font textures.
But I don't know what UNK1 and UNK2 represents.

Image

Code:
https://www.dropbox.com/s/dtamrn1ulg9nx0y/font_example.7z


Code:
# This War of Mine
# Font descripion reader (from .tail file)

get COUNT long
for i = 0    get CHAR short
   get UNK1 short
   get UNK2 short
   get X1 short
   get X2 short
   get Y1 short
   get Y2 short
   xmath WIDTH  "X2 - X1"
   xmath HEIGHT "Y2 - Y1"
   print "Char: %CHAR|h%, X1: %X1%, Y1: %Y1%, X2: %X2%, Y2: %Y2%, Width: %WIDTH%, Height: %HEIGHT%"
next i
  • Author
  • Localization

michalss, posted Fri Nov 28, 2014 1:54 pm (2026)


I dont know exact struct with this text container, there is something very strange :( I can extract and import EN texts, but with no any checks or test...
  • Author
  • Localization

MerlinSVK, posted Fri Nov 28, 2014 2:18 pm (2027)


Import could be sufficient. There are no defined string lengths or offsets.
  • Author
  • Localization

aluigi, posted Fri Nov 28, 2014 2:44 pm (2030)


@ MerlinSVK
Happy to see that the -H option of quickbms is used at least by one person in the world :D
  • Author
  • Localization

MerlinSVK, posted Fri Nov 28, 2014 3:08 pm (2032)


-X is also fun :D
  • Author
  • Localization

michalss, posted Fri Nov 28, 2014 3:40 pm (2035)


Can you try make at least 1 string longer then original. Just to make sure that it wont crash ?
  • Author
  • Localization

makc_ar, posted Sat Nov 29, 2014 4:54 am (2045)


textures-s3\ui\radiob01.texture, radiob02.texture to .DDS etc error .DDS
fix script?
  • Author
  • Localization

MerlinSVK, posted Sat Nov 29, 2014 6:03 pm (2061)


Support for RGBA format was added, but there is still problem with mipmap order. I don't know how to solve this :(
  • Author
  • Localization

MerlinSVK, posted Tue Dec 09, 2014 12:37 pm (2135)


MerlinSVK wrote:
Support for RGBA format was added, but there is still problem with mipmap order. I don't know how to solve this :(


Nah, from today it's not true anymore. Mipmaps are written in correct order.
The only "disadvantage" is that you can't change: format of texture (DXT, RGBA, etc.), resolution or number of mipmaps, because DDS to TEXTURE script reads the original .head file. But if you don't change any of these, everything is OK.
  • Author
  • Localization

AgeNT2k21, posted Sun May 23, 2021 8:59 pm (64240)


Good afternoon. If your please help with the script for the game Frostpunk.
The publisher is the same.
You only need binfont2dds and dds2binfon. Attach a font file. Thank you very much for any help.
I know English poorly, I use a translator.
  • Author
  • Localization

AgeNT2k21, posted Sun May 30, 2021 3:24 pm (64386)


On the site on QuickBMS, no one knows the code enough to tell you what to do?
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.