One Guy Solves GTA Online's Loading Issues
If you're a long-time Grand Theft Auto Online player, you are no stranger to loading screens. The game has always been known for long loading times, which are especially egregious to the point of infamy in the multiplayer mode.
Now, one person has decided to dig into the game code, find out why this happens and work out how to fix it.
All these years, plenty of theories about why GTA Online took so long to load have circulated. Some blamed the peer-to-peer server architecture, others said that it's simply due to the immense amount of content that needs to be loaded up. Despite fans putting countless hours into datamining to discover upcoming content, it seems nobody dug into why loading into the game actually takes so long.
Enter GitHub user tostercx, who not only uncovered why this was such an arduous process, but even fixed it, all alone, achieving a loading time reduction of 70% in GTA Online. While you can read a lengthy and very technical explanation of the whole investigation here (and give a small donation to the person making this possible!) we've collected the main points below, written for the layman.
Essentially, there are two main culprits that bog down the loading process, and one of them truly is tied to the amount of content in the game — specifically, the amount of things you can buy. Everything you can purchase in the game has a unique number associated with it, and all of this information is stored in one, comparatively huge, 10 MB JSON file. Every existing variant and combination of all items, vehicles and properties — meaning every possible visual upgrade combination of every vehicle in the game, for example — is in this, totaling at over 63,000 items.
Every time you load up GTA Online, this entire list is checked. However, instead of moving immediately on to the next item upon a successful return, the parse jumps back to the start and goes through the whole list again until it reaches the subsequent item. According to tostercx's calculations, this means that the check runs 1,984,531,500 times every time you load the game!
This was an easy fix, as a minor patch altered the check process to make it hop to the next item upon a return. That's one problem solved.
The other was that, when loading, GTA Online inexplicably used just one CPU core. This, again, was solved rather easily, and tostercx posted his patch on GitHub for anyone to check, download and use — though he does warn that this is merely a proof of work, and probably shouldn't be casually used.
Ultimately, this patch cut down loading times by a whopping 69.4% — from an unpatched 6 whole minutes to get into GTA Online, down to 1 minute and 50 seconds. Granted, still a little long for games this day and age, but an immense improvement.
At the end of their exhaustive investigation, they call on Rockstar to apply this — or a similar — fix to the game, as it would likely take a single developer less than a day to implement. Since this solution was first posted, it has made the rounds online, so there's a chance we will indeed see a solution implemented based on it. If nothing else, we now know it is possible, so failing to solve GTA Online's loading times puts the onus on Rockstar.