Author Topic: Way to patch the game without replacing it whole  (Read 1336 times)

This is long overdue, but recently my attention was brought again to this old post from 2014 (I think it is by one of the creators of Primordia):

It is nearly 2018 now, but all those issues still exist.

I answered this on gtihub back few years ago, but I guess no one noticed. Perhaps I should've try harder and post here, but, to be honest, don't remember if any game dev has ever asked me about this.


There is this command-line tool pack made by github user rofl0r back in 2012-13: https://github.com/rofl0r/agsutils

Among other things they can unpack and repack AGS game file.
A small caveat - they only known to compile under Linux, so probably might need be updated to compile under Windows too.

The solution to game patching is as following:
1. Provide a patch script and patch contents (e.g. in ZIP archive).
2. Patch script (written in any common scripting language, heck even batch for Windows system) -
2a. unpacks patch archive to folder P.
2b. runs unpacker tool to extract game data to folder G.
2c. copies patch files from P to G.
2d. runs packer tool to recreate game file with the new files of folder G.
2e. deletes temporary files.
3. Profit: you have a game exe with new contents.

EDIT: right, how to create patch in the first place:
a. You need to have two game files: old and new one.
b. Unpack both into folders O and N.
c. Compare the contents and find the files in N that do not match O.
d. Create a ZIP archive that onlu contains changed files.

This may be further improved by writing a simple GUI wrapper over those utilities.

Of course with current AGS package system you won't be able to replace certain items without replacing larger chunk. Sprites is the main problem here, because even inside game package they are stored as another monolithic file (sprcache.dat). Another thing is script modules: they are merged together with main game data (game, character, inventory descriptions, etc). Room files (CRM) have both room background, properties and scripts merged altogether. This is indeed something you cannot change without rewriting way AGS handles these.
« Last Edit: 30 Dec 2017, 17:06 by Crimson Wizard »


  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Way to patch the game without replacing it whole
« Reply #1 on: 30 Dec 2017, 17:05 »
This is indeed something you cannot change without rewriting way AGS handles these.

... which wouldn't be a bad idea in the long term, I think. But this workaround certainly makes it less pressing. Thanks for the tutorial!