Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kevmo

Automatic Patching Utility

This topic is 5301 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Many games nowadays have some sort of automatic patching utility, especially online games. I haven''t put much thought into this yet, but I have looked around online to try to see how it is commonly done, but I came up empty handed. It seems like it can be done by utilizing a diff-like program on the server side, and on the client side making the bit by bit edits/additions/deletions specified by the server diff output, but I would like the advice of someone who has actually done this. Thanks in advance, Kevin

Share this post


Link to post
Share on other sites
Advertisement
It would be just as easy or easier to keep the version information in a config file that the program reads on start up. Then when it connects to the internet master server the server can tell the client what version it is. If the server version > client version it can notify the client it needs to download a patch.

Sounds like the easiest way to me.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think he was wondering on how to apply a patch and/or store the patch information.

Share this post


Link to post
Share on other sites
yea, the AP got the point, knowing when to apply the patches is pretty easy, I was more interested in how to write a program to apply a patch, or perhaps more generally, how to write a "diff" program and how to take the output from the diff program to patch a file.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by kevmo
yea, the AP got the point, knowing when to apply the patches is pretty easy, I was more interested in how to write a program to apply a patch, or perhaps more generally, how to write a "diff" program and how to take the output from the diff program to patch a file.


find the longest common substring between the two inputs. anything not in the longest common substring is the difference. google for the algorithm <i''m not really familiar with >

alternatively, you could just use the GNU diff tool



Share this post


Link to post
Share on other sites
Isn''t it more along the lines of finding the smallest set of common substrings spanning as much of the strings as possible? Because just one substring seems like it would only allow for 1 modification - its possible that the rest of the string does actually contain smaller common substrings in it that aren''t part of the difference. This is a harder problem than just the longest common substring problem.

Share this post


Link to post
Share on other sites
http://www.justinalia.com/cs/algorithms/diff02.html

Explanation of a diff algorithm, in case anyone else needs it.

Share this post


Link to post
Share on other sites
Really you don''t need a Diff program.

Step 1: A download and paste program,
downloads the files from the server and replaces
the old files. These files would be specified in
some filelist that the server sends. This
is a simple delete and then binary write operation for
stuff like the game .exe. ( slightly more complex if you have
an archive ie. .zip that is holding all your game data.. )

Step 2: A version checking rutine in your client game, and a
spawn new process/exit game process. This will start step 1,
then close the game.... sorry but someone else should fill in
the details on this.

Share this post


Link to post
Share on other sites
quote:
Really you don't need a Diff program.


I disagree with that. What if I was writing Warcraft, lets say, and there was a patch to one of the 100+MB files. Are you going to require your user to download the whole file over again as a "patch"?

The reason I was asking for a patch and not a delete and replace program is because of just that: it is far more efficient in terms of bandwidth to send just the part of the data that has changed.

[edited by - kevmo on December 17, 2003 8:49:07 PM]

Share this post


Link to post
Share on other sites
"Diff" algorithm would suck for anything but text (iirc)

rsync implements a very nice data-syncronization algorithm. Tuned to allow it to work well with both text AND raw data.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!