The SlakPak is back, and it's the mac, jack"
Introduction
Custom maps for halflife games have always sucked to install.
- 1/2 of them are just plain archive
- plain archives dont help you install in the right place
- the archives vary in where they need to be inpacked (some in
game/, some in just games/maps/)
- 1/2 of them have executable installers
- they cant be read by a computer and so you cant automate it
- many of them dont work out where they need to install, so you
have to do it manually which is no better than a plain archive
- some of them actually get it wrong (dod maps installing in
cs directory)
If you want to install 40 maps, then you have to fight and deal
with 40 different ways of installing, 1/2 of which are no help in
telling to where and a small percentage that actually get it wrong.
What a mess. What a nightmare. Lets automate it.
Yay for Lecutus, one of our cool regulars built a tool that allowed for
a simple map installer which pulled the custom maps off a server and
did all the installing in one go. Beautiful! But maintaining the
server's list of maps tended to fall behind the installed custom maps
on the server. I got dobbed into updating it and I figured that if I
made it easy for other people I wouldnt have to do it. :)
Thinking about easy custom map packing...
Lets break the custom map process into a number of 'people':
- packer (small number of trusted users)
Has a script which creates a list of installed files for each map and
submits them to the server.
- server (unique)
Takes the submitted files (from packers) and makes an slakmappak for each one.
Creates a metalist of maps, some marked as offical.
- installer (many! 1 per player/user)
Reads the metalist of maps and deletes any that are no longer
supported and installs any new offical (or selected unoffical) maps.
Packer
Packers are the poor suckers who actually have to deal with all the
different map installers. We cant avoid some need for humans, but
packers can save everyone else headaches but doing some grunt work.
This is the process behind the packer's script:
- packer selects game type (dod, cs, ns, tf2)
- script 'touches' modification time on every game file
- script gathers file info for every game file
- packer manually installs the custom map
- script gathers file info for every game file
- difference between the two lots of file info are the new files
- if any file contents have change: abort
- if any file has been deleted: abort
- pack up new files into archive
- work out map name from .bsp file
- sync to personal directory on the server
Note that the script can potentially delete any incorrectly
installed files to help the packer deal with annoying installers etc.
(Although it wont help if dod maps are installed in the cs directory
as only the dod directory will have been scanned).
Status
Mostly written (syncing not yet done, waiting on server design and
availablility of rsync).
packer: file layout
....slakpak/pak.py # script file
/lib/... # script code & config
generates
/map/gametype/mapname/... # holds files
Server
From the previous packer's step, packers sync their
...slakpak/map/ directory to individual directory on
the server (using rsync or maybe some file submitting cgi). Using
rsync+ssh+authorized keys would allow packers to submit to their
personal directories without needing actual accounts (just
different keys and restricted authorized_keys commands).
Given the files are synced, the server then:
- walks every packers submitted maps and create new
slakmappaks for each unique (by mapname) one.
- error if different packers versions of the same map disagree
- make a config for each map containing a list of files + size + md5
- make a metalist of maps, containing a list of each map config name
+ size + md5 plus an optional 'offical' tick
Status
Not yet done, but should be pretty easy.
server: file layout
packers each sync to create
....slakpak/packers/packername/gametype/mapname/...
generates
....slakpak/offical/gametype/mapname/... # files
....slakpak/offical/gametype/mapname.info # config
....slakpak/offical/gametype.info # metaconfig
Installer
The installer talks to the server:
- grabs the meta list of maps
- verifies none of the installed maps configs have changed
(uninstall + reinstall if it has)
- uninstall any installed map configs not in the meta list any
more (deleted from server?)
- install any offical maps in meta list not already locally installed
- possibly repair any installed maps (check local config and
actual files)
Status
Not yet done. Dont know if I should hack up a proof of concept python
one (final one would need to be easier, maybe look at py2exe?) or if I
should chat with Lecutus about hacking his installer.
installer: file layout
....slakpak/program.??? # installer program
generates
....slakpak/maps/gametype/mapname.info # config for each installed map