Page 2 of 4

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Sat May 16, 2015 3:34 am
by hhrhhr
almost all .xbm files contain only a small preview image. the rest textures are in content?\texture.cache.
here are a couple of scripts to extract the data — https://github.com/hhrhhr/Lua-utils-for-Witcher-3 , needed Lua 5.3 and lua-zlib.

some maps from game (extracted, merged from tiles, cropped and optimized):
Image

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Mon May 18, 2015 11:57 pm
by stalja
String files came with the release of the game. Anyone has any info on how to approach the new w3strings format?

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 12:54 am
by dubh
The .redscripts format is also different from the .w2scripts format.

edit: Someone make a repacker for .bundle files please.

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 8:36 pm
by designgears
hhrhhr wrote:almost all .xbm files contain only a small preview image. the rest textures are in content?\texture.cache.
here are a couple of scripts to extract the data — https://github.com/hhrhhr/Lua-utils-for-Witcher-3 , needed Lua 5.3 and lua-zlib.

some maps from game (extracted, merged from tiles, cropped and optimized):
Image
Getting an error when I try to unpack.

Code: Select all

lua: ./mod_dds_header.lua:25: bad argument #2 to 'unpack' (data string too short)
stack traceback:
	[C]: in function 'string.unpack'
	./mod_dds_header.lua:25: in local 'MAKEFOURCC'
	./mod_dds_header.lua:28: in main chunk
	[C]: in function 'require'
	./unpack_textures.lua:3: in main chunk
	[C]: in ?

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 8:50 pm
by hhrhhr
stalja wrote:String files came with the release of the game. Anyone has any info on how to approach the new w3strings format?
I think that the files are very simple, but the contents is just xor-ed. look at any br.w3strings, inside there is almost clean text (UTF16 with some html tags).
designgears wrote:Getting an error when I try to unpack.
full command line?

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 8:56 pm
by designgears
hhrhhr wrote:
designgears wrote:Getting an error when I try to unpack.
full command line?
lua ./unpack_textures.lua texture.cache unpack

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 9:24 pm
by hhrhhr
I think that you are using the wrong Lua. try to test:

Code: Select all

> lua -e "print(_VERSION)"
Lua 5.3
> lua -e "print(string.unpack('<L', '\xD2\x02\x96\x49'))"
1234567890      5

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 9:33 pm
by designgears
hhrhhr wrote:I think that you are using the wrong Lua. try to test:

Code: Select all

> lua -e "print(_VERSION)"
Lua 5.3
> lua -e "print(string.unpack('<L', '\xD2\x02\x96\x49'))"
1234567890      5
Odd, I have 5.3 installed. I get the same error with your test.

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 10:08 pm
by hhrhhr
"<L " means "native sized little endian unsigned long". maybe you are using a big endian or/and 16-bit platform?

let's try one byte:

Code: Select all

lua -e "print(string.unpack('B', '\xFF'))
255     2

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 10:48 pm
by designgears
hhrhhr wrote:"<L " means "native sized little endian unsigned long". maybe you are using a big endian or/and 16-bit platform?

let's try one byte:

Code: Select all

lua -e "print(string.unpack('B', '\xFF'))
255     2
That works.

I am running Fedora 64bit on virtualbox.

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Tue May 19, 2015 11:01 pm
by hhrhhr
I can only advise to try all conversion options from here (http://www.lua.org/manual/5.3/manual.html#6.4.2) with string "DXT1", for example, find inoperative and inform maintainer of lua package.

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Wed May 20, 2015 1:38 am
by designgears
hhrhhr wrote:I can only advise to try all conversion options from here (http://www.lua.org/manual/5.3/manual.html#6.4.2) with string "DXT1", for example, find inoperative and inform maintainer of lua package.
Well, it even fails on their demo page.

http://www.lua.org/cgi-bin/demo

Very annoying.

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Wed May 20, 2015 2:04 am
by hhrhhr
use "<I4" instead of "<L".

> I[n]: an unsigned int with n bytes (default is native size)

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Wed May 20, 2015 2:10 am
by designgears
hhrhhr wrote:use "<I4" instead of "<L".

> I[n]: an unsigned int with n bytes (default is native size)
Ahh, that seems to have done the trick!

Re: The Witcher 3 Wild Hunt (*.cache*.bundle)

Posted: Wed May 20, 2015 3:08 am
by designgears
hhrhhr wrote:use "<I4" instead of "<L".

> I[n]: an unsigned int with n bytes (default is native size)
This does work, but the files that come out aren't valid dds files.

edit---

Ahh, needed to change <L below too.