Our Version of Kuro no Kiseki does Not, in Fact, Have a Memory Leak

The Legend of Heroes: Trails through Daybreak

The spriggan known as Van Arkride, an underground professional, accepts any job, acting as detective, negotiator, or bounty hunter. Dive into the Trails series' latest chapter with intense combat, beautiful visuals, and a new alignment system in Calvard!

Hi everyone, Today is the release of the Japanese version of Kuro no Kiseki, and it is the first port to use a lot of new infrastructure we at PH3 built up over the past year or so. That infrastructure includes things like asset compression and platform handling, mundane features like logging and crash reporting, and dealing with game settings. But what does any of that have to do with the strange title of this article, and why should you care? Well, if you are not one to worry about technical details, then you probably won’t notice anything, and can get to playing right away. However, if you are inclined to observe what games are doing a bit more closely, then – depending on your PC hardware and software setup – you might very well get the idea that our version of Kuro has a severe memory leak issue. And that’s primarily what I want to clear up with this post on how we purposefully use all that memory. [h2]The p3a Archive Format[/h2] In Kuro, we are using our p3a archive format, which contains compressed assets. If you want to read a more general deep-dive into game asset compression, storage and loading then we have a more technical post up on our [url=https://ph3at.github.io/posts/Asset-Compression]company blog here[/url]. I’ll quickly summarize the main ways in which this affects Kuro: [list] [*] We are able to ship the entire game while requiring [b]only ~9 GB of disk storage space [/b]– perfect e.g. for owners of one of the more affordable Steam Deck versions. [*] Modders need not worry: you can still access individual files easily. We purposefully included “p3atool” with the game, which is our internal tool for building these archives (and can of course also unpack them). [*] By using ZStandard with dictionary compression, and optimizing loading in general, we can achieve this file size reduction without a heavy impact on loading times. [*] Specifically, after playing for a while and getting the caches warmed up, you might see map loading times of roughly [b]500ms[/b], or half a second. [/list] That final point is what the title is about: caching. [h2]Using all that Memory[/h2] Quite a few years back, I noticed that the amount of memory available in a decent fraction of PCs was quickly outstripping what the vast majority of games are actually using. While most games have some sort of internal caching, they generally do not seem to scale that with the amount of memory available. As you might have guessed by now, the default setting in Kuro does exactly that: it uses up to 80% of the available memory to cache loaded and decompressed assets. And this does mean that when you play for a very long time, and have a lot of main memory, you might actually see the game process using 20 GB or even more of it – and hence the title of this post. [i][b]This memory is not wasted or leaked – it is kept on standby to make the loading times even shorter, especially when revisiting maps. [/b][/i]However, if for any reason you dislike this automatic behavior, you can also set a fixed cache size limit or turn off caching entirely in the game’s general settings menu. [h2]A Very Brief Feature Tour[/h2] Talking about the settings menu, there’s quite a lot in there. We hope to provide a more in-depth overview by the time the English release of the game is ready, but for now, here is a short list of features of the port that are either sufficiently important to include here, or just personal favorites: [list] [*] [b]Arbitrary resolution and aspect ratio support. [/b]That means that 21:9 ultrawide is supported just as well as the Steam Deck’s 16:10 aspect ratio. Of course, as always, some specific UI screens will have black bars. [*] [b]High frame rate support. [/b]We officially support up to 360 FPS, which is particularly valuable given the somewhat more dynamic combat system in Kuro compared to previous games in the franchise. [*] [b]A field of view setting[/b] – in addition to the field of view scaling automatically with the aspect ratio. [*][b] A broad range of graphics options,[/b] including: [list] [*] Shadow resolution, filtering and local shadowing quality [*] Sub- and supersampling of the game’s main rendering, without affecting UI [*] Draw distance adjustment for NPCs, enemies, map level-of-detail, and dynamic lights [*] Quality settings for screen-space reflections and volumetric lighting [*] Minimap multisampling (this is one of those personal favourites)[/list] [img]{STEAM_CLAN_IMAGE}/43729251/56117744c9514823a019f31bdd3689f5881bdc34.jpg[/img] [img]{STEAM_CLAN_IMAGE}/43729251/b8b350f7750735024de860d4050889105da97c0d.jpg[/img] [*] An immediate [b]in-game graphics option preview[/b]. This lets you see the impact of option changes live while you make them. [*] [b]Full mouse / keyboard support, [/b]which means that: [list] [*] Menus can be navigated entirely with the mouse [*] We offer multiple different gameplay options for combat controls, including target lock on or free camera, the option to automatically select targets based on camera look direction, or alternatively based on mouse flicks. [*] Everything is fully rebindable, with additional action bindings available for hotkeys beyond what can fit on a controller. [*] And of course, all prompts are dynamic and respect your rebinding as well as your physical keyboard layout.[/list] [/list] I’m sure I forgot quite a few more minor features there, but that should be the most important ones. [img]{STEAM_CLAN_IMAGE}/43729251/ce8f9e544926d5c33b07f2a5ba0ef1f647c70996.jpg[/img] Before leaving you to enjoy the game, I’d like to note that we also specifically worked on Steam Deck optimization, to eliminate a particular issue that reduced performance significantly in some areas while running via DXVK. All that said, I’m very happy with how this port turned out, and as always want to thank our team at PH3, the fine folks at NISA, and of course the beta testers for their outstanding work. Peter “Durante” Thoman, CTO, PH3