Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Tirion

Pages: [1]
I modified Magil's indispensable room viewer from to add a few background replacement functions for this edition.
I hope that's okay, I would never be able to figure out how to parse those files myself.
I used it to add Serge's worst nightmare

Fan Art / the remaster is coming and no komodo pup is safe
« on: February 22, 2022, 04:47:48 am »
If they didn't want to be murdered why do they have such fashionable scales?

This news has roused me from my internet slumber.  And I'm pretty excited!  The dialog font looks nice.  I wonder how they went about the HD aspects technically, and if the required 4GB of storage is indicative of any specific method.

There's a really small detail that got lost somewhere along the way: disabling the Software Framebuffer setting is key to not losing textures on entering/exiting menus (it technically didn't need to be this way, it was just more convenient in the moment, my bad)

Chrono Cross HD Edition / Upscaling notes
« on: June 18, 2020, 08:11:52 am »
Warning: this is long and boring.

Upscaling process and known problems
I have a real slapdash collection of bash/python/rust scripts/programs to handle various aspects of upscaling, since quite a few textures can't simply be upscaled from their dumped version alone.  I also don't know much about upscaling, and certainly nothing about training my own models.  I'm hoping I can provide some tools to someone more knowledgeable about these things (and who has a beefier GPU), who can achieve some higher quality upscales.  I've tried to avoid needing to manually fix things up since I don't really intend for the current upscales to be final, and also because it'd be way too much work.

PSX things
The original textures use palettes of either 256 or 16 16-bit ARGB1555 colors.  So there's a good bit of dithering in the textures.
The psx does not have texture filtering or mipmaps.  This seems to mean that textures were free to smush different parts of the texture right up against each other without margins or gutters.

Different models seem to respond to the dithering with varying degrees of success.  For instance, the model that comes with ESRGAN makes everything in the arni background look like straw, but my attempts to undither first seemed to oversmooth things.  I wound up using gigapixel for (all but 2 of) the backgrounds because that's what that one reddit post used and nothing else I tried looked as nice, even if I think it is kind of grainy.

Every pixel is in one of three states: transparent, semi-transparent, or opaque.  On the psx these are encoded as (0, 0, 0, 0), (r, g, b, 1), and (r, g, b, 0), respectively.  To make things more sane in image editors and viewers I use a format of (r, g, b, 0), (r, g, b, [1, 254]), and (r, g, b, 255).

To avoid interpolation/extrapolation introducing a third state where it shouldn't be, I create a separate alpha mask for each state, upscale them independently, and then combine them back together to create the final alpha.  This could probably be done better, but it seems to work.

Regular ol' textures
These are mostly dumped from the iso using the purple cat tools (Some, like FATE's battle texture, seemed to be missing? so I gave up and used the dump from the game itself).  These include things like battle model textures, overworld model textures, portraits, battleground textures, weapon textures.
Split color and alpha, upscale separately, recombine.  Though most of these textures were just thrown into two passes of waifu2x without splitting, which resulted in not-so-great alpha.  I put some of them through a different process to get nicer alpha, mostly battleground backgrounds.  But any textures that have more than one uv island are still using the older upscales because of the lack of gutters.  While colors bleeding between different parts of the model already isn't great, I'm worried that alpha bleeding in the same way would create very noticeable holes.

Tall menu strip portraits
PSX textures are limited to 256 in each dimension, so these are cut in half and put side by side.  I had a script stack them, upscaled them, then unstacked them.

Dialog portraits
Every portrait uses 3(?) palettes:
  • the original from disc
  • one with all the semi-transparency bits flipped on
  • and I can't remember but there may be a third black and white one, but that's hopefully not important

Room backgrounds
These use tile maps.
  • Modified the room viewer to dump every layer as a whole image and its mappings from each disc
  • Manually delete the black cutouts on two background layers so they're transparent instead, like the rest
  • Upscale each layer, color and alpha separately
  • Fix up alpha to avoid gaps, a program looks for edges between layers and makes sure they match after upscale.  Has to take into account that some pixels simply aren't backed by a unique tile.  This only ever makes pixels more opaque, which may currently overcorrect in the case of a semi-transparent top layer and be noticeable (e.g. a bright border at the edge of water, though that may also happen without this step).
  • Recombine color and alpha
  • Create tilemaps from layers
Also, this can create noticeable seams at the boundary of layers that were cut out or copied from lower layers, since the foreground layer gets upscaled without the context of the background.  And, sometimes, the backgrounds don't cut out the foreground elements, which means the foreground element bleeds into the surrounding background during upscaling and when you run between the two it creates a weird look, since you appear to sort of pass in front of part of the foreground.

Element/tech effects
These are the ones uploaded 2048 bytes at a time, exactly as described by the egfx files.  One problem is, those files don't indicate which palettes are used by which parts of the texture, which is information needed to both upscale them and properly replace them.  If there's a way to get this information directly from the iso, I don't know it.  Currently, I dump used textures from the running game, then reconstruct the egfx's vram per seen texture, upscale that, then map them back to replace the skinny little 2048 byte slices.  This means I had to witness every single element/tech in the game, including things like boss deaths and area transitions (dragon god making things complicated right at the end).  So it's not foolproof and I probably missed a few.  But the good news is collecting all those mappings only needed to be done once, anyway, probably.

Another problem is that some of these tiny texture slices are a solid color.  Since dimensions unfortunately aren't included in distinguishing textures and all the uploads were originally 2048 bytes long, there are some name collisions e.g. slices that are fully transparent, but with different dimensions.  There aren't many, but I manually deleted their replacements because I'm not even sure what would happen.

Manually upscaled textures
Dunno how to AI upscale the UI well, so I did most of those myself using inkscape/gimp.  Finicky font atlases, reused parts of textures (the 't' at the end of field effect is actually from some other word in the texture (trap?)).  So if the kerning's all screwy or the font looks bad (I seemed to have only deja vu sans on my computer), that's on me.

I had to clean up the alpha for parts of the dialog frame, and only did the default one so the others are ehh.  You could replace them with any custom frame you want though.

I gave Serge some chainmail because it was very useful for testing trilinear filtering.  Though sometimes I think it came out looking more like a mesh shirt.

Chrono Cross HD Edition / Re: Goals, Progress, & Discussion
« on: June 09, 2020, 10:59:04 pm »
Thanks for testing it!  All of your explanations are correct.

  • I've been assuming the sony logo thing isn't my fault and must also happen with the unmodified core, because I have no idea either.
  • The world map is using 8x textures instead of 4x (just to see what would happen, mostly), so they take longer to load.
  • It is hardcoded to pngs.  Even worse, it doesn't support all png modes (like palette or grayscale), so even png optimizers aren't reliable.  Tons of room for improvement here.  Main issues are library wrangling, but there are a few complications wrt the weird alpha and mipmaps.
  • The upscaled text uses textures or font atlases.  The unupscaled text is generated dynamically, and I never figured out exactly what it's doing or a good way to replace it.
  • You're right, audio issues mean your computer can't keep up.  I can't do high framerate reliably either.  Higher cpu frequency taxes both cpu and gpu.  In contrast with raising the internal resolution which relies only on the gpu.  The gpu side stuff I added could probably be much better optimized, since I have no idea what I'm doing in vulkan, but I couldn't get any profilers to work so most attempts to speed things up there have been duds.  On the cpu side, there is ongoing work on a dynamic recompiler to replace the interpreter, but last I read you don't get the speed benefits if you also enable PGXP, which is what makes the vertices not wobbly and gives you perspective correct texturing.

Chrono Cross HD Edition / Re: RetroArch Setup
« on: June 08, 2020, 07:23:33 am »
Sorry, but it seems the ps classic can't even handle the unmodified version of the beetle core.  You'd definitely want a dedicated GPU (>= a gtx 760) paired with a CPU with good single core performance.

Chrono Cross HD Edition / Re: Goals, Progress, & Discussion
« on: June 07, 2020, 01:48:07 am »
Here's some title screen stuff:
Playstation games only have 1-bit alpha, called the semi-transparency bit, but in addition to that any pixel can also be fully transparent.  Currently I encode this as alpha = 0 -> fully transparent, 255 -> opaque, and anything in between turns the semi-transparency bit on (while discarding the exact value, i.e. alpha = 1 is treated exactly the same as alpha = 254), which uses the runtime requested blending mode.

Afaik the title screen uses additive blending.  So if you want to see it in an image editor as it would actually appear in game, then you'd move all semi-transparent pixels to a new layer underneath, make those pixels fully opaque, and switch that new layer's mode to addition.

Also, the replacement texture needs to a be a power of 2 size of the original in both dimensions, which is why the upscale has a weird resolution of 1216x768, because it's 4x the original's 304x192.

EDIT: and to further torture anyone reading, I'll mention that the psx apparently used a slightly different aspect ratio, so if you think the O in the raw logo is a bit too wide to be perfectly circular you are right, but also wrong because it works out in the end. ???

Chrono Cross HD Edition / Re: RetroArch Setup
« on: June 05, 2020, 09:52:12 pm »
I'll put this here too.
Quote from: Tirion
I uploaded a zip file with built cores to the releases page here

In that zip ( are core binaries for windows (.dll) and linux (.so) as well as a readme with some instructions on how to set everything up.  Let me know if you have any questions about it.

Also, if you're using the single disc version you can skip the m3u stuff, but when I tried it I ran into a few issues:
  • the .cue was hardcoding the .bin path, so that required tweaking (use a relative path in .cue to the .bin, and also make sure the name of the texture replacements folder also matches <whatever>.cue)
  • loading a disc 2 save created by the multi-disc version still prompted for a disc change, which I assume is just some kind of save incompatibility

Chrono Cross HD Edition / Re: Goals, Progress, & Discussion
« on: June 05, 2020, 09:46:29 pm »
Edit Title
I wonder if this could be done with some sort of graphical insert...?
Replacing the title screen logo with a custom one would be pretty easy.

Also, as far as enhancements go, the game almost runs perfectly at higher framerates (by turning the cpu frequency way up, to >200%).  But some UI elements flash, sometimes the screen flickers, and the camera pans too fast in cutscenes.

Chrono Cross Modification / Re: Chrono Cross Backgrounds
« on: May 31, 2020, 12:28:16 am »
So, Retroarch is the emulator you're using, and Beetle is the "core" of the PSX, am I correct? Upscaling the textures themselves seems simple enough, though it sounds like you re-injected them into the Chrono Cross ISO. Or is that a trick of the emulator instead?
I modified the emulator to replace textures at runtime based on their hash, so the discs are unmodified.  This also means they're not limited to 256 colors like the originals.

Upscaling the rooms themselves is a little tricky because they use tile maps, and not every pixel maps to a unique tile.  Also, some of the layers interlock with each other like pieces of a jigsaw puzzle, so those edges need to be maintained to prevent seams.

I did notice that the FMVs in Tirion's video weren't upscaled, so maybe they can be upscaled and re-injected the same way?
Replacing FMVs definitely seems possible, and now that more general texture replacement is being worked on it's probably just a matter of time.  Once that work is done hopefully any upscale pack will just use that instead, but for the moment it's still private and incomplete so this is what's available.

Chrono Cross Modification / Re: Chrono Cross Backgrounds
« on: May 29, 2020, 04:37:27 pm »
Hi, I made that upscale, but I've just kind of been sitting on it for months since I wasn't sure if I should wait for official texture replacement support in beetle.  I used a lot of tools from the modification section here, most notably the roomviewer and egfx stuff.  Let me know if you have any questions.  It's better to ask here than reddit, since I can't seem to actually post there.

Pages: [1]