From The Mana World
(Some updates, still needs more)
(A bit more updates and removing platform-specific suggestion)
Line 1: Line 1:
== Update system ==
== Introduction to the problem ==


The Mana World plans to be an constantly expanding game, with new features, maps and other game media being added all the time. This constant addition requires some way to distribute new material. The Mana World up to this point has been using a monthly release cycle to update the game, but this distribution method suffers in the following ways:
The Mana World plans to be an constantly expanding game, with new features, maps and other game media being added all the time. This constant addition requires some way to distribute new material. The Mana World up to this point has been using a monthly release cycle to update the game, but this distribution method suffers in the following ways:
Line 7: Line 7:
* '''Complicated''' - Making a new client release involves a complete ritual of providing the necessary binaries and updating many websites. For content updates or tuning this process can be skipped.
* '''Complicated''' - Making a new client release involves a complete ritual of providing the necessary binaries and updating many websites. For content updates or tuning this process can be skipped.
* '''Breaking compatibility''' - Each time new content is added, the game will break for anybody using an older client. When content updates are done separately, very often a forced client update can be avoided.
* '''Breaking compatibility''' - Each time new content is added, the game will break for anybody using an older client. When content updates are done separately, very often a forced client update can be avoided.
* '''Single universe''' - Distributing and updating the data with the client assumes the client is only ever used with some single official server. Dynamically downloading and updating the data would allow the client to be used on unofficial servers.


The Mana World wishes to address this by using an in-built update system which will automatically download the latest game media. By doing this, the second and third points noted above are eliminated. This update system should provide the following features:
The Mana World wishes to address these issues by using an built-in update system which will automatically download the latest necessary game data depending on the server you login to.


* Smart updating - the updater should be able to find files which need to be updated and update them, without trying to update files which are already up to date.
* The redundancy is taken care of by only downloading updated files.
* Cumulative patches (Optional)
* More frequent updates become possible by avoiding the client release cycle and reducing the complexity surrounding an update.
* Media updates - should be able to fetch new and updated game media.
* Compatibility is greatly enhanced by ensuring the data is up to date at all times.
* Executable updates - should be able to update the binary executables appropriately.
* By allowing the server to specify which data is to be downloaded, one client can be used on different servers featuring different worlds.


Regarding the last topic, we discussed it a bit, and thought that first of all, we need a version checking, so that everyone is informed about a new release. In windows we were evaluating the possibility of directly replacing the binary, while this won't be possible in GNU/linux. I guess we will continue with monthly releases, and will discuss in this article only static data updates. --[[User:ElvenProgrammer|ElvenProgrammer]] 02:08, 4 Jul 2005 (PDT)
== Update process ==
 
== Update format ==


Updates come in compressed archives (.zip files). They are easy to create and allow individual files to be read directly from them (we use [http://icculus.org/physfs/ PhysFS] for this). Initially, the client will retrieve an ordered list of archives that it should load, for example:
Updates come in compressed archives (.zip files). They are easy to create and allow individual files to be read directly from them (we use [http://icculus.org/physfs/ PhysFS] for this). Initially, the client will retrieve an ordered list of archives that it should load, for example:
Line 27: Line 26:
</pre>
</pre>


The client will check whether all the listed zip files are present in its data directory, and attempt to download any missing ones (see update distribution below). Once downloaded, it will put each archive in the virtual file system provided by PhysFS. Once a data file is loaded, the archives are search bottom to top so that the file will be loaded from the last archive that provided it. This allows us to patch big data archives with a small archive that contains just the modified files.
The client will check whether all the listed files are present in its data directory, and attempt to download any missing ones. Once downloaded, it will put each archive in the virtual file system provided by PhysFS. The archives will be searched bottom to top so that any file will be loaded from the last archive that provided it. This allows us to patch big data archives with a small archive that contains just the modified files.


Any files present in the data directory that are not in the list can be considered to be old, and could be cleaned up by the user with the click of a button.
Any files present in the data directory that are not in the list can be considered to be old, and could be cleaned up by the user with the click of a button.


This ordered list could contain protocol information for file retrieval and information concerning the platform which the patch can be used. Such a list could look like:
This ordered list could contain protocol information for file retrieval. Such a list could look like:


<pre>
<pre>
win32 http://themanaworld.org/updates/tmw-base-binary-win32-1.1.zip
ftp://themanaworld.org/updates/tmw-maps-tonori-1.3.zip
osx http://themanaworld.org/updates/tmw-base-binary-osx-1.1.zip
http://themanaworld.org/updates/tmw-gfx-items-1.1.zip
all ftp://themanaworld.org/updates/tmw-maps-tonori-1.3.zip
all http://themanaworld.org/updates/tmw-gfx-items-1.1.zip
</pre>
</pre>


It is also suggested that the updates can be used in the configuration director (~/.tmw) on UNIX based platforms, as root priveleges would be required to install the updates correctly otherwise.
:I'm not sure about sending full URLs yet, as long as we're using http/ftp I think it'd be better to set up one or two mirrors and optionally allow the user to choose where to download from. --[[User:Bjørn|Bjørn]]
[[User:Nym|Nym]] 23:56, 4 Jul 2005 (PDT)
 
:I think updating the binary should stay out of the scope of the data updating system, as it is very OS specific. The data updating system can work consistently acros all platforms, so there is no need to indicate platform in the file list. I'm not sure about sending full URLs yet, as long as we're using http/ftp I think it'd be better to set up one or two mirrors and optionally allow the user to choose where to download from. --[[User:Bjørn|Bjørn]]
Updates will be downloaded to a directory writable by the user. On Windows it is assumed the user has write access to <code>./updates</code> while on UNIX-like systems <code>~/.tmw/updates</code> is used.
 
:I think updates should be downloaded to subdirectories depending on the server, and that as little default data should come with the client as possible. An example directory used to store the server data would be <code>~/.tmw/data/testing.themanaworld.org</code>. --[[User:Bjørn|Bjørn]] 20:39, 24 December 2005 (CET)


== Update distribution ==
== Update distribution ==


Updates must be distributed fast and effectively, providing a decent throughput even when the update server is under a high load. The Mana World development team has decided that the [http://www.bittorrent.com Bit Torrent] protocol will be utilised for update distribution. BitTorrent is a distributed peer-to-peer protocol which utilises the bandwidth of all users. For more information about [http://www.bittorrent.com Bit Torrent], see the [http://www.bittorrent.com/introduction.html Bit Torrent Introduction].
Updates must be distributed fast and effectively, providing a decent throughput even when the update server is under a high load. The Mana World development team has decided that the [http://www.bittorrent.com BitTorrent] protocol will be utilised for update distribution. BitTorrent is a distributed peer-to-peer protocol which utilises the bandwidth of all users. For more information about [http://www.bittorrent.com BitTorrent], see the [http://www.bittorrent.com/introduction.html BitTorrent Introduction].


To easily utilize to the Bit Torrent protocol, one of the following libraries can be used:
To easily utilize to the BitTorrent protocol, one of the following libraries can be used:


* [http://libbt.sourceforge.net/ libbt] - C
* [http://libbt.sourceforge.net/ libbt] - C

Revision as of 19:39, 24 December 2005

Introduction to the problem

The Mana World plans to be an constantly expanding game, with new features, maps and other game media being added all the time. This constant addition requires some way to distribute new material. The Mana World up to this point has been using a monthly release cycle to update the game, but this distribution method suffers in the following ways:

  • Data redundancy - This is a major concern for those who have slower connections to the Internet. For each update, all existing data is also downloaded.
  • Not frequent enough - Players want new material as fast as they can get it. Players like a fast updated, dynamically changing game world in which they can immerse themselves - any stagnation can lead to player loss.
  • Complicated - Making a new client release involves a complete ritual of providing the necessary binaries and updating many websites. For content updates or tuning this process can be skipped.
  • Breaking compatibility - Each time new content is added, the game will break for anybody using an older client. When content updates are done separately, very often a forced client update can be avoided.
  • Single universe - Distributing and updating the data with the client assumes the client is only ever used with some single official server. Dynamically downloading and updating the data would allow the client to be used on unofficial servers.

The Mana World wishes to address these issues by using an built-in update system which will automatically download the latest necessary game data depending on the server you login to.

  • The redundancy is taken care of by only downloading updated files.
  • More frequent updates become possible by avoiding the client release cycle and reducing the complexity surrounding an update.
  • Compatibility is greatly enhanced by ensuring the data is up to date at all times.
  • By allowing the server to specify which data is to be downloaded, one client can be used on different servers featuring different worlds.

Update process

Updates come in compressed archives (.zip files). They are easy to create and allow individual files to be read directly from them (we use PhysFS for this). Initially, the client will retrieve an ordered list of archives that it should load, for example:

tmw-base-1.0.zip
tmw-base-patch-1.1.zip
tmw-tonori-region-1.0.zip

The client will check whether all the listed files are present in its data directory, and attempt to download any missing ones. Once downloaded, it will put each archive in the virtual file system provided by PhysFS. The archives will be searched bottom to top so that any file will be loaded from the last archive that provided it. This allows us to patch big data archives with a small archive that contains just the modified files.

Any files present in the data directory that are not in the list can be considered to be old, and could be cleaned up by the user with the click of a button.

This ordered list could contain protocol information for file retrieval. Such a list could look like:

ftp://themanaworld.org/updates/tmw-maps-tonori-1.3.zip
http://themanaworld.org/updates/tmw-gfx-items-1.1.zip
I'm not sure about sending full URLs yet, as long as we're using http/ftp I think it'd be better to set up one or two mirrors and optionally allow the user to choose where to download from. --Bjørn

Updates will be downloaded to a directory writable by the user. On Windows it is assumed the user has write access to ./updates while on UNIX-like systems ~/.tmw/updates is used.

I think updates should be downloaded to subdirectories depending on the server, and that as little default data should come with the client as possible. An example directory used to store the server data would be ~/.tmw/data/testing.themanaworld.org. --Bjørn 20:39, 24 December 2005 (CET)

Update distribution

Updates must be distributed fast and effectively, providing a decent throughput even when the update server is under a high load. The Mana World development team has decided that the BitTorrent protocol will be utilised for update distribution. BitTorrent is a distributed peer-to-peer protocol which utilises the bandwidth of all users. For more information about BitTorrent, see the BitTorrent Introduction.

To easily utilize to the BitTorrent protocol, one of the following libraries can be used:

Yeah I know we already choosed for BitTorrent, anyway we shouldn't discard HTTP/FTP both because some people don't want to be forced to share their bandwidth or if they're having problems. Someone also asked for the possibility to stop sharing patches (in case updater is built-in). A noticeable example is WoW updater which both allows for bitTorrent or HTTP downloads. And the patch sharing is limited to the time you download the patch (until you don't press "Play game!" I guess). A deeper evaluation of band usage and lag problems should be provided. --ElvenProgrammer 02:08, 4 Jul 2005 (PDT)

Because both libbt and libtorrent still seem immature and have annoying dependencies, I would suggest to hold off from BitTorrent for now and use libcurl to retrieve the updated data files through HTTP or FTP. --Bjørn 12:06, 4 Jul 2005 (PDT)

I agree, libcurl is at least used by libbt so if we're going to use it, it will be required anyway. I'd like also to say that libcurl it's really easy and could help us to create the HTTP/FTP updater in no time.--ElvenProgrammer 12:55, 4 Jul 2005 (PDT)
I've added libTorrent which seems like an interesting choice because it depends on just libsigc++ and libcurl. I still think we're fine with just libcurl for now though, the BitTorrent distribution would be an idea for later. --Bjørn 01:43, 20 Sep 2005 (CEST)
"Q: Is anyone got it work under windows? (maybe any plan on porting?) A: Haven't heard of anyone doing so and i don't really care about the win32 platform and its lack of posix support. Unless someone pays me it'll propably not happen. ;)"
Just to let you notice windows is not supported. --ElvenProgrammer 08:39, 20 Sep 2005 (CEST)