logoalt Hacker News

easyThrowawaytoday at 1:25 PM2 repliesview on HN

Did the duplicated files were even used on pc? Like, do you even have such low access to the file system that you can deduce which duplicated instance has a faster access time on a mechanical hard drive?


Replies

tehbeardtoday at 2:01 PM

It's not which duplicated instance....

Think of it as I have two packs for levels.

Creek.level and roboplanet.level

Both use the cyborg enemies, by duplicating the cyborg enemy model and texture data across both files, Only the level file needs to be opened to get all nessecary data for a match.

Because modern OS will allow you to preallocate contiguous segments and have auto defrag, you can have it read this level file at max speed, rather than having to stop and seek to go find cyborg.model file because it was referenced by the spawn pool. Engine limitations may prevent other optimisations you think up as a thought exercise after reading this.

It's similar to how crash bandicoot packed their level data to handle the slow speed of the ps1 disc drive.

As to why they had a HDD optimisation in 2024... Shrugs

show 1 reply
arghwhattoday at 1:41 PM

Not sure if this is what they did, but you can just put all the things you need together sequentially into a single file and rely on the filesystem to allocate contiguous blocks where possible (using the appropriate size hints to help). It's trivial unpack at loading time without any performance impact.

A filesystem is by itself just one big "file" acting like a file archive.