DSFix 2.3 DMCA takedown

So, Bandai Namco filed a DMCA complaint against DSfix 2.3 and got my Dropbox account blocked from public sharing.

You can all let them know what you think about that.

In the meantime, here is a link to “DSfix 2.3.1″.

If you want to donate to my apparent future need for legal counsel, you can do so here. (That’s a joke by the way, at least I hope it is)

 

UPDATE

Apparently, this was done in error, in a wide-reaching attempt to purge the leaked debug executable from the internet. While it’s still a problem that the DMCA simply allows companies to take down arbitrary non-infringing files, at least there shouldn’t be any further issues with DSFix.

DSfix 2.3 – Steamworks works

So, much earlier than I expected to, I’m able to present what everyone was waiting for: DSfix 2.3 supporting the Steamworks version of the game!

There is only one change, and that is updating the address offsets for the FPS fix to work with the new version. All other features still work as expected, at least according to my testing.

That this is possible so quickly is thanks to the contributions of boowoo90 on this very blog. Is he an undercover From Software operative? Just a talented reverse engineering guru? Who knows, but he supplied the required addresses in no time at all.

Get the latest version of DSfix here.

As all but the packaging of this update is the work of someone else, don’t donate just for that! However, if you are just now getting into Dark Souls after it is freed from the scourge of GFWL and find DSfix helpful you can donate here.

And remember, if you use the FPS unlock, you need to use some other method to achieve Vsync. Options include your graphics card’s control panel, D3DOverrider, or simply running Dark Souls in borderless windowed fullscreen mode using DSfix.

FF13 article

In unrelated news, my latest article on PC Gamer just got published. It discusses the Final Fantasy 13 and 13-2 ports. Busy day today!

GeDoSaTo updates / DSfix in the Dark Souls Steamworks version

GeDoSaTo

I just pushed a new GeDoSaTo update. Among some smaller stuff, it also includes two significant changes:

  1. Fixes to the Borderless Windowed mode forcing behaviour, which should greatly increase compatibility of that setting (and hopefully not break it in anything it already worked with!).
  2. A new “performance tracing” feature which I used in an upcoming article for PC Gamer, and which I’ll describe a bit more below.

Performance tracing allows you to record the performance of a segment of gameplay to a file. There is a keybinding for it ( togglePerfTrace) which you can configure like any other keybinding (now including modifier keys!), and after recording a sequence it will output a file such as this:

The first 3 lines give general information, including the total frames measured, total duration in milliseconds and average FPS over that duration. The following 3 lines give 99, 95 and 75 percentile effective frame times. These give you a quick idea of the overall smoothness of a game.

Finally, the rest of the file is a CSV (comma-separated value) recording of each frame’s times. The individual measurements are (i) CPU time from the start of the frame to the present call, (ii) GPU time according to D3D API measurements, and (iii) effective frame time from one present call to the next. You can use this detailed data to do analysis or generate graphs in your favourite statistics tool, like e.g. this one representing frame time distribution:

I realize that tools doing something very similar already exist, but they may not report all the information, or not be open source, or not be compatible with GeDoSaTo, so I integrated the functionality.

Dark Souls update / DSfix compatibility

The Dark Souls Steamworks migration update is now live. As I expected, most DSfix functionality I implemented (which is based on API call interception) remains operational, but the framerate unlocking (based on binary hooks) does not work with the new version. This part was implemented by Nwks, so we should hope that he is still around and interested in updating it for the latest version. If not, I can try, but it lies outside my expertise and could potentially take a lot of time (which I’d rather spend on other projects). Of course, there’s also the chance for anyone else to step in, as all the code is available on github.

For now, you can use DSfix with the new version as long as you disable the framerate unlocking feature in the .ini file.

Upsampling with GeDoSaTo, other small updates

The past day or two I have been looking into making GeDoSaTo a better tool for upsampling (as opposed to its usual downsampling use case). This might seem meaningless at first, but it’s useful in a few cases.

The most important such case are retro games (or modern retro-inspired indie games) which are stuck at a specific low resolution. In such cases, GeDoSaTo can be used to provide a nearest neighbour (or high-quality bicubic) upsampling, which often looks better than a straight bilinear filter. Now recently, someone integrated Timothy Lottes’ great CRT shader with GeDoSaTo. However, this only works if the shader has a sufficient number of pixels to work with. In order to support this use case, GeDoSaTo can now optionally perform postprocessing after upsampling.

Final Fantasy 6 in BSNES

Final Fantasy 6 in BSNES

The resulting pattern for fixed-resolution games is this: add the fixed resolution as a rendering res in the config file, use nearest neighbour upsampling to your display resolution, and then run the CRT shader. This works well for both emulators and low-native-res 2D titles. Obviously, a lot of tweaking can be done to get the CRT to look just like you want it (sharpness of pixels/scanlines, gamma, bloom etc.). Here’s a gallery with some of my results.

In other news, I also implemented a few small requested features:

  • You can now set the timeout for on-screen messages from GeDoSaTo, or disable them completely.
  • Settings can be reloaded on the fly just like shaders with a keybinding, but note that not all of them take effect immediately. This is mostly useful for trying out pshashes and such.
  • More than one action can now be bound to a key/button at a time.

As always, you can get the full version here or update. By the way, if the update ever fails (i.e. immediately prompts you to update again) delete the .dll and run the installer again. And also as always, if you’d like to you can donate here.

Edit:
Also, buy Valkyria Chronicles.

Forcing Anisotropic Filtering with GeDoSaTo (in FF13 and elsewhere)

I just added a new option to GeDoSaTo, forceAnisoLevel.

You can use this option in any game, but it only makes sense in a select few. If you force anisotropic filtering in the driver, it’s smart about which surfaces and original filtering types it overrides – that’s why it very rarely breaks games, and this makes perfect sense for a driver option.

However, specifically in the case of running stuff at resolutions it was not built for and downsampling, it is sometimes beneficial to apply filtering even to surfaces specified to be point filtered, which is something the driver doesn’t do (as it could often break shaders).

The main reason I added this feature is FF13, or more specifically its HUD and menus. These are point filtered by default (since they are rendered 1:1 at 1280×720), which looks terrible at higher resolutions. This setting alleviates the issue, though of course higher-res UI assets would still be preferable. Here’s an example of the difference:

To use it, add a user-level FF13 settings file (if you don’t already have one) and add the line forceAnisoLevel 16 to it. See here for details on settings files – I have seen that this causes quite some confusion and sometimes erroneous bug reports.

As always, you can get the latest version by grabbing the installer here or simply update, and if you want to you can donate here.

How recent Unity games do stuff, and a new GeDoSaTo version

Dreamfall Chapters: Book 1 was just released (go buy it), and it’s another game using the Unity engine. Like with another recent Unity title, Wasteland 2, it refused to work with GeDoSaTo. Now, since I like both of these games a lot I invested some time to find out what’s happening, and hopefully fix it.

Without further ado, here are my findings. This is what recent Unity engine games do on Windows if you select “fullscreen” mode. Note that all of this is based on deduction from the behaviour of Dreamfall and Wasteland 2, someone with access to the Unity source probably has a more exact understanding:

  1. Check the desktop resolution and create a fullscreen window as well as a DirectX device with that size.
  2. Check the native monitor resolution (using GetMonitorInfo), and reset the device/window to that size.
  3. Render at whatever resolution you specify in the game settings, to an off-screen surface.
  4. Stretch that surface to the window.

So, no real fullscreen mode in sight. Why would you do this? Well, it has multiple advantages: you don’t lose your resources switching to another rendering resolution, alt-tab behaviour is much faster and more stable, and you get free, correctly implemented triple buffering if the user is using Aero.

Obviously, this majorly messed up the way GeDoSaTo works — and the same goes for traditional downsampling methods. In the latest version, it’s now possible to downsample Unity games following this scheme, provided you add this magic formula to their configuration file:

It works by “pretending” that both the desktop and monitor are the given renderResolution in size, forcing that to always be reported, and modifying the mouse cursor position used by the game (so that clicks register correctly). GeDoSaTo takes care of actually constraining the fullscreen window to the correct size, and of course performs a high-quality downsampling of the rendering result as always.

Since the resolution you want to downsample from needs to be known before the game requests any, only a single rendering resolution can be provided.

Cursor Sidenote

Already in earlier versions, a problem in games using windowed modes was that custom cursors would be lost outside of the rectangular region corresponding to portion of the screen that would be taken up by a window downscaled by the downsampling factor. I figured out why this happens: To make games work, the cursor positions reported to them need to be adjusted (modifyGetCursorPos). This works for any processing within the game, as it thinks it is operating within a larger rendering area.

However, an issue occurs for cursors: I found out that many/most games use the Windows API WindowFromPoint function to check if the mouse is within their window before setting the cursor, passing the modified coordinates. Now obviously, Windows knows what the real window sizes are, and the modified virtual coordinates fall out of them. So I had to apply the reverse transformation in that function.

Release

Anyway, the new version is called “Tokikagura”. Other than the stuff discussed above it also includes some GeDoSaToTool fixes.

As always, grab the installer here or simply update, and if you want to you can donate here.

By the way, Nvidia’s DSR can’t downsample in these games (for now). Take that big boy corporate version!

FF13 micro-update

Another small update to fix some reported issues:

  • Fixed lack of postprocessing when disabling HuD
  • Fixed crash on alt-tab (again)

The latter took a lot more time to figure out than I expected. It seems that the game is actually leaking a backbuffer reference :/

About texture dumping/replacement: After getting the current GeDoSaTo facilities to work (more or less) on FF13, I figured out that most interesting textures (e.g. the fonts) aren’t actually being loaded using D3DX, so the existing mechanisms don’t help at all. I have a different method in mind (for a long time now actually), but this will take some time to implement.

Talking about time, what I wrote about on the blog a few days ago regarding not really having any time due to “real world” workloads applies now even more than before — after I spent basically the entire weekend on FF13. Therefore, don’t expect updates from me until next weekend.

That said, I’ve seen a lot of new forks at GitHub, so perhaps someone will make some contributions! I’ll try to merge good additions as quickly as possible if there are any.
As always, you can use the installer here to get the latest version (or just press the update button!), and you can donate here.

Small FF13 Updates MK2

I just pushed a new version once again, with these improvements/additions:

  • Added shadow scale option (increases shadow resolution)
  • Added settings for the number of MSAA samples and coverage sampling (that is, CSAA or EQAA depending on your GPU)
  • Mitigated issues with large screenshots (taking a screenshot should never crash now, but it might still fail at very high resolutions or settings – it will report that failure though)
  • Changed scaling order, fixes some sharpness issues

A few words on performance, according to my testing: Starting from a base setting of 3840×2160 with bicubic scaling at 60 FPS I get a GPU usage of 66% on my 770.

Increasing shadow scaling to 4 gives a very marginal increase to 67% (basically free on my system). Setting it to 8 goes up to 70%.

Going from the default 4xMSAA to 16xCSAA increases GPU usage from the 66% base to 70%. Worth it in my opinion. 32xCSAA (that is, 8 MSAA samples + coverage AA) goes up to 80% and the improvement is debatable.

As always, you can use the installer here to get the latest version (or just press the update button!), and you can donate here.

Small FF13 Updates

There’s a new version of GeDoSaTo with a new FF13 plugin up now. It includes these improvements:

  • Fixed crash on Alt-tab
  • Fixed all known instances of cut-offs (including e.g. items and settings) without introducing artifacts
  • Fixed AMD user issues and minimap (thanks to Garteal for investigating this!)

I’ll do a more in-depth look into the screenshot issues and the problems with texture dumping/replacement tomorrow, I really want to get a high-res font replacement.

Also, I did some initial experiments with increasing shadow resolution. Sadly, without also improving the filtering quality that doesn’t help all that much. And improving the filtering quality would require reverse engineering and replacing the shadow rendering shader, which is a longer task, so I’ve put it towards the back of the queue for now.

Anyway, as always, you can use the installer here to get the latest version (or just press the update button!), and you can donate here.

GeDoSaTo Beta 0.14 “Barrage am Ring”

I’ll shortly release a new version of GeDoSaTo, which includes a pre-alpha version of a custom plugin for Final Fantasy XIII. Its current features are:

  • Arbitrary rendering and presentation resolutions (only 16:9 though)
  • HUD hiding (using the normal GeDoSaTo keybindings)

It’s bugs and known issues are:

  • Some off-by-a-bit scaling issues, making the output less sharp than it should be in some circumstances
  • DoF effects are unchanged (still at original, low resolution – this is more apparent in contrast to higher resolutions)
  • Probably some stuff somewhere is cut off. I saw some scissor calls and am not dealing with them yet
  • Crashes when taking screenshots using GeDoSaTo
  • Rendering resolutions larger than 3840×2160 don’t work
  • Probably lots more

Some observations:

  • The game performs really well from what I’ve seen, both GPU and CPU-wise. But their frame limiting/pacing stuff sometimes seems to bug out.

Tons of stuff can still be improved — obvious ones like fixing bugs and the DoF, but also e.g. probably shadow resolution — so if you like this work and want it to continue consider donating.

Of course, I’d also really appreciate any development or debugging contributions. As always, the source is on Github.

You can download the installer from here, it will automatically grab the latest version.

Don’t report bugs in the comments, report them on GitHub (and check for duplicates or if they are known issues).