hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.19k stars 2.17k forks source link

Texture names keep changing. #9482

Closed ppsspp213 closed 7 years ago

ppsspp213 commented 7 years ago

ppsspp-v1.3-1049-g9b216af-windows-amd64

Every 3-5 loads the texture name of a texture keeps changing, it also dumps the texture in it's upscaled resolution vs it's original resolution listed in the GE Debugger. I also turned off mipmaps to make sure I wasn't getting duplicates.

Example 098fe4a---08df2d6ac86126e9c.png 0985aaa---08df2d6ac86126e9c.png 0989f4a---08df2d6ac86126e9c.png 09864ca---08df2d6ac86126e9c.png 098952a---08df2d6ac86126e9c.png 0990796---08df2d6ac86126e9c.png

unknownbrackets commented 7 years ago

The game developer is doing this, not PPSSPP. They're storing the same texture at multiple addresses. In a way, it's a lot like the game has multiple png files in its own memory, or keeps renaming it.

PPSSPP doesn't currently exhaustively search all textures it's ever seen before against any new one the game starts using. It might cause performance problems if it did. If you want to try changing PPSSPP to do this, and carefully measure the performance across multiple games on mobile and desktop hardware, then we can see the results and decide if it's a good idea.

Otherwise, you can add an entry to your replacement ini file to wildcard match the clut and texture hash at any address, and replace the texture.

See #8792 for info about the wildcards.

-[Unknown]

ppsspp213 commented 7 years ago

You can also group certain textures into different folders for the same game too like project64?

unknownbrackets commented 7 years ago

Yes, you can set the hash to a path in the ini, and it will look for them in a folder.

Google for "ppsspp texture replacement" - there are forum posts and tutorials.

-[Unknown]

ppsspp213 commented 7 years ago

Would it not be possible to dump textures with their filenames based on fileaccess when it opens them from the game image? https://msdn.microsoft.com/en-us/library/d3wke8tz(v=vs.110).aspx kinda of like Cemu with it's debug logging? a brief look in a few games I can see textures contained in .PAK files with .TGA filenames.

unknownbrackets commented 7 years ago

A lot of games load all their textures from one big file. Other games will open a bunch of files in loading, but not actually use all of them as textures (because they only draw what needs to be drawn.)

Mapping those two is not so easy. Imagine you had a list of 200 people who came to a party and each left their coats in a closet (without tags or anything.) You have 200 names, and 200 coats. They might even be in some kind of rough order if you're lucky. Can you correctly pick out which coat goes with which person?

Once you solve that problem, do it again, but this time there's 328 coats, because some of the guests brought friends (whose names you don't even have.) Let's not even think about what happens when it's a coat sewing party (but that's definitely a thing, within this analogy.)

Unfortunately, it's the game's decision how it manages the closet. You're thinking more of a game engine. PPSSPP is NOT a game engine emulator; it's a PSP emulator. Various PSP games used various different (often custom) game engines. Those engines are still running as they were designed for the PSP - we have to make your device look like a PSP, quack like a PSP, etc.

-[Unknown]

ppsspp213 commented 7 years ago

I was thinking more along the lines of textures applied to 3d models not 2d background or spirites, you don't often have the same texture mapped to different 3d models unless their space saving. It's normally multiple textures applied to the various objects that makeup the same 3d model.