Post subject: Making a patch program?
Editor, Expert player (2313)
Joined: 5/15/2007
Posts: 3855
Location: Germany
I have several versions of Tsioque backed up. Not very many files change between versions, but each folder is about 1 GB in size. I kept the versions because otherwise they would be lost to oblivion. I'd like to free up space on my computer though... Using these folders, is it possible to make a patch program that basicly lets you switch your folder between versions? Alternatively, patch files? I know about IPS patches but they seem to only work on single files, not whole folders with sub directories. I briefly tried something with TortoiseSVN but I couldn't figure it out. Thanks in advance.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
7zip?
Patashu
He/Him
Joined: 10/2/2005
Posts: 4017
diff/patch utilities in linux?
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
WST
She/Her
Active player (442)
Joined: 10/6/2011
Posts: 1690
Location: RU · ID · AM
You can use tar format (packing multiple files into one without compression) with that IPS thing. Or try further with TortoiseSVN or diff/patch (the latter can be used within WSL environment for example).
S3&A [Amy amy%] improvement (with Evil_3D & kaan55) — currently in SPZ2 my TAS channel · If I ever come into your dream, I’ll be riding an eggship :)
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Isn't this what compression is all about? Removing needless repetition from data? Use a compressor program that uses flat compression (iow. treats all the files as if they were one single file, rather than compressing every file independently of each other).
Player (96)
Joined: 12/12/2013
Posts: 376
Location: Russia
things like 7zip may help only if duplicated file is close enough in "flat" view. So, for example, if 7zip will pack stuff in order of directories, all copies will be 1 GB below, so it won't reach them to detect copy, and will dump them again and again. This is dependent to Dictionary size. If single directory is compressable enough, using 7zip is easy way to reduce size. But if they hardly compressable, then better to search for special software, or at least use revision control stuff, like git / svn, but if you're not familiar with this stuff you may ruin all :D for example, git under its hood using so called blobs for storing different files, so in theory it will store only different files in the end. Perhaps it will make new blob for each change even if you replace file to older version that already was in history. So, git and svn is not made for it. Also, I don't know how fast it would switch versions. Also, there are probably revision control systems more suited for games. Git / SVN is not supposed for binary data, their key feature is text files, but they allow binary files in source tree. So, you may try to google "git for games" or "revision control for games" or "git for resources" and etc.
Tub
Joined: 6/25/2005
Posts: 1377
I'm not aware of any general purpose compressor that will detect backreferences with a distance of more than a gigabyte. It's not exactly a common use case. There are special archivers (like bisqwit's cromfs), and there are ways to store duplicate files as hardlinks (like rdfind), but those are linux only. Git is simply the best solution here. It's not particularly fast with large, binary files, but it compresses them really well if you kick it in the right place. Commit all the files, then run > git gc --aggressive and it should try to compare all files against each other to determine which are just minor changes of another. On the other hand, worrying about 8 GB of disk space? What year is this?
m00
Joined: 7/13/2014
Posts: 36
Tub wrote:
On the other hand, worrying about 8 GB of disk space? What year is this?
2019
Editor, Expert player (2313)
Joined: 5/15/2007
Posts: 3855
Location: Germany
To clarify, I'm envisioning something that lets other users switch their game to an older version, based on file differences. For example, a user that has version 1.2.1 and wants to port their game back to 1.1.5. Is it possible to create and run a patch on a folder with a bunch of sub directories and files? I have seen something like that done with an old game. Not sure if it was Age of Empires or something. User could select what version they wanted to patch their game to. Compressing all my versions is not really the goal here (unless I'm missing the point?). Compressing to WinRar with default settings wasn't that successful anyway, only made it from 0.98 GB to 0.97 GB.
Joined: 7/13/2014
Posts: 36
Tub's suggestion of git is all-encompassing, you can even run git locally if you have the necessary knowledge and experience. There are also lots of open-source standalone diffing and merging tools you could use to make your own general solution. If you're less technically inclined, take a look at WinMerge, from what I can tell it has a GUI that lets you diff entire directories recursively, make patches, and apply patches through the use of an extension. (Read the documentation for more information.)