ROM Hack RELEASE Noesis-Mod - Tiling texture for UE4

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
Some of you probably remember Noesis made by Rich Whitehouse - big tool for extracting data from many games. It turns out that it has hidden function for tiling UE4 games textures.
You need Unreal Engine 4.19!
Code:
#My modifications
-Modified plugins\python\fmt_ue4.py:
>>Added function '-ue4texungob' which swizzle texture. Based on '-ue4texgob', but with call extension 'tile_blocklineargob' instead of 'untile_blocklineargob'
tile_blocklineargob is broken for some dimensions (it's cutting pieces of image), so it's preferable to have dimensions as multiplications of 128.

>>For 'def ue4UntileTexture' changed:
        heightInBlocks = (height + (blockHeight - 1)) // blockHeight
        to
        heightInBlocks = (height + 4 + (blockHeight - 1)) // blockHeight

>>For 'def ue4ConvertTextureData' changed:
        elif pixelFormat == "PF_DXT5":
                textureData = ue4UntileTexture(asset, width, height, 4, 4, 16, textureData, 8)
        to
        elif pixelFormat == "PF_DXT5":
            if height <= 128:
                textureData = ue4UntileTexture(asset, width, height, 4, 4, 16, textureData, 8)
            elif 128 < height <= 256:
                textureData = ue4UntileTexture(asset, width, height, 2, 2, 8, textureData, 8)
            elif height > 256:
                textureData = ue4UntileTexture(asset, width, height, 1, 1, 4, textureData, 8)

#From this package I removed files that are not necessary for swizzling and to make this package lighter.

Restrictions:
Tiling works incorrectly for some dimensions.
For best results textures should have dimensions as multiplications of 16 (for example 499x258 -> 512x272) and it cannot be smaller than 64x64.
UE4 for Switch uses this method for their textures, so you can swap hex data between files if it's necessary.

The best settings for cooking untiled textures in UE4:
Compression Settings: UserInterface2D (RGBA) or Default (DXT1/5, BC1/3 on DX11) [second one tested only on DXT5]
Texture Group: UI
sRGB: unchecked
Mip Gen Settings: NoMipMaps

You can check if tool is tiling files correctly by using "Unswizzle.bat" for tiled cooked textures. If it's untiling wrongly, put it to "Unswizzle-nop.bat". If it's looks almost correctly, but something is amiss, then it's an noesis issue and you need to use different dimenions

Both functions are working only with *.uasset (+ *.uexp & *.ubulk, but it's loaded by *.uasset file only), so you need installed Unreal Engine 4.19 to make textures.

Making textures in Unreal Engine 4 will need tutorial for people who are too scared to learn by mistakes.

F.e. Octopath Traveler logo made by me.
When it's untiled
Bez nazwy2.png
When it's tiled
bez_nazwy2.png
When putted to Octopath Traveler:
Mapped.jpg

You can download tiled image (make sure that this is 55,4 kB PNG, not recompressed image) and make from this cooked texture in Unreal Engine for Octopath Traveler and swap files with
Code:
\Content\UI\Title\Texture\UiTX_Title_logo_00.uexp
\Content\UI\Title\Texture\UiTX_Title_logo_00.uasset

How to get tiled image:
Copy assets from Cooked folder to noesis folder. Drop *.uasset file ready for tiling to "Swizzle.cmd". It will create new png that needs to be cooked again in UE4 (better with version that your game uses) with the same settings. And that's it.

How to untile texture:
Copy assets to noesis folder. Drop *.uasset file ready for untiling to "Unswizzle.cmd". It will create PNG with the same name.

Big thanks for making this tool by Rich Whitehouse. You can download whole tool here (without enabled tiling function and with broken untiling function for UE4 textures):
https://www.richwhitehouse.com/index.php?content=inc_projects.php&showproject=91

Code:
#10.04.2019: added v2 with repaired untiling textures and tiling textures with dimensions different than multiplication of 128 (still not recommended for some files).
//added Unswizzle-nop.bat for assets made by swizzle.bat without regular resolution (dimensions are not multiplications of 128 with padding)
#27.04.2019: added v3 with support for DXT5 textures.
#09.06.2019: added v4 with updated support for DXT5 textures (it was not working correctly for textures with height <= 256)
 

Attachments

  • noesisv4395-modv4.zip
    8.7 MB · Views: 999
Last edited by masagrator,

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
Added new version with working untiling textures. Added Unswizzling.bat.
It was just a matter of adding "4" to height for correct untiling and swizzling textures with different dimensions than multiplication of 128 (still it's not working properly for some sizes).
Now we can use in game textures with nonstandard dimensions without walking in hex edit.
 
Last edited by masagrator,

fraggerman91

Member
Newcomer
Joined
Jan 4, 2016
Messages
14
Trophies
0
Age
32
XP
151
Country
Germany
The (un-)swizzling works fine for me. I can confirm that by looking at the textures in noesis and umodel.
For some reason the re-cooking seems to mess something up though. The texture still looks fine(like it was swizzled on the switch) in noesis but when I load it on the switch it's all garbled.
Some screenshots and the steps I take:
  • No changes done:
    ySyY4WO.jpg
  • Unswizzle and re-cook:
    wmhhSxx.png
  • Reswizzle and re-cook:
    u8FW6tv.jpg
  • This is how it looks on the switch:
    EPE555I.jpg
Just loading the unchanged one works but if I run it through the un- and reswizzle and cook it it doesn't work any more even though it looks fine in noesis. Any idea why this happens? Do I need to set any special parameters or should the default parameters for dxt1 work?
 
Last edited by fraggerman91,

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
I was uploading today many versions of this tool and I don't know if you have glitched version or not. Just now I came to the point of start.
Uploaded again working mostly package.

So there are cases when only what you can do is add paddings for right and bottom for your texture to make it multiplication of 128 (960x720 -> 1024x768), cook it, swizzle it, cook it and swap texture data from swizzled texture with texture data from original *.uexp by hex editor. It should be exactly the same size for b8g8r8a8. DXT5 and DXT1 is harder to do because of compression and you need to change file size inside *.uasset and probably *.uexp too.

And please don't post big images. Thumbnails or take them to spoiler.
And noesis itself has some issues with tiling some resolutions (except multiplications of 128). Already wrote bug report to author and waiting for reply, because it's an executable issue and I can't fix it.

For now everything is possible.

One more thing: if it's unswizzling in unswizzle.bat, then it should be correct for Switch. If it's unswizzling only with unswizzle-nop.bat, then it would not work on Switch and there is an issue with noesis.

For now settings that I can confirm are working:
For cooking files to swizzle them
Compression Settings: UserInterface2D (RGBA)
Texture Group: UI
sRGB: unchecked
Mip Gen Settings: NoMipmaps

And rest without change.


In case of swapping data you need to set settings as close as possible before cooking swizzled texture (you can read some of settings by watching *.uasset file with hex editor and comparing results, ignoring Compression Settings as Switch has different Default for this). For cooking standard texture I prefer to use:
Compression Settings: UserInterface2D (RGBA)
Texture Group: UI
sRGB: checked
Mip Gen Settings: NoMipmaps

Rest on default.

Image needs dimensions as multiplication of 128 - it's the default value for UE4 textures in Switch, so you can swap data with hex editor if it's necessary
 
Last edited by masagrator,
  • Like
Reactions: fraggerman91

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
So next thing I've probably discovered.
For textures with one dimension lower than 64 pixels textures have dimensions as multiplications of 64. So 180x41 -> 192x64, 200x60 -> 256x64. (for lower than 32 I didn't checked)
And then additional work space needs to be added after swizzling. Not before. But still noesis for this values is bugged. So there may be no way of adding textures with proper resolution with one dimension lower than 64. You can still add texture with higher resolution than original to game, but it will be downscaled.
 
Last edited by masagrator,

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
Added new version with support for tiling and untiling DXT5 textures.
DXT5 needs to be created for swizzling. Swizzling RGBA8 texture and putting it to DXT5 texture will not work.
 
Last edited by masagrator,

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
Next update. Earlier (un)swizzling DXT5 textures with height <= 256 was not working correctly. Now it's working.
I can't check if height >512 is working correctly. I'm waiting for textures to test. :P
 
Last edited by masagrator,

eaZy41

Member
Newcomer
Joined
Dec 15, 2009
Messages
6
Trophies
1
XP
234
Country
Russia
Got this when trying to process 512x1024 file in v4:

Noesis console mode activated.
File "G:\Tools\noesisv4395-modv4\fmt_ue4.py", line 2779
elif pixelFormat == "PF_DXT5":
^
IndentationError: unindent does not match any outer indentation level
Noesis initialized.
Source file: G:\Tools\noesisv4395-modv4\font_0_0.uasset
Dest file: png
Options: -ue4texungob -ue4serialver "516" -ue4gamehack "0"
===
Unknown option: -ue4texungob
Unknown option: -ue4serialver
Unknown option: 516
Unknown option: -ue4gamehack
Unknown option: 0
Detected file type: Unknown
Nothing was exported!
 

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,240
Trophies
3
XP
11,966
Country
Poland
And I tested it before uploading that this error will not show... Eh, it will be updated in couple of hours. This is bug in code, not a issue with file (There should be Tab key, but somehow there is a space used - probably I forgot to update package with correct file).
 
Last edited by masagrator,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    Out of nowhere I got several scars on my forearm and part of my arm and it really itches.
  • AdRoz78 @ AdRoz78:
    Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit chip or was I scammed?
  • Veho @ Veho:
    @AdRoz78 start a thread and post a photo of the chip.
    +2
  • Xdqwerty @ Xdqwerty:
    Yawn
  • S @ salazarcosplay:
    and good morning everyone
    +1
  • K3Nv2 @ K3Nv2:
    @BakerMan, his partner is Luke
  • Sicklyboy @ Sicklyboy:
    Sup nerds
    +1
  • Flame @ Flame:
    oh hi, Sickly
  • K3Nv2 @ K3Nv2:
    Oh hi flame
  • S @ salazarcosplay:
    @K3Nv2 what was your ps4 situation
  • S @ salazarcosplay:
    did you always have a ps4 you never updated
  • S @ salazarcosplay:
    or were you able to get new ps4 tracking it \
    as soon as the hack was announced
  • S @ salazarcosplay:
    or did you have to find a used one with the lower firm ware that was not updated
  • K3Nv2 @ K3Nv2:
    I got this ps4 at launch and never updated since 9.0
  • K3Nv2 @ K3Nv2:
    You got a good chance of buying a used one and asking the seller how often they used or even ask for a Pic of fw and telling them not to update
  • RedColoredStars @ RedColoredStars:
    Speaking of PLaystation. I see Evilnat put out a beta for PS3 CFW 4.91.2 on the 22nd.
  • K3Nv2 @ K3Nv2:
    Don't really see the point in updating it tbh
  • BigOnYa @ BigOnYa:
    Yea you right, I thought about updating my PS3 CFW to 4.91, but why really, everything plays fine now. I guess for people that have already updated past 4.9 it would be helpful.
  • K3Nv2 @ K3Nv2:
    Idk if online servers are still active that would be my only thought
    +1
  • BigOnYa @ BigOnYa:
    Thats true, personally I don't play it online at all, in fact, I deleted all wifi details on it once I installed CFW, so it won't connect and auto-update itself
  • BigOnYa @ BigOnYa:
    I play most games that are on both PS3/360 strickly on the 360, but PS3 exclusives are really only games I play on the PS3
    BigOnYa @ BigOnYa: I play most games that are on both PS3/360 strickly on the 360, but PS3 exclusives are really...