←back to thread

1371 points yett | 5 comments | | HN request time: 0.844s | source
Show context
db48x ◴[] No.43772686[source]
[flagged]
replies(8): >>43772700 #>>43772801 #>>43772908 #>>43773054 #>>43773261 #>>43774132 #>>43774982 #>>43777757 #
mschuster91 ◴[] No.43772801[source]
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 only had 32MB) made it enough of a challenge to get the game running at all. Throwing in a heavyweight parsing library for either of these three languages was out of the question.

replies(11): >>43772845 #>>43772895 #>>43773040 #>>43773086 #>>43773123 #>>43773186 #>>43773306 #>>43773332 #>>43773461 #>>43774704 #>>43775548 #
1. bluedino ◴[] No.43773186[source]
Why weren't binary files used like I would expect in the 1990's DOS game? fread into a struct and all that
replies(3): >>43773266 #>>43773852 #>>43773954 #
2. epcoa ◴[] No.43773266[source]
By the 2000s, portability was a concern for most titles. Certainly anything targeted at a rapidly changing console market back then.
replies(1): >>43773793 #
3. coldpie ◴[] No.43773793[source]
Definitely, and architectures back then were far less standardized. The Xbox 360 was a big-endian PowerPC CPU, the PS2 had a custom RISC-based CPU. On the desktop, this was still the era of PowerPC-based Macs. Far easier (and I would argue safer) to use a standard, portable sscanf-like function with some ascii text, than figure out how to bake your binaries into every memory and CPU layout combination you might care about.
4. mrguyorama ◴[] No.43773852[source]
Video games are made by a lot of non-programmers who will be much more comfortable adjusting values in a text file than they are hex editing something.

Besides, the complaint about not having a heavyweight parser here is weird. This is supposed to be "trusted data", you shouldn't have to treat the file as a threat, so a single line sscanf that's just dumping parsed csv attributes into memory is pretty great IMO.

Definitely initialize variables when it comes to C though.

5. CamouflagedKiwi ◴[] No.43773954[source]
Easier for internal development. Non- or less technical team members can tweak values without having to rebuild these binary files. Possibly also easier for lightweight modding externally as well.

This isn't that uncommon - look at something like Diablo 2 which has a huge amount of game data defined from text files (I think these are encoded to binary when shipped but it was clearly useful to give the game a mode where it'd load them all from text on startup).