View Issue Details

IDProjectCategoryLast Update
0004297Valley 1GUISep 29, 2011 12:59 pm
Reporterjerith Assigned ToChris_McElligottPark  
Status closedResolutionno change required 
Summary0004297: Updater misreporting number of updates?
DescriptionI'm not sure if this is actually a bug or not, but when I was updating from 0.505 to 0.507, the updater told me there was one update instead of two. It still applied both, however.
TagsNo tags attached.
Internal WeightNew

Activities

Toll

Sep 29, 2011 12:40 pm

reporter   ~0014674

I had the same problem when updating from 0.501 to 0.503.

Chris_McElligottPark

Sep 29, 2011 12:41 pm

administrator   ~0014675

Actually, there was only one update, even though it took you up two versions. Some version updates are such that since they don't have a lot of new graphics or whatever, we're just sending down small text files plus the actual executable, all of which replace the prior version entirely. When that happens, we just ditch the last update. So anyone upgrading from 0.500 to 0.507 actually only has one update to apply. Next big set of art that happens, it will start being two, etc.

Anyway -- it's reporting on how many zip files it has to download, not how many versions it will update you to. So no worries!

jerith

Sep 29, 2011 12:43 pm

reporter   ~0014676

Ah, right. That makes sense.

You have an awesome build/update system, by the way. Most places I've worked would be pleased with a couple of days between the last commit and customers seeing the new code. As near as I can tell, you do it in under an hour. :-)

Chris_McElligottPark

Sep 29, 2011 12:44 pm

administrator   ~0014677

Thanks! And I can actually push out an update in approximately 2 minutes from last commit. :)

jerith

Sep 29, 2011 12:46 pm

reporter   ~0014678

Do you have a blog post or something about how you do that? If not, can we get one at some point? I'm very interested in the details.

And now I'll stop using the issue tracker as a messaging system. :-)

Chris_McElligottPark

Sep 29, 2011 12:59 pm

administrator   ~0014684

No worries. And it's actually really simple:

1. We use SVN for all the various updates.

2. When a new version happens, we just do a diff between the last version and the next version, and export into a temporary working folder. This would be for things like language files, images, etc. Then compile the game, and put the new version's DLL in appropriate subfolders inside that temporary working folder.

3. Zip the whole working folder. You can see the structure inside the zip files I'm talking about in your RuntimeData/updates folder.

4. Update one XML file with a line entry referring to the new update.

5. Upload the the XML file and the zip file to the hosting provider (Amazon S3 in this case).

Done. That whole process generally takes about two minutes.

On the client side, the following then happens:

1. Whenever the game is started, it downloads that XML file, which is quite small, from the hosting provider.

2. If there are any entries in there with a version number greater than the current version number of the game, it activates the updates button to notify the player of this.

3. When the player clicks the update button, the game itself actually downloads the update and puts that into the updates folder, also writing a little txt file containing a sequential list of updates to apply. There can be any number of updates that are a mix of cumulative and non-cumulative, and it will do them all at once.

4. However, since the game needs to update itself, it can't keep actually running if it wants to do that. So once the files are downloaded, it starts a second process and closes itself.

5. This second process is a Bitrock Installbuilder installer, which has custom logic inside it that causes it to read the txt file that the game generated in the updates folder. Then it knows where all the zip files are, and in what order to unzip them. So that's what it does: it unzips them all, in order, right on top of the game directory.

6. At the end of the Bitrock wizard there's an option to restart the game. If you choose that, or otherwise restart your game, you're on the newest version.


And that's it! Each zip file also works on windows and mac simultaneously, which means that it needs two copies of the dll file, which wastes about 500kb of bandwidth per update, but that's livable given the added convenience.

It's not possible to remove existing files using this process, but I can simulate deleting them by overwriting them with a 0 byte file if I really want to. Which I've done many times in the past, to save players disk space.

It's also not possible to update the updater using just this process, but if I wanted to add that in then I could first update the game to support a different kind of version check, then have it download the updater and overwrite the updater itself, without having to restart or close the main game process. That actually would be pretty easy, but I haven't had any reason to bother adding that in.

Note that we're not doing any partial file updates, either. It's just not worthwhile, because we don't package the game assets into resource files. So that means that most large files rarely change, and we just send the entire large file every time it is updated. Most updates consistent of a single revised DLL, some updated xml files (which are small and compress awesomely, of course), and then whatever new art or sound assets are needing to be sent down. Thus the need for actual binary diffing and patching of that sort is almost non-existent, and really wouldn't make up for the loss in efficiency and flexibility that we gain from doing it this way.

Issue History

Date Modified Username Field Change
Sep 29, 2011 12:38 pm jerith New Issue
Sep 29, 2011 12:40 pm Toll Note Added: 0014674
Sep 29, 2011 12:41 pm Chris_McElligottPark Internal Weight => New
Sep 29, 2011 12:41 pm Chris_McElligottPark Note Added: 0014675
Sep 29, 2011 12:41 pm Chris_McElligottPark Status new => closed
Sep 29, 2011 12:41 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Sep 29, 2011 12:41 pm Chris_McElligottPark Resolution open => no change required
Sep 29, 2011 12:43 pm jerith Note Added: 0014676
Sep 29, 2011 12:44 pm Chris_McElligottPark Note Added: 0014677
Sep 29, 2011 12:46 pm jerith Note Added: 0014678
Sep 29, 2011 12:59 pm Chris_McElligottPark Note Added: 0014684
Apr 14, 2014 9:28 am Chris_McElligottPark Category Bug - UI => GUI