Live data from Hacker News

How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

cookieplmonster.github.io

21–30 of 315 posts

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#21
post #7
post #2

[flagged]

funnily enough, there was an infamous bug in GTA5 for a long time that was related to using JSON : https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times...

I remember that one too :)

They wrote a JSON “parser” using sscanf. sscanf is not bulletproof! Just use an open source library instead of writing something yourself. You will still be a real programmer, but you will finish your game sooner and you won't have embarrassing stories written about you.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#23
post #2

[flagged]

Putting the (very valid) reasons for not having human-readable game saves aside, are you sure it's worse than using a 3rd party library that's built to accept semi-valid input values, possibly evaluates user input in some way and has difficult to debug bugs that occur only under certain inputs? I agree that writing a stable and safe parser for a binary data file isn't easy, but there's less things that can go wrong when you can hardcode it to reject any remotely suspicious input. Third party XML/JSON libraries OTOH try to interpret as much as possible, even when the values are bogus. Also no need to deal with different text encoding bugs, line endings...

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#24

Earlier quoted context omitted.

To u/db48x whose post got flagged and doesn't reappear despite me vouching for it as I think they have a point (at least for modern games): GTA San Andreas was released in 2004. Back then, YAML was in its infancy (2001) and JSON was only standardized informally in 2006, and XML wasn't something widely used outside of the Java world. On top of that, the hardware requirements (256MB of system RAM, and the PlayStation 2…

Why weren't binary files used like I would expect in the 1990's DOS game? fread into a struct and all that

By the 2000s, portability was a concern for most titles. Certainly anything targeted at a rapidly changing console market back then.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#25
post #19

Earlier quoted context omitted.

The comment reappeared, and while you're right about using proper libraries to handle data, it doesn't excuse the "undefined behavior (uninitialized local variables)" that I still see all the time despite all the warning and error flags that can be fed to the compiler. Most of the time, the programmers who do this do not follow the simple rule that Stroustrup said which is to define or initialize a variable where you…

And it did not matter at all. The game shipped and was a success.

This is the thing that drives artists and craftsmen to despair and drink: That a flawed, buggy, poor quality work can be "successful" while something beautiful and technically perfect can fail.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#26
post #7

Earlier quoted context omitted.

funnily enough, there was an infamous bug in GTA5 for a long time that was related to using JSON : https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times...

Loading times are still absurd, fwiw.

Yes, but now it's in the realm of ~3 minutes, and not ~8 minutes even on a top-spec PC, right? I really liked the game, but waiting 8 minutes to load just to get griefed by hackers within seconds of walking outside... I don't understand how that game makes any money.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#27
post #2

[flagged]

To u/db48x whose post got flagged and doesn't reappear despite me vouching for it as I think they have a point (at least for modern games): GTA San Andreas was released in 2004. Back then, YAML was in its infancy (2001) and JSON was only standardized informally in 2006, and XML wasn't something widely used outside of the Java world. On top of that, the hardware requirements (256MB of system RAM, and the PlayStation 2…

You’re not entirely wrong, but a library doesn’t have to be “heavyweight” in order to be bulletproof. And you can load the library during startup and then unload it after; it doesn’t have to stick around for the whole run time of the game. Modern OSes will reclaim the pages after you stop using them, if there is memory pressure. Of course the PS2 didn’t do that I am sure.

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#28
post #2

[flagged]

Putting the (very valid) reasons for not having human-readable game saves aside, are you sure it's worse than using a 3rd party library that's built to accept semi-valid input values, possibly evaluates user input in some way and has difficult to debug bugs that occur only under certain inputs? I agree that writing a stable and safe parser for a binary data file isn't easy, but there's less things that can go wrong w…

> Putting the (very valid) reasons for not having human-readable game saves aside,

I don't follow. What would the reasons be?

Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2

#30

Earlier quoted context omitted.

Loading times are still absurd, fwiw.

Yes, but now it's in the realm of ~3 minutes, and not ~8 minutes even on a top-spec PC, right? I really liked the game, but waiting 8 minutes to load just to get griefed by hackers within seconds of walking outside... I don't understand how that game makes any money.

It was like crack. People put up with a lot of problems and bugs just because it was really fun just enough of the time to get them hooked.
Post reply on HN