Giter Site home page Giter Site logo

apex-legends-cache's Introduction

apex-legends-cache

⚠️ Deprecation Notice

Since the release of DXVK 2.0, the Nvidia 525 driver, and the work done in Mesa on the GPL, the necessity of state cache file has been almost entirely elimited. There have been no contributions to this file since late Oct to early Nov 2022. Because of this, I will no longer be actively maintaining a cache file for others to use. At the start of Apex Season 16 this repo will be archived. Thank you to everyone who contributed entries and helped make Apex Legends a great experience on Linux.

What does this file do?

The first time a new player on Linux tries to play Apex Legends it can be a horrible experience. From occasional stuttering when a new shader is cached, to complete freezes and crashes as hundred or thousands of new shaders a processed. These problems also plague long time Apex Legends on Linux players as each new map update has a huge impact on game performance requiring re-rendering of shaders. This repository will hopefully become a large community effort to make Apex Legends on Linux a smooth and enjoyable experience for everyone.

Why do we need this?

Apex Legends uses the Direct3D 11 rendering engine which is not supported on Linux. Instead, Proton uses DXVK to provide a Vulkan-based implementation of D3D11 and 10. While this works great for most games, some have a lot of shaders that need to be accessed while you play the game. The Valve team handles most of the pre-caching of these shaders from community sourced files, but they do not distribute this one file which assists with accessing these pre-cached shaders. A more detailed explanation of what goes on behind the scenes can be found in this r/linux_gaming thread.

Instead of each player having to drop in multiple times with unplayable rendering lag and stutter, we can combine the efforts of multiple Apex Legends players by combining our dxvk-cache files using the dxvk-cache-tool created by DarkTigrus. Lutris provides a build of this tool here.

This effort was originally started by u/ryao in this r/linux_gaming thread. This thread worked well for a while but will eventually get lost in the history of the subreddit and may not be easy to find, especially for new players. Additionally, the history of the cache file is not readily available and cannot be quickly reverted in the event of a bad merge. This repository will also add more transparency to each merge, make it easier to give credit to each contributed, and can be more easily forked/transferred should I or any future maintainers decide to stop working on this project.

Using this file

Apex Legends MUST be using a Proton compatibility tool that uses dxvk state cache file version 15. The current cache file uses v15 and no attempts will be made to support earlier versions. As of Aug 10, 2022, Proton Experimental and GE-Proton7-27 or later are fully compatible.

Single-line installation

This single line will download the cache, and save it in the default Apex Legends state cache directory.

curl -LO --output-dir ~/.local/share/Steam/steamapps/shadercache/1172470/DXVK_state_cache/ https://github.com/bcook254/apex-legends-cache/raw/main/r5apex.dxvk-cache

Or if you're using flatpak

curl -LO --output-dir ~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/shadercache/1172470/DXVK_state_cache/ https://github.com/bcook254/apex-legends-cache/raw/main/r5apex.dxvk-cache

If the output location does not exist, curl will display an error letting you know that the folder does not exist. This is most likely due to your state cache folder being in a different location. If your state cache folder is in a non-default location, you must change the --output-dir option and re-run the command.

You could also clone this repository to your local machine and either manually or automatically pull each update and copy your local repository files to the same location listed above. This does require installing and setting up git and git-lfs for which there are many guides available online.

Contributing cache files

As this is a new project, I am open to new ideas on how we can make this process easier and faster for contributors and maintainers. If you would like to propose new ideas or start a discussion around this, please open an issue.

⚠️Important Information⚠️

For some reason with each map change, Apex Legends no longer uses any of the previous state cache entries. This is leaving a lot of unused entries behind and creates a larger than necessary file. Therefore with each map change the current cache file will be reset and populated with new entries. This mean you MUST delete your old state cache file and begin generating a new one. Submissions with old entries will be rejected if they contain these entries for the time being.

Open an Issue

Begin by downloading the most recent version of the cache file from this repository here, r5apex.dxvk-cache file, or this direct link.

Next, copy your local cache file in to the same folder that contains that cache file you downloaded. Assuming you are using the command line and are currently working out of said folder it might look something like this.

cp ~/.local/share/Steam/steamapps/shadercache/1172470/DXVK_state_cache/r5apex.dxvk-cache ./r5apex-local.dxvk-cache

Merge the downloaded cache file with your local cache file. Building off the previous command it should like something like this.

dxvk-cache-tool ./r5apex.dxvk-cache ./r5apex-local.dxvk-cache

Upload the output.dxvk-cache generated file to your preferred location and make a publicly accessible link for it.

Open up an issue, making sure to use the Cache File Entry issue template. You can also use this link, Cache File Entry. Please fill out the entire template! It makes it that much easier for me. ⚠️ The final number of entries added may change if a previous cache entry must be merged before merging your cache entry ⚠️

Pull Requests

Contributors may still create pull request as described in earlier versions of this document, but it will no longer be the preferred method. This method led to a lot of merge conflicts at the beginning of each map change as multiple people contribute to the project.

Contributions

Other Projects

TheMethodicalJosh An automatic download script at TheMethodicalJosh/apex-legends-cache-automated

Cache Files

u/ryao (original maintainer on r/linux_gaming)
u/Melon__Bread
u/najodleglejszy
u/PsychologicalLog1090
u/a9dnsn
u/LilCalosis
u/Flubberding
u/AnyEntertainment8080
u/arvind-d
u/DAVE_nn
u/yourfavrodney
u/jumper775
u/Tiflotin
u/NineBallAYAYA
u/CaptainKrisss
u/Nik0ne
u/Tenshar
u/-ThunderFox - 3604 entries
u/EpicCreeper713
u/Kitchen-Drop236
u/SneakySnk
u/K1f0
u/gudhost
u/wanna_play_r5
u/baryluk
u/sP6awFXL94V6vH7C
@cybersandwich - 88 entries
@codebam - 278 entries
@xPakrikx - 1336 entries
@maxxnino - 558 entries
@bagusnl - 45 entries
@Enluka - 35 entries
Whom - 12845 entries
@NotTheTime - 5 entries
@SohamMalakar - 814 entries
@RMED24 - 2371 entries
@Nightails - 570 entries

Thank You!

This would not be possible without everyone who originally contributed to this file when Apex Legends first supported Linux and could not continue to be possible without each contribution and user from the community.

Together, we will slátra our enemies.

apex-legends-cache's People

Contributors

aerysh avatar alvesvaren avatar bcook254 avatar broderpeters avatar eonfge avatar fskiller avatar k1ngjulien avatar maramowicz avatar mateasv avatar mitchelpaulin avatar nickpelone avatar nightails avatar paulora2405 avatar qz4 avatar sclayton33 avatar shuna322 avatar timothyt87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apex-legends-cache's Issues

More Beast of Prey entries

Here is another one with entries for at least one of the BR maps. It's weird how our progress just gets reset randomly with updates that don't even seem to touch the maps.

Merging r5apex.dxvk-cache (1/2)... 15186 new entries
Merging r5apex(1).dxvk-cache (2/2)... 1224 new entries
Writing 16410 entries to file output.dxvk-cache

[Question] Any plans to also host VKD3D cache file?

Apex Legends just announced their beta for DirectX 12 in reddit Dev blog which also means that it will use VKD3D instead of DXVK in Linux. Currently the cache file is written not in shadercache folder, but instead in the game installation dir, the file is named vkd3d-proton.cache.write.

Is there any plan to also include this cache file in this repo?

Here is the example file from my system just after it loads up to Main Menu: vkd3d-proton.cache.write

File size is not right after doing a git pull?

I setup this repo in my DXVK_state_chache dir so that I could theoretically do a git pull every time there is an update. But for some reason the file is not even close to what it should be. dolphin says its 132 bytes, and it shows 6.73 MB on GitHub. Any ideas why this might be?

In the mean time I will just download it manually.

Latest DXVK release allows for shader pre-compilation

Hey,
So a few days ago I found out about the latest release (Version 2.0) of DXVK and it's changes to shader compilation.
It says: "On drivers which support VK_EXT_graphics_pipeline_library, including the IndependentInterpolationDecoration feature, Vulkan shaders will now be compiled at the time the game loads its D3D shaders, rather than at draw time. This reduces or eliminates shader compile stutter in many games."

So I switched to Proton Experimental for Apex in steam, because it's using the latest dxvk release, deleted my cache files and started the game. On start up the game compiled the shaders for about 2 mins and after that I was good to go.
I played a few games on the different maps and I've had no more issues with stuttering. Also the r5apex.dxvk-cache file is now only 12 Bit in size and won't increase.

Does it also work for you guys?

Even more S15 cache

Cache file:
https://transfer.sh/k90ATH/output.dxvk-cache
Entries numbers:

dxvk-cache-tool r5apex.dxvk-cache r5apex-local.dxvk-cache
Merging files r5apex.dxvk-cache r5apex-local.dxvk-cache
Detected state cache version v15
Merging r5apex.dxvk-cache (1/2)... 3989 new entries
Merging r5apex-local.dxvk-cache (2/2)... 32920 new entries
Writing 36909 entries to file output.dxvk-cache
Finished

Would you like to be included in the cache file contributor list?
Yes, my twitter

Resetting the cache state file

After playing today it seems to me that each "large" map change or new map is going to invalidate most of the cache state file that we are working on here. I want to start a conversation around resetting the cache file when one of these major changes comes about. Obviously this is not ideal as each season and sometimes even more often we will have to do all the caching over again. The lag issue CAN be overcome by running DXVK_ASYNC=1 when you have a version of Proton that supports it. Without more expert knowledge on how the state file works, resetting the state cache file as we notice it begins to lag again seems like the best option until someone can some up with a custom merging and state file hosting solution. Is this something people would be okay with?
Each reset would rely on people willing to play many games and those who run with DXVK_ASYNC enabled to quickly build up something playable for others to use and start contributing.

Please post your thoughts here.

Make it easier on the user to contribute their files.

I was thinking about that before, even started some prototype but then scratched it.

Could we do an automation for that? I have 2 ideas in mind.

One idea is to make merging server, allow to upload cache file, merge it on the server and create PR. That requires server but it would be pain-free for the users.

cache-upload ~/Path/To/SteamLibrary

Another one could be creating script that will automate it locally. You would point it to steam library and if merg tool is installed (or could be included, as git submodule perhaps, or directly?) it would merge it. You would still have to make PR manually (unless we use hub then that part could be automated as well).

Second script to download newest file from the server, it could download it or use current git copy and merge it with your local cache.

What I was worried about was that someone could intentionally break cache file somehow, but if we use github for that, than PR has to be merged by human, so the risk is much lower.

It's just food for thoughts, maybe someone has better suggestions how this could be done?

Cache File Entry

cachefile
Make sure it is publicly accessible from a reputable hosting source. Many people have used a discord file link or dropbox like hosting service.

How many entries did this cache file add during your merge?
70

Would you like to be included in the cache file contributor list?

Link to an alternative automated script

Just first of all, thanks for setting up this repository and helping all us Linux Apex Legend players have a good experience, along with all of the contributors that have helped merge a better cache file.

I have wrote up a simple script that would automate the process of downloading the cache file, and merging it with the old. I have set up a repository for it here: TheMethodicalJosh/apex-legends-cache-automated

Please feel free to advertise this or advise changes as needed. It's probably not a perfect script, but it does work really well from my testing until a true resolution is fixed.

Thanks again!

Cache addition with gungame maps

Include a link to the cache file here
Link

How many entries did this cache file add during your merge?

Merging r5apex.dxvk-cache (1/2)... 14172 new entries
Merging r5apex(1).dxvk-cache (2/2)... 0 new entries
Writing 14172 entries to file output.dxvk-cache

Would you like to be included in the cache file contributor list?
Yes, Whom

New entries - 7.7.2022

Include a link to the cache file here
https://drive.google.com/file/d/1uA-9w_hUxep8TlOVyGFnShx_9A8D2TIU/view?usp=sharing

How many entries did this cache file add during your merge?
558

Merging files 1r5apex.dxvk-cache r5apex.dxvk-cache
Detected state cache version v10
Merging 1r5apex.dxvk-cache (1/2)... 7404 new entries
Merging r5apex.dxvk-cache (2/2)... 558 new entries
Writing 7962 entries to file output.dxvk-cache
Finished

Would you like to be included in the cache file contributor list?
Yes, maxxnino

Cache contribution

Spent many an hour spectating people and auto-spinning while using grav cannon to build it up fast.

Include a link to the cache file here
https://ovexon.com/r5apex.dxvk-cache
(its my server, an OVH box in France, its just in a webroot of a blank wordpress)

How many entries did this cache file add during your merge?
1201

Would you like to be included in the cache file contributor list?
Idc

Let me know if you want a website to do this I wouldn't mind making one if no one else is.

Season 15 extra (returning maps are here)

https://cdn.discordapp.com/attachments/786121802384015372/1039996291062714370/output.dxvk-cache

$ ./dxvk-cache-tool r5apex.dxvk-cache
Merging files r5apex.dxvk-cache
Detected state cache version v15
Merging r5apex.dxvk-cache (1/1)... 5356 new entries
Writing 5356 entries to file output.dxvk-cache
Finished

I have merged the cache that was added like an hour ago, but I played some games since that merge

I'm already credited just increase the entry count. Thanks!

Cache addition

Include a link to the cache file here
Make sure it is publicly accessible from a reputable hosting source. Many people have used a discord file link or dropbox like hosting service.
https://cdn.discordapp.com/attachments/592799571860520963/1011374534680649820/output.dxvk-cache

How many entries did this cache file add during your merge?

Detected state cache version v15
Merging r5apex.dxvk-cache (1/2)... 11898 new entries
Merging r5apex (copy 1).dxvk-cache (2/2)... 570 new entries
Writing 12468 entries to file output.dxvk-cache

Would you like to be included in the cache file contributor list?
Yes, as Whom

New Cache Entry - 10.08.2022 | New Season 14 state cache version 15 can't merge

https://cdn.discordapp.com/attachments/827099523091660801/1006814728644997171/r5apex.dxvk-cache

New season seems to use newer state cache version that is not compatible to be merged from the one in the git file. I'm using ProtonGE-7.28 when making this cache, if that's has any relevancy.

$ ./dxvk-cache-tool r5apex.dxvk-cache r5apex-git.dxvk-cache -o apex-merged.dxvk-cache
Merging files r5apex.dxvk-cache r5apex-git.dxvk-cache
Detected state cache version v15
Merging r5apex.dxvk-cache (1/2)... 321 new entries
Error: Error { kind: InvalidInput, message: "State cache version mismatch: expected v15, found v10" }

How many entries did this cache file add during your merge?
321 entries

Would you like to be included in the cache file contributor list?
yes, bagusnl

Cache-entry

Include a link to the cache file here
I used filebin.net

How many entries did this cache file add during your merge?
Merging r5apex.dxvk-cache (1/2)... 27341 new entries
Merging r5apex-local.dxvk-cache (2/2)... 88 new entries

Would you like to be included in the cache file contributor list?
yes, (cybersandwich)

Cache not improving gameplay on Olympus

Seeing as we didn't have Olympus or World's Edge for the past week the lag would make sense for the next couple of days as we rebuild the cache file. I just hopped on with our latest cache file on World's Edge for the first time this season and I had very little stutter. This is why it is especially helpful to have more people contribute so we can build it back up again as quickly as possible.

after posting my previous comment, I've started my very first World's Edge game ever yesterday, and didn't have a single stutter. it looks like my issue is limited to Olympus at the moment, and trying to "play" it (by which I mean staring at a static screen for 5 minutes, and then doing the same after getting killed while spectating a teammate, with a few seconds of normal gameplay inbetween) multiple times has no effect on the issue. unless someone else has managed to play Olympus without frame drops using this cache, in which case I'll start looking for other explanations.

This could be a couple of reasons I would imagine. Could be a hardware bottleneck from disk speed to cpu processing power. You might be accidentally not using Proton GE, or a spelling error in your command line args (this happened to me 🙄). I would say double check everything is installed and set up correctly. Otherwise, we have this cache file available for use!

I'm already using that file, and it's been working fine on every other map that I've tried so far. I don't really think it's an issue with something specific in my setup, given that before the recent update I played the map without any problems.

Originally posted by @najodleglejszy in #30 (comment)

More season 15 stuff

Include a link to the cache file here
https://send.vis.ee/download/ff5c49e3df488d78/#qvPwHXrZ5xwsXsR8mPP9sw

How many entries did this cache file add during your merge?
Merging files r5apex.dxvk-cache r5apex (copy 1).dxvk-cache
Detected state cache version v15
Merging r5apex.dxvk-cache (1/2)... 3144 new entries
Merging r5apex (copy 1).dxvk-cache (2/2)... 19651 new entries
Writing 22795 entries to file output.dxvk-cache
Finished

Would you like to be included in the cache file contributor list?
Yes, add to Whom on the board :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.