Custom Content

From ETQWPro Wiki Pages

Jump to: navigation, search

Contents

DESCRIPTION

Enable automatic downloads of megatextures to connecting game clients. Finally permit a smooth ETQW public-mod auto-download experience!

HOW IT WORKS

  1. The megatexture is copied/renamed into a .pk4 file on the server by server-admin or map-maker.
  2. During map init, server tries to locate/reference the renamed megatexture, and if present causes it to be added to the .pk4 purelist, and hence automatically downloaded as part of the normal download system.
  3. Client downloads .pk4 files and at the right time during map initialization, checks if the file is in .pk4, and if it is, extracts as nessesary, comparing checksums, as necessary. The megatexture is extracted to the mod's own folder.

USE CASES

The following client use cases were tested:

  1. mega missing & pk4 missing
  2. mega missing & pk4 exists/bad-checksum
  3. mega missing & pk4 exists/good-checksum
  4. mega exists/bad & pk4 missing
  5. mega exists/bad & pk4 exists/bad
  6. mega exists/bad & pk4 exists/good
  7. mega exists/good & pk4 missing
  8. mega exists/good & pk4 exists/bad
  9. mega exists/good & pk4 exists/good

...which result in the following corresponding client actions:

  1. download & extract
  2. download & extract
  3. extract
  4. download & extract
  5. download & extract
  6. extract
  7. download
  8. download
  9. nothing todo

CODE ASSUMPTIONS

The code hardcodes a filename convention for megatexture that is not guaranteed, so until the code is enhanced, the map as shipped must name its (extracted) MT file accordingly:

  1. megatextures/<mapname>_lit.mega (EXTRACTED filename)
  2. megatextures/<mapname>_lit.dat (ZIPPED filename)

USAGE

Create a supplemental .pk4 file adjacent to the .pk4 containing the new map filename .dat as shown above and place it on your server. The MT can be added to the map's primary .pk4 , it doesn't really matter. I did the following:

  1. zpak_map_wake.pk4 (contains original files)
  2. zpak_mega_wake.pk4 (contains only renamed megatexture file)


Where the content of zpak_mega_wake.pk4 is:

   Archive:  zpak_mega_wake.pk4
   Length   Method    Size  Ratio   Date   Time   CRC-32    Name
   --------  ------  ------- -----   ----   ----   ------    ----
          0  Stored        0   0%  02-08-08 05:13  00000000  megatextures/
    4905318  Defl:N  4869027   1%  02-08-08 04:13  67fe3d01  megatextures/wake_lit.dat
   --------          -------  ---                            -------
    4905318          4869027   1%                            2 files

Credits and Source

Thanks to Mr.Mxyzptlk for contributing this!

Source: http://community.enemyterritory.com/forums/showpost.php?p=308609&postcount=1

Personal tools