this post was submitted on 05 Sep 2023
691 points (97.8% liked)

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

54758 readers
343 users here now

⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don't request invites, trade, sell, or self-promote

3. Don't request or link to specific pirated titles, including DMs

4. Don't submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] SeedyOne@lemmy.ca 232 points 1 year ago (4 children)

Remember that time a random player DRAMATICALLY decreased load times for GTA online after finding bad code that preloaded TONS of game assets? After like, a decade?

Pepperidge Farm remembers...

[–] seang96@spgrn.com 65 points 1 year ago (1 children)

I believe it was a CSV file of every item in all of the shops (comma separated values) and it was being read and stored into memory single threaded so it was maxing out a single core on the CPU.

[–] JackbyDev@programming.dev 63 points 1 year ago (3 children)

JSON, and it had more to do with how they were checking string lengths. But yeah, the general story is that a random dude fixed massive problems with the text parsing.

[–] seang96@spgrn.com 33 points 1 year ago (1 children)

Found an article that details it again since it was a fun read at the time. Looks like it was 10MB json file and the method to read the lines used the expensive length function you mentioned. It also had other simple optimizations too.

[–] ipkpjersi@lemmy.ml 7 points 1 year ago* (last edited 1 year ago) (1 children)

Pretty funny that because of all their microtransactions being stored in a JSON file being loaded into memory, that ended up making their game more slow and annoying and frustrating to play.

I am super curious if the devs knew about this issue but it just wasn't fixed because it wasn't given priority by management, or if the devs genuinely had no clue about this?

The even weirder and funnier thing is I've worked with larger JSON files day to day at my job with a much smaller scale than Rockstar/GTA, although I guess it depends on how you work with the files and the fact they were checking string lengths for literally every single piece of data etc.

[–] seang96@spgrn.com 12 points 1 year ago* (last edited 1 year ago) (1 children)

The library used to read the line does the string length check, so my guess, whoever wrote it initially didn't know about it and tested with a small sunset of items without issue; I assume the games items grew in size over the years too. They also released an official patch with it and paid the modder $10k

Edit fixed typo

[–] Petter1@lemm.ee 2 points 1 year ago

Lol, in the meantime see what Nintendo does to modders who fix stuff for them

[–] seang96@spgrn.com 7 points 1 year ago

Yeah json actually sounds better. Unfortunately it's still a text file that they were importing the entire thing into memory. Probably worse than CSV since they were probably serializing each item from string into objects. They definitely did it in one of the most laziest ways possible though I bet it worked at the time of development and the vendors probably had very few items.

[–] Appoxo@lemmy.dbzer0.com 0 points 1 year ago

Not worth to assign a dev to find a bug if the player can just do a toilet break and keeps on generating memes which are free publicity.

[–] JackbyDev@programming.dev 40 points 1 year ago

Are you talking about the guy that found a bug in the JSON parsing?

[–] cordlesslamp@lemmy.today 18 points 1 year ago (2 children)

Are you saying the INSANE GTA Online load time is fixed now?

Back in the old day, I literally just throw my hands up and said "I can't wait for this shit anymore, I don't have all day" then rage quit and delete the game.

[–] dangblingus@lemmy.dbzer0.com 6 points 1 year ago (1 children)

Rockstar paid the guy like 50K or something for discovering it, and then it was apparently implemented into GTA online. Too bad I quit playing that time black hole years ago.

[–] cordlesslamp@lemmy.today 2 points 1 year ago

I watched a YT video about this and they said the guy was paid 10K (way too low imo), a Google search shows different numbers everywhere so it's hard to confirm. But at least the guy got paid, for sure.

As far as I'm understanding it, the game was using a single threading process to load every single items in the game one by one (over 10 thousands in total), then checking again for duplicate.

[–] SeedyOne@lemmy.ca 5 points 1 year ago

Yep. I'd long quit the game when they finally figured it out.