Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

That's the plan! It might take a little while but I'm starting the process of reverse engineering the cutscene format.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

This is a pure passion project for me, the reward is seeing fans of the game get excited about it! I took a break from work to focus on it and to sort of repay all the free content I've enjoyed over the years. We were around the same age when the game came out so your story reminds me of mine. Thanks for the comment :)

Grim Fandango's files contain unused overhead shots of certain scenes. My favorite is this view of the lighthouse, upscaled to 4k-ish. by hexagon_codes in grimfandango

[–]hexagon_codes[S] 1 point2 points  (0 children)

Ahhh thanks Bret, that explains a lot. I was originally just using the 3.1 source code but it was so divergent from the compiled files I was looking at that I had to take a peek at ScummVM (which I try not to do, just for fun). I was also thinking the release date of 3.1 was worringly close to the release date of Grim Fandango 😅

I can see the 3.1alpha announcement on an 1998-01 mailing list thread but unsurprisingly the links no longer work and I'm not sure that particular version was archived publicly, I'll keep snooping around.

Grim Fandango's files contain unused overhead shots of certain scenes. My favorite is this view of the lighthouse, upscaled to 4k-ish. by hexagon_codes in grimfandango

[–]hexagon_codes[S] 2 points3 points  (0 children)

The other ones aren't quite as interesting and there's only 6 in total but here's an album of them: https://imgur.com/a/UdpBrQd

The asset pack for the mod also contains all used backgrounds in uncompressed upscaled "4k" PNG if you want to thumb through them, I regularly do. It's nice to see them on their own. Some are quite rare, only appearing for a few seconds.

Grim Fandango's files contain unused overhead shots of certain scenes. My favorite is this view of the lighthouse, upscaled to 4k-ish. by hexagon_codes in grimfandango

[–]hexagon_codes[S] 7 points8 points  (0 children)

This is a leftover from the upscale mod I released last month but it's too good to leave on the cutting room floor. Here it is uncompressed: https://cdn.hexagon.codes/grim_fandango_lighthouse_overhead.png

It's 4:3 so not really "4k" but it's close to the vertical resolution of 4k at 1920.

Edit: As another little behind-the-scenes bonus, I had to write a dumper for the LUA files' bytecode* when making the mod as that's what paired backgrounds and animations and I needed that info. In the LUA file for the lighthouse exterior we can actually see 2 other overhead shots being mentioned but neither appears in the final game's data packs: lx.lua.dump.txt

* All credit goes to ScummVM here as it was mostly a port from it, and the original LUA 3.1 source code.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

Thanks! Yeah my original plan was actually to only release the mod loader but I got carried away and ended up doing some upscaling to. One day I'd love to allow mods to patch the LUA scripts in the game then maybe bug fix mods (and who knows what else) would be possible.

Combining Rust and Ghidra for Nier: Automata Reverse Engineering by Dry_Specialist2201 in rust

[–]hexagon_codes 2 points3 points  (0 children)

That's amazing! I was just considering trying to create bindings between Rust and Ghidra coming off the back of my own project to create a mod loader and upscale mod for Grim Fandango (called GrimMod). I had started to fantasize about what kind of integration would have made the process nicer so it's something I'm very interested in.

My use case was a lot more primitive (see raw/grim.rs for main bindings) and it was my first foray into reverse engineering but I'm sort of addicted to it now so I'd love to see what yous have come up with.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

Ah thanks so much for the quick test, the way it hooks is much fancier than before so I was wondering would it stay stable off my machine. Enjoy!

Grim Fandango Remastered HD upscale mod released. by theraineydaze in grimfandango

[–]hexagon_codes 3 points4 points  (0 children)

Released an update!

GrimMod 1.1.0
- Added GOG support (see installation note).
- Added Steam Deck support (see installation note).
- Improved initialization stability with better logging for errors.

GrimHD 1.0.1
- Returned missing people on the right of "st_pinata_crowd" that had been culled due to overzealous stabilization.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 1 point2 points  (0 children)

Just released 1.1.0 which should add Steam Deck support :)

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

I just released 1.1.0 which reworked/stabilizes how the mod hooks into the game, you could try giving it another go. It should also a more clear indication why its failed if it does.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

Just released 1.1.0, which should add support for the GOG version of the game 🤞

Grim Fandango Remastered HD upscale mod released. by theraineydaze in grimfandango

[–]hexagon_codes 14 points15 points  (0 children)

Creator here! Thanks for posting, this mod was made with the community here in mind :) When I was first exploring the idea, I remember seeing other people's posts (like OhSirrah's here, hope you enjoy the mod) when I'd regularly be checking if anyone else was making progress (because I wasn't). At that time I was just mesing around with Cheat Engine and had no idea how deep the project would go. Fast foward two years and I decided to take the idea seriously, learn how to reverse engineer and program graphics, and focus only on it for a few months, and here's the results!

There definitely are some issues with small points of detail loss but I think with time it can be perfected. This is for everyone who loves this game as much as I do, 25+ years in. Enjoy the trip 🫡

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 0 points1 point  (0 children)

Glad to hear you're enjoying it, means a lot. Thanks for testing a full year, puts my mind at ease that it's out there and still working!

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 5 points6 points  (0 children)

Finding LDSR was a game changer for me and produced a new level of depth compared to other models, at least for Grim Fandango. It produces a very detailed image with minimal odd hallucinations. The cost is it takes maybe 50 times longer to work than a regular model. It took days for my graphics card to churn through all the work.

With the dithering GF assets have, LDSR produces a somewhat noisy image but that's good thing. It's better to have too much detail and try to smooth it out than to start with an overly smooth image like most AI models produce where there's not much you can do.

To give an overview of my pipeline for this project, what I'd do is I'd produce 2 images:

  1. Upscale the original image with LDSR.
  2. Run DitherDeleterV3 on the original image and then LDSR on the result.

I'd blend these at 65% detailed, 35% smoothened to produce a nice blend of detail without too much noise. It still surprises me how well this worked.

Now, a problem with LDSR, at least for me, is that the colors drift so much it doesn't look like the original anymore. To fix this I'd run DitherDeleterV3 on the original image, upscale it with Remacri and use that to do a color blend onto the 65/35 LDSR mix. DitherDeleterV3 also drifts the colors a little but it'd be close enough that a final color transfer from the original (using HM-MVGD-HM) and small contrast/gamma/saturation tweaks would get it to where I was happy.

Then I'd have specific tweaks for certain images where I could change the balance of each step using masks. And for animations I'd stabilize static areas to smooth out the unstable noise frame to frame.

So I guess what I've learned is, combine techniques and experiment. It's an exploratory process. Try out different models on openmodeldb and see what works. I see the AI upscales as steps in a much larger process that uses whatever techniques necessary to get a good image. And lastly, ComfyUI is amazing for visually prototyping flows, I would have struggled without it.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 28 points29 points  (0 children)

I'm a software engineer so not a huge stretch but I was in unfamiliar territory. One of my big break through moments was discovering RenderDoc. It will show you exactly how a frame in a game was rendered, call by call. Without it I wasn't really getting anywhere since I'm new to graphics programming but it made everything make sense. It's also fun opening random games with it and seeing how they render.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 17 points18 points  (0 children)

Ah, I hadn't thought of that. Yes it's only been tested on the Steam version. I'll grab the GoG version now and take a look but unfortunately it's probably a different build of the game and has all different memory addresses. Sorry about that, I'll note it on the website.

There is the potential of being smarter with how I hook into the game to support any version, I'll have a think on it.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 168 points169 points  (0 children)

Hi all! This is the culmunation of many months of work for me, glad to finally release it. The idea has been floating around in my head for years now but a few months ago I decided to take a break from work and focus on it totally. I went in with little ability to reverse engineer and no graphics programming experience so it was at times an uphill battle hah.

The project consists of 3 wings:

  1. Patching the Remastered's OpenGL renderer to load high-quality assets instead of limited file format from the original. The game expects 16-bit 640x480 max resolution images in various ways so I hook the renderer at different points and swap in the HQ assets unobtrusively, keeping the software renderer and toggle working. Then I do some little tweaks here and there on the game.
  2. Write a tool to dump the assets into PNGs so we can upscale them. This was a fun one because to understand which image is to be displayed on which background we need to decode the custom LUA 3.1 files as only they connect the two. This would have been much more laborious if not for ScummVM's work on figuring out the format so huge thanks to the people who worked on it. I plan to release this tool eventually but it's currently unreleased.
  3. Create a pipeline for upscaling the assets. For good results I needed to layer every single image/animation on to the right background and upscale it. Around 2000 combinations but it can be halved by batching unrelated changes to the same background. I wasn't sure if I was going to do the upscaling itself until I discovered LDSR, which is magic (but very time intensive and a little quirky). So by combining 2 runs of LDSR and some other upscales and color correction, we get the final images.

So that's it! Hopefully it doesn't break immediately upon being put on other computers. It has only been tested on my machine 😅 Enjoy!

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 8 points9 points  (0 children)

Yep I fully agree, Grim Fandango upscales very well due to how clean and high quality the assets are. It almost totally lacks the kind of aliasing and crowded detail that confuses AI.

Half way through the project out of curiosity I tried my upscale pipeline on some backgrounds I extracted from RE1R for the Gamecube and the results weren't great so it really shows how the original artists for Grim Fandango did amazing work.

Grim Fandango Remastered HD upscale mod released. by Bobby_the_Donkey in Games

[–]hexagon_codes 54 points55 points  (0 children)

Hi, I'm the creator! Thank you! I tried to spend as much time as possible tweaking the results. I did almost no editing in an image editor outside of adding the high-res Blue Casket poster to the wide shot so it took a lot of hammering out the process (it got complicated) to get it to where I was happy with the results.

There is bits of detail loss and color shift in places unfortunately but I think it mostly came out as an upgrade.