Skip to main content
gamedev.net
🔒 Locked

Patching: Automatic and Streamlined

Started by blaze02 2 replies 400+ views
Original Post
blaze02
blaze02
When my game first starts up, it connects to an ftp server and (if necessary) downloads the newest patch. Step 1 complete. Soon I will tell the game to run this patch, which will be an executable file (exe). The game will shutdown and run this exe which will have full write access to the game's directory. It will erase unused files in the game directory and create files that will be embedded in the program's exe. I like the idea for autopatching, any suggestions? Now about being streamlined. This exe that gets downloaded will need to be generated somehow. It will need to know all the differences from old and new directory structures and files. What sort of patching options do I have for detecting and changing the files? Some diff programs are able to generate patches for binary files... that could save me a lot of bandwidth if I could patch a 2Mb exe with a 1k patch file. Has anybody heard of any programs that can patch full directory structures? I guess some installers can, but I don't want to give the user a lot of unnecessary options. Clicking "Next" takes way too long. :) Any suggestions on patching my way or any better ways?
Sirisian
Sirisian
modular .dlls and send a new .exe for every patch?

You could have a binary file that stores the version number of every file that the person had. Create a program that connects to an ftp server and download the newest version and simply check against what should be there. Have links with the main version file and where they should go so that the patcher can download what it needs to be updated and place it in the correct place in the main directory. So all the files can be patched by the patching program. After all the files have been downloaded a new binary file would be created to reflect the version numbers of all the files in the program. If this file matches the servers file execute the program.

My brother made something exactly like this in vb6. When you double clicked his game it used a shell command to execute the auto patcher and closed the game and a progress bar would pop up and load all the new data then reexecute the game with another shell command and then close the auto patcher.
BloodWarrior
BloodWarrior
I think blaze02 wants to know how to literally patch a file...

as in download some binary info and then change the binary code of the dll/exe to include the new binary info.

The first patches for games i ever used did that but I havent got the slightest clue on how to do do it.

I agree with Sirisian, its much easier to make a program that checks which files are out of date and then downloads their new versions from the ftp server.
Of course the downside is that you are downloading a lot more than you would be in a real patch scenario.

Plus if you download a real patch program then it will only work if you match versions... as in patch from 1.1 to 1.2. If someone has 1.0 they will need to first patch to 1.1 and then to 1.2 or get a direct 1.0 to 1.2 patch.
Pain is Inevitable, Suffering is Optional.Unknown
blaze02
blaze02
Quote:
Original post by BloodWarrior
I think blaze02 wants to know how to literally patch a file...


Haha, I almost asked that question. I'm pretty sure some diff programs come with patch generators for binary files. I was considering this. It would reduce the exe download from the full 2Mb to something around 10k (guessing).

I've got it up and running now, we just did a test run last night. I packaged up a patch file: one exe with the updated files included as resources. The patch file was 2Mb (95% was the new exe).

It took about 4 seconds to download the file, then the game program starts up the patch file and quits its current window. The patch file throws up a DOS box, upacks its resource files (a new exe and png), and writes over the old exe and png. Then it runs the new exe and quits the current process. The game starts back up, checks via FTP for a new update (which there was none now) and the game continues.

In the future I'll probably add binary patching (instead of complete download and overwrite), and I'll zip the files up to make the download a little smaller.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.