ROM Hack RELEASE Noesis-Mod - Tiling texture for UE4

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,268
Trophies
3
XP
12,035
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: 1,003
Last edited by masagrator,

masagrator

The patches guy
OP
Developer
Joined
Oct 14, 2018
Messages
6,268
Trophies
3
XP
12,035
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,268
Trophies
3
XP
12,035
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,268
Trophies
3
XP
12,035
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,268
Trophies
3
XP
12,035
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,268
Trophies
3
XP
12,035
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,268
Trophies
3
XP
12,035
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
  • Xdqwerty @ Xdqwerty:
    @HiradeGirl, I have a broken o3ds xl
  • Psionic Roshambo @ Psionic Roshambo:
    Phones worked great for DS emulation with DraStic and a controller that held your phone
  • Psionic Roshambo @ Psionic Roshambo:
    But sadly that's coming to an end
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, atleast I think the latest version's apk is archived somewhere
    +1
  • K3Nv2 @ K3Nv2:
    Yeah it works great but it's the obvious Ds factor you loose from it it's not like playing atari games on atari because Nintendo actually use to give a reason to buy their hardware
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Honestly Ken I actually have the hardware and it's hacked and works fine, prefer my phone lol
  • Psionic Roshambo @ Psionic Roshambo:
    Microphone is more sensitive, DraStic has a high res mode, screen is way better just overall a better experience
  • K3Nv2 @ K3Nv2:
    I just like game consoles how they were intended to play if they have a unique enough reason to buy them anything else yeah just download emulation for it
  • Psionic Roshambo @ Psionic Roshambo:
    Oh and touch screen infinity better lol
  • HiradeGirl @ HiradeGirl:
    @Xdqwerty It's still on Play Store.
  • HiradeGirl @ HiradeGirl:
    for free
  • HiradeGirl @ HiradeGirl:
    Install before they remove it.
  • K3Nv2 @ K3Nv2:
    I'd like to see a DS emulator that allows casting top screen to TV then use bottom for the touch screen stuff
    +1
  • HiradeGirl @ HiradeGirl:
    I used a vertical touch 22" monitor for playing some 3DS games through Citra.
  • K3Nv2 @ K3Nv2:
    Can't be that far off from it not like ds requires super hardware
  • HiradeGirl @ HiradeGirl:
    @K3Nv2 I did that using Citra for 3DS games. Bottom screen was my smartphone. Until I got the touch screen.
  • SwordShielder @ SwordShielder:
    Use a TV
  • K3Nv2 @ K3Nv2:
    Citra allows it already?
  • HiradeGirl @ HiradeGirl:
    Yes.
  • Psionic Roshambo @ Psionic Roshambo:
    Ken I have that sort of set up on Drastic on Pi for games that don't require touch
  • Psionic Roshambo @ Psionic Roshambo:
    Looks nice too
  • HiradeGirl @ HiradeGirl:
    Any TV with your PC connected with Citra and any smartphone to use as a screen using a free play store app.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Gonna look into that when I get home
  • K3Nv2 @ K3Nv2:
    Any good 3ds smut titles psi? :creep:
    K3Nv2 @ K3Nv2: Any good 3ds smut titles psi? :creep: