Game Development Community

Patching

by Robert Fritzen · in Torque Game Engine Advanced · 05/17/2011 (2:37 pm) · 7 replies

Alright, I have a pretty interesting question that I'm sure hits most developers at some point.

How do you create a game patcher?

I'm looking to use my web server (HTML, PHP), to update my game clients when they start their game.

I want the patcher to be able to send updated scripts, new scripts, new assets (maps, files, ect), and be able to update the game's .exe file if necessary.

How would I go about doing this?

#1
05/17/2011 (5:09 pm)
I believe there was a resource for this many years ago, but I haven't been able to find it with any searches. This is something, as you say, that most developers will need eventually, especially multiplayer games.
#2
05/18/2011 (9:44 am)
sending new resources down shouldn't be all that hard (I have something that does it in my Tribes 2 mod already (not the most efficient, but it works) :) ), it's the .exe patching that I'm a little less familiar with.

The ultimate in my mind would to have some class in C++ handle all of this so I could add an encryption layer to it so the clients are downloading from a "verified" source.

I know TGEA is built using some MFC handlers, would the CFTPConnection object be ideal for transfers? and if so, do you have a sample for me to take a peek at?
#4
05/19/2011 (8:30 pm)
Thanks for the link Andy. I hate searching for resources on this site. This is definitely something I will need in the future, and now I have it bookmarked. The link for Vince Gee's resource doesn't work anymore.
#5
05/20/2011 (9:06 am)
Thanks for the link, that should help with the assets...

now we just need to discover a way to handle .exe patching :)

#6
05/21/2011 (1:04 am)
to handle .exe patching, why dont you just compile a stripped down version of the engine exe and have it update the game
#7
05/21/2011 (7:58 am)
definitely possible, one of my friends made that suggestion.

If that approach would be taken, I do have one question. How would I have the "Game" client have the "Patcher" client be ran first, before initializing the "Game" client?

*EDIT*

I think I may have found a potential issue with the patcher resource.
I created a .txt file on my web server, and gave it a great deal of spaces and such:
This
is
a
text
file
with
spaces

when I run my client, the downloader grabs the files, but when I open it in notepad, I see this:

Thisisatextfilewithspaces

This is probably why the person who had T3D issues on the patcher was getting the different file sizes/hashes.

Any ideas on how to fix it?

I have not modified any of the resource code, only changed variables as necessary.

*EDIT 2*

It sometimes skips one of the files in the download process, therefore causing my client to become stuck in the update gui I made. (never hits finishUpdate())