MegaGlest Forum

Archives (read only) => Glest Advanced Engine => Feature requests => Topic started by: will on 17 November 2010, 06:43:57

Title: integrated mod installer
Post by: will on 17 November 2010, 06:43:57
https://forum.megaglest.org/index.php?topic=6002.msg62656#msg62656

Apologies if this has previously been discussed to death (although I couldn't find a thread on it in this forum), but I'm volunteering to try and implement it.  I have plenty of experience programming this downloading kind of thing, but it will be a fun and gentle introduction to coding glest...

The first step is get a good idea of the requirements so please reply with your assumptions and desires.

Oh, and explain how we manage mods that add fractions vs mods that use the engine for alternative games...
Title: Re: integrated mod installer
Post by: Zoythrus on 17 November 2010, 07:00:04
not just a mod installer, but we also need an auto-updater too!
Title: Re: integrated mod installer
Post by: Gabbe on 17 November 2010, 12:57:53
I think i remember Omega or Arch tell me about something about GAE patcher or something..
Title: Re: integrated mod installer
Post by: ChupaReaper on 17 November 2010, 14:37:00
Some form of Frontend/Launcher for GAE would be good, it could replace the Configurator too.
I know this wouldn't be intergrated into GAE but it would do for now, it could change the game settings, key bindings and could check for mod updates and install them, etc then eventually for GAE 0.6 or something it could be intergrated.
Title: Re: integrated mod installer
Post by: will on 17 November 2010, 20:50:39
I have found this thread on the mailing list:

http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTikA%3Ddn8ESu_LyBREJMV1rObnOnp1oiv8txTU1yt%40mail.gmail.com&forum_name=glestae-devel

Is this already going somewhere?
Title: Re: integrated mod installer
Post by: John.d.h on 17 November 2010, 20:58:11
I have no idea how familiar you are with the engine just yet, so you may know all of this already, but here goes (from a non-coder).  GAE uses PhysFS to read mods from the user's addons folder (~/addons on Linux), and currently gives priority to the files in the addons folder.  The directory layout of the add-on must mimick the regular structure of Glest's data directory.  An add-on can stand alone or modify existing content, or both, and it overrides files on an individual basis, so an add-on can modify as much or as little as the modder wants.  An add-on could include an entire tech tree with accompanying tilesets, scenarios, and maps, or as little as a single file.  For example, if I wanted to make an add-on that gave the Initiate 1000hp and changed nothing else, I would make a single initiate.xml file and make the following directory of empty folders: uber_initiate/techs/factions/magic/units/initiate/.  That would be placed in the addons folder, and would override the native initiate.xml file at run-time.  Alternatively, instead of "uber-initiate" being a folder, it can be a zip file.  Certain types of 7zip archives are allowed too, but someone else can explain more about that.  Thus, we would have uber_initiate.zip/techs/factions/magic/units/initiate/initiate.xml.

So, as long as the add-on in question replicates the file structure properly, I believe all a downloader would need to do is fetch the add-on from a server and put it in the addons folder, and maybe check for updates from said server.
Title: Re: integrated mod installer
Post by: ChupaReaper on 17 November 2010, 21:23:01
So, as long as the add-on in question replicates the file structure properly, I believe all a downloader would need to do is fetch the add-on from a server and put it in the addons folder, and maybe check for updates from said server.

This would be good, but I think some projects should be able to go directly into the glestae directory, perhaps whatever server the mod is on can store whether the mods are saved into addons or into glestae, this is incase you get addons for project like mine which is basically a separate game that uses the gae engine, addons may be made just for my project rather than Glest, etc.
Title: Re: integrated mod installer
Post by: John.d.h on 17 November 2010, 21:40:40
This would be good, but I think some projects should be able to go directly into the glestae directory, perhaps whatever server the mod is on can store whether the mods are saved into addons or into glestae, this is incase you get addons for project like mine which is basically a separate game that uses the gae engine, addons may be made just for my project rather than Glest, etc.
In what situation would there be a benefit to putting it in the main directory instead of addons?

https://forum.megaglest.org/index.php?topic=6002.msg62656#msg62656
Oh, and explain how we manage mods that add fractions vs mods that use the engine for alternative games...
I forgot to mention that there's a parameter in an XML somewhere that says something like <total-conversion value=""/>.  I'm not sure what all it does, though.
Title: Re: integrated mod installer
Post by: wciow on 17 November 2010, 21:41:23
i would like to see an auto updater which scans the server and updates mods which are already installed with the newest version.

Currently if two mods try to overwrite the same data files such as main menu models for a total conversion then physfs selects one over the over automatically. I believe Silnarm was working on a mod selector to choose which mods are loaded after start up.

Another problem which may arise is if one mod depends on another. mods need to check for dependencies in other mod files and not load if the prerequisite files are not loaded.
Title: Re: integrated mod installer
Post by: will on 17 November 2010, 21:56:58
Gathering advice on the mechanics of the packaging here: http://encode.ru/threads/1164-recommended-formats-for-game-data-and-partial-updates

My thought is that two tools are needed:

1) a packaging tool that generates the archive, some patch archives for moving cheaply from sequential version to version, and accurately recording the dependencies

2) the front-end in GAE itself, probably via the tech tree options and fraction choices in the new game screens; I can see that an external tool is more immediate to develop, but I favour a deeper integration as giving more customer satisfaction longer term

And this cascades into what to do if playing a multi-player game and ensuring all players have the same (e.g. most recent) version...
Title: Re: integrated mod installer
Post by: will on 17 November 2010, 23:56:14
Some stats about diffing two versions of a mod: Malevolent Rising 1.6 vs 1.0 (yes I know that's a big jump, but it was about the only two files I could find):


245 files added:     41,706,266 bytes
300 files unchanged: 95,469,241 bytes
11  files changed:    7,958,481 bytes
96  files deleted:   19,597,478 bytes


Is this fairly typical?  Also, is there ever much renaming of files without changing their contents?  (I did not check for this in the script I wrote to get those numbers)

It looks like I have a very simple format for the partial downloads of new versions in mind....
Title: Re: integrated mod installer
Post by: John.d.h on 18 November 2010, 02:32:43
Is this fairly typical?  Also, is there ever much renaming of files without changing their contents?  (I did not check for this in the script I wrote to get those numbers)
Malevolent Rising is not representative of the typical mods we have around here.  Most are much smaller.  Renaming isn't all that rare -- even just in Magitech, the Behemoth was formerly called a Daemon Giant and the Guard used to be called an Armored Swordsman.  Plus, we seem to have a lot of people around here who can't spell, so that sometimes gets corrected with subsequent versions.
Title: Re: integrated mod installer
Post by: Omega on 18 November 2010, 06:37:06
I'd also like to note that I think this shouldn't be built into GAE, but a standalone tool compatable with all versions of Glest (would also have to check a mod's data when downloading as for which engine it is, something that is easiest done server side).
Title: Re: integrated mod installer
Post by: will on 18 November 2010, 09:05:53
I added rename-checking and got these numbers for MRise 1.0 -> 1.6:

245 added:       39.8 MB
9   renamed:      1.6 MB
300 unchanged:   91.0 MB
11  changed:      7.6 MB
87  deleted:     17.1 MB

471 previously: 117.3 MB -> 60.2 MB zipped -> 50 MB 7z/rar
556 now:        148.7 MB -> 78.1 MB zipped -> 64 MB 7z/rar
    delta:               -> 27.0 MB zipped -> 19 MB 7z


My script, if anyone wants to run it on their mods (requires Python): https://gist.github.com/704809

9 of the files were found to be renamed.

With zip (my format of choice) the 1.0 mod archive was 60 MB compressed; it was originally distributed as a 7zip archive using RAR compression (and, I imagine, solid), and was only 50 MB.

The 1.6 mod archive compresses to 78 MB using zip, and was distributed as a 7zip archive with RAR too, taking just 64 MB.

Using the 'diffing', I calcuate you would only need to download 27 MB of of the 1.6 zip file in order to patch a copy of 1.0 that you already had; if we used 7zip (non-solid; actually, solid didn't improve compression dramatically) then this would be only around 19 MB.

So you can imagine two archives sitting on public web hosting, e.g. Google Sites.  There is also a 'diff' meta-data file.  The updater checks the meta-data file to see if its changed, using HTTP If-Modified-Since etc.  If its modified, it gets the meta-data and either fetches the full new archive, or uses a range request to download the delta (that has been conveniently packaged at the end of the new archive).  You can imagine a central site with scripts and things for the mod makers to be using to 'publish' the availability of updates etc, but I think it useful that the actual GBs of mods are stored elsewhere, and Google Sites seems to be a good choice.

Now 7z is supported in the latest GAE, but I feel that zip is an acceptable format and will be easier to work with.

There are zip archivers (e.g. 7z, info-zip but especially kzip) that do a better job of compressing zip archives than the normal 'zip' tools (but take much longer).

Working out how to diff mods was an interesting distraction but the real meat of the problem is now learning how the virtual FS works in GAE, and how to mod Glest and MG.

Keep feature requests and insights rolling in!
Title: Re: integrated mod installer
Post by: silnarm on 18 November 2010, 12:01:47
I have found this thread on the mailing list:
...
Is this already going somewhere?

Yggdrasil finally opened a ticket (http://sourceforge.net/apps/trac/glestae/ticket/249), and the prototype was perfectly functional, so I think yes... in due course it will happen.

Maybe check out the prototype (attached to the first post on the mailing list conversation) to see what it does already, he used xdelta for the patches, which are taken from a tar of the mod (single patchfile for a mod).
Title: Re: integrated mod installer
Post by: Yggdrasil on 18 November 2010, 15:00:02
Yeah, i almost forgot to open a ticket. Haven't worked on it since the prototype. I wanted to work on it after adding the addons menu where i'm currently stuck at the gui code... But any help is welcomed.

I briefly looked at your python script and you just compare file names and sizes. Actually same size doesn't mean no modifications. A checksum would be better. And packaging the delta at the end of the archive to get it later with a range query won't work. The zip header is missing and i don't know how you want to merge two zips.

Anyway, i think we should better use existing patch tools like xdelta instead of coding our own. Here's a shell script i used to create patches between two tarballs (addon in a tar archive).
Code: [Select]
#!/bin/sh

if [ $# -eq 4 ]; then
        if [ "$1" = "create" ]; then
                size1=$(ls -l $2 | cut -d " " -f 5)
                size2=$(ls -l $3 | cut -d " " -f 5)
                if [ $size1 -lt $size2 ]; then
                        size1=$size2
                fi
                xdelta3 -e0 -B $size1 -W 16777216 -I 0 -s $2 $3 $4
                xz -9 $4
        elif [ "$1" = "patch" ]; then
                unxz -k $3
                xdelta3 -d -s $2 ${3/.xz/} $4
                rm ${3/.xz/}
        else
                echo "usage: $0 create old new patchfile"
                echo "or: $0 patch old patchfile new"
        fi
else
        echo "usage: $0 create old new patchfile"
        echo "or: $0 patch old patchfile new"
fi
Glest itself just needs to apply these patches if we really want to integrate it directly. The prototype only does that but it's still a bit buggy. libcurl is also not the right choice as it can't pause and resume downloads. The list of available addons on the server is saved in a simple CSV file which was handwritten for this simple test.

Another problem which may arise is if one mod depends on another. mods need to check for dependencies in other mod files and not load if the prerequisite files are not loaded.
I don't really think we need that and it makes it just more complicated. Dependency checking isn't trivial and involves too much work. We even don't need patches for the first version.
Title: Re: integrated mod installer
Post by: will on 18 November 2010, 16:42:34
yeah I was expecting to author the zip or 7z archive directly to turn a range request into a full archive.

my python script was not intended in any way to be the codebase that gets adopted, but rather I simply wanted to know what fraction of a mod altered for each iteration and how big the diffs might be; not find a quick way to determine that, I wrote that throw-away python script.

I feel uncomfortable with a tar+xdelta approach and would prefer an approach where the xml of a mod was parsed in the same way the game does, all dependencies located, and all the appropriate bits getting zipped up along with meta information.  It might be that the end result is an archive, but the way to get there is quite different and more involved.

The appeal of HTTP range requests is the simplicity of hosting.

So rather than a script that just thinks about directories, a tool that actually parses and packages the mod.  That's my general outlook.
Title: Re: integrated mod installer
Post by: ChupaReaper on 18 November 2010, 19:27:10
This sounds interesting, I'd be happy to open up my mod so that incomplete factions can be downloaded and updated on the fly along with complete factions with automatic patching, etc. You'd have to explain how I would set up my project for all this though, perhaps setup a page on the wiki explaining how to make mods 'live' or whatever.
If it could be set up where individual files are updated rather than downloading everything in bulk it would be simply to patch one tiny spelling mistake somewhere or some stats adjustments for better game balance... I hope I make sense here lol!
With my mod being large and only going to be larger, the pause and resume options for downloading would be excellent too, maybe we could go as far as setting download priorities so people can play single player matches whilst downloading on the go (download a few main files then a tileset, map and a faction so they can play from there while other factions and tilesets continue to download). For this factions, tilesets and maps and 'core files (menu changes, language, etc)' would have to be treated as separate pieces to download.
Title: Re: integrated mod installer
Post by: Yggdrasil on 18 November 2010, 20:10:08
I feel uncomfortable with a tar+xdelta approach and would prefer an approach where the xml of a mod was parsed in the same way the game does, all dependencies located, and all the appropriate bits getting zipped up along with meta information.  It might be that the end result is an archive, but the way to get there is quite different and more involved.
Isn't this the modder's work? And what meta information?

I'm more with the KISS principle here. We already get archives from the modders, hopefully addon compatible, and just upload these to the repository. Create a simple CSV file which lists all addons with version number and a checksum for integrity check after download. And that's it.

Next step would be to add binary patches which reduces updates dramatically. Diff utilities work best on uncompressed data like tar. Just add these patches to the CSV file and prefer to load these on update instead of full. The only drawback here: After patching we have an uncompressed tarball which is currently not supported by physfs.

That's what basically the prototype does. I don't see any benefit in your approach and i actually don't really understand what you want to achieve.
Title: Re: integrated mod installer
Post by: Omega on 19 November 2010, 01:41:03
What I would do would be a bit more complex (on the web side) but just as easy on the programmer's side.

Firstly, we'd have our web host, which would host zips (and possibly 7z's in the future, if support is added). The host has a page which displays the mod list, in a searchable method comparable to download.com (the current look of the MDC would get too big when more and more mods are added). This would be comparable to some other games mod centers. Once the user finds a mod they like, they download it (the web host will have individual pages created from XMLs, similar to how things are now, but more data would be needed for better security and features. Basically, a rough login system and ownership system would let modders upload their mods. Some users would always have ownership thanks to a "moderator status" to allow them to upload mods and update information on them. For the most part, each modder would be responsible for keeping their own mods up-to-date on the MDC). After the mod is downloaded, the mod installer will install the mod. Information can be contained in the page which specifies the engines of the mod, and the installer let's the player choose which engines to install it for (if compatible).

GAE mods would just place the file in the user's addon's folder (presumably, we'd have to check if the addons folder exists, and if not, let the user specify it's location (in case they set a different location for the folder), though, presumably we'd have the option to extract it into the the folders directly, if wished. I'm not sure if MG has a variety of the addons folder (I believe it does have a mydata folder or something), but if so, can be installed in there, while vanilla Glest mods would be installed directly by extracting the file into the Glest directory.

Programmer side, it's just catches the downloaded mod and installs it. The complexity is how to install the mod or patch. Web design side, it let's the player search, read descriptions, reviews, etc for finding the mod. Overally, it's just Yggdrasil's idea with a better interface.



On another note, how would a diff work? What if the user had v1 and wanted to update to v1.2 (skipping a version). I'd think there'd have to be 2 versions of the upgrade (which is what SMF, this forum, uses). Basically, there's a small upgrade which upgrades from the last version to the most recent, and there's the large upgrade, which contains all the files changed since the last major release (for example, Military's next version, 2.5, would have a small upgrade to upgrade from 2.4 to 2.5, whereas the large upgrade could upgrade from any 2.x to 2.5. Older than that and you'd need a full install). On the web design side, there's just a few download options. Upgrades would only be available to download if the modder made them available.



At any rate, the web design side WOULD work stand alone with or without the tool, and I will end up starting work on it as the next version of the MDC (http://glestguide.co.cc/mdc).
Title: Re: integrated mod installer
Post by: will on 19 November 2010, 07:09:07
Quote
That's what basically the prototype does. I don't see any benefit in your approach and i actually don't really understand what you want to achieve.

ok.  Tar+xdelta for now then.  We can always make it more complicated later.  I want to code things and help code things, not be an upstart.

So there seems two directions I could code in:

1) code and submit to physfs tar support

2) the study of supporting multiple total-conversions and also mods that mod a total conversion

thoughts on what needs doing?
Title: Re: integrated mod installer
Post by: silnarm on 19 November 2010, 14:06:27
...I wanted to work on it after adding the addons menu where i'm currently stuck at the gui code...

Direct complaints this way :)  It certainly needs work, the scrollbar in particular is somewhat awkward to use. I'd suggest sub-classing Container for the 'AddonEntry' and laying them out explicitly, then just put them in a Panel with vertical auto-layout.  I'll add support to Panel to automatically add the scrollbar if it can't fit all it's children.

On another note, how would a diff work? What if the user had v1 and wanted to update to v1.2 (skipping a version). I'd think there'd have to be 2 versions of the upgrade (which is what SMF, this forum, uses). Basically, there's a small upgrade which upgrades from the last version to the most recent, and there's the large upgrade, which contains all the files changed since the last major release (for example, Military's next version, 2.5, would have a small upgrade to upgrade from 2.4 to 2.5, whereas the large upgrade could upgrade from any 2.x to 2.5. Older than that and you'd need a full install). On the web design side, there's just a few download options. Upgrades would only be available to download if the modder made them available.

Personally I'd only support one patch, from the previous to current version, but I think this is something that would be up to the modder. You'll have access to the repository to maintain your mod, and you will create the patches (we will of course provide the tools to do this). So you can support what upgrades you can be bothered preparing :-)

1) code and submit to physfs tar support

2) the study of supporting multiple total-conversions and also mods that mod a total conversion

tar support for physfs would certainly get my vote, total conversions can always use their own installer, and 0.4 will have a menu to select which addons are mounted and which aren't, so that will not be as much of an issue as it seems now.
Title: Re: integrated mod installer
Post by: will on 19 November 2010, 16:21:05
I'll go add tar to physfs; a good way to learn my way around how it works too
Title: Re: integrated mod installer
Post by: Omega on 19 November 2010, 23:27:39
Patches would really be at the discretion of the modder. What I have in mind is a very simply system where you can upload your own files and set the data for them, while supporting a basic search tool. Powered by PHP, users would logon, create a user name and password, all mods would be defaultly set to have "owners", which would simply be associated with the names of the uploader (a necessary security option to prevent someone from uploading a bad copy, etc) plus a set of users that would be considered the "moderators". Uploading and browsing mods, etc, is all web side, the program's focus would then be the downloader/installer.

We'd also, of course, need a tool to make patches that the program can install. I think the patches should directly edit the files in either the archive or the installed files.
Title: Re: integrated mod installer
Post by: hailstone on 21 November 2010, 01:06:31
not just a mod installer, but we also need an auto-updater too!
I had a topic where I was talking about making an updater but I can't find it now. One of the ideas was that you can start with only a single binary file and it would download anything that was needed to run.
Title: Re: integrated mod installer
Post by: will on 22 November 2010, 18:45:14
Adding tar support to physfs is of course possible; however, it is performance presenting problems; tar is a solid format.

I'm not going to say what I think alternatives might be yet; I'm interested in what you folks think.

Title: Re: integrated mod installer
Post by: will on 22 November 2010, 20:47:52
given that the addons/ folder hasn't really taken off yet, its meaning could be changed.

It could be that there is a folder containing 'total conversions' - including the default one, which perhaps ought to be megapack - and that only one of these is allowed at any one one time - its pickable from the main menu, and the artwork for the menu screens etc is based upon it.  It could be that the name 'addon' is changed to perhaps something slightly more appropriate?

And then within each of these folders, there the mods of any total conversion are stored.

How does this grab people?
Title: Re: integrated mod installer
Post by: John.d.h on 22 November 2010, 22:39:02
only one of these is allowed at any one one time
I'm not so sure.  What if you wanted to use a map from Military with the MRise tech tree and a tileset from Megapack, for example?
Title: Re: integrated mod installer
Post by: Omega on 22 November 2010, 23:22:12
only one of these is allowed at any one one time
I'm not so sure.  What if you wanted to use a map from Military with the MRise tech tree and a tileset from Megapack, for example?
+1  :thumbup:
Title: Re: integrated mod installer
Post by: Yggdrasil on 23 November 2010, 00:22:52
Adding tar support to physfs is of course possible; however, it is performance presenting problems; tar is a solid format.
Mhmm, you're right here. Haven't thought about that.

Maybe we should just use an uncompressed zip (everything stored). A short test shows that xdelta produces patches with similar sizes to tar. Zip is already supported by physfs. The full packages could still be compressed with xz, using zip only as container.

I think all mods who change the core files, not core data, like the menu should package these files separately in another addon.

Btw, as this "tool" downloads the addons it should definitely also browse the repository. So, what information about the addon should be shown? And how do we structure this list?

My proposal: Simple CSV file with addon name, version number and checksum. A (very) short description would be nice and maybe a tiny logo (embedded with UUencode). It's not meant to inform you in detail about the mod, the forum is a better place for this, just enough to find what you're looking for.
Title: Re: integrated mod installer
Post by: John.d.h on 23 November 2010, 00:40:37
My proposal: Simple CSV file with addon name, version number and checksum. A (very) short description would be nice and maybe a tiny logo (embedded with UUencode). It's not meant to inform you in detail about the mod, the forum is a better place for this, just enough to find what you're looking for.
A link to the forum thread or wiki page would also be nice.
Title: Re: integrated mod installer
Post by: will on 23 November 2010, 06:35:15
XML is what modders have to use for the units, so why not for the mod description too?  CSV has the disadvantage of being flat and difficult to extend.

Now I'd like JSON to be usable everywhere we use XML today, but that doesn't seem to be necessary, just elegant.

XDelta on packed zips - as long as the zip is packed by the same zip program with the same settings, and that's something we control - is very nearly as good as on stored zips.  I know that if we xz the stored zip it is smaller, and that the xdelta between two stored zips is smaller, but its all not a lot.  If we work with compressed zips, compressed with a decent zipper like 7zip (kzip is sadly not open source, and its slow), then we can store compressed zips on the file system (which feels nice).  I mean, if the xz and xdelta advantage over deflate is worth it, then why not use bsdiff instead of xdelta and so on?

Ok, I bow my head in shame, suggesting xdelta on compressed zips.  It works surprisingly well.

If we want to go for good compression, we'd use bsdiff and stored .zip and .xy.

If we want things to be packaged faster we go for xdelta and delfated .zip, we just have to be careful to control the zip tool and options.  But then the zips are compressed on disk, which is nice.

Both these approaches bring up using PNG (and, honestly, JPG) instead of BMP/targa, and OGG instead of WAV.  If people did this, and we added support for g3dz, there'd be no difference between a deflated and a stored zip.

What is clear is that either a mod contains each and every artwork it needs - yuck - or a dependency checker is built into the packager tool so it detects all dependencies.
Title: Re: integrated mod installer
Post by: John.d.h on 23 November 2010, 07:24:59
Something just came to mind regarding extra files that sometimes get left in mod downloads that don't need to be there, or aren't necessary for playability.  If the database separated out the source files (.blend, .xcf) and put them into an accompanying archive, then it would save some trouble for the modder and also ensure the player that they weren't wasting bandwidth, while preserving source files for anyone who wants to modify the art for their own mod.  It could also clean out useless files like ~*.xml, thumbs.db, etc.
Title: Re: integrated mod installer
Post by: Omega on 23 November 2010, 18:58:24
Meh, I still plan to create the website end as I proposed as the next MDC...

And all XMls are read and made individually for security, instead of one CSV for all mods... And I agree, XML > CSV.
Title: Re: integrated mod installer
Post by: Yggdrasil on 23 November 2010, 21:42:58
Ok, then XML. Just wanted to keep the parser simpler and the file smaller. Something like that?
Code: [Select]
<repository>
<mods>
<mod>
<name>...</name>
<version>...</version>
<description>...</description>
<checksum>...<checksum>
<logo>...UUencoded 32x32 PNG (optionally)...</logo>
</mod>
...
</mods>

<patches>
<patch>
<mod>...modname...</mod>
<oldversion>...patches from this version to the newer one above...</oldversion>
<checksum>...</checksum>
</patch>
...
</patches

</repository>

I think memory consumption and run time are still acceptable with xdelta and xz. I just thought about using libarchive on clientside and xz is already there, so why not use it. But it's not really important to nail the compression format now. Just keep the bandwidth for the hoster in mind.

Testing compressed zip and uncompressed zip(.zip0) using mrise core files:
Code: [Select]
79M mrise_1.6.zip
149M mrise_1.6.zip0
 58M mrise_1.6.zip0.xz
 61M mrise_1.0.zip
118M mrise_1.0.zip0
 45M mrise_1.0.zip0.xz
 45M mrise_zip0.xdelta
 19M mrise_zip0.xdelta.xz
 26M mrise_zip0.xdelta.zip
 27M mrise_zip.xdelta
Using compressed zips makes it easier for the program and is smaller on disk for the user but uses more space and bandwidth for the hoster. I'm not sure what's better, depends on the webspace we want to use. Opinions?

Meh, I still plan to create the website end as I proposed as the next MDC...
One could still use your "web platform" idea to maintain this list.
Title: Re: integrated mod installer
Post by: Omega on 23 November 2010, 21:58:33
The current MDC uses the following layout:
Code: [Select]
<mod>
   <type>tech|tileset|scenario|map|other</type>
   <name>Mod Name (as it appears)</name>
   <shortName>one_word_short</shortName>
   <version>#</version>
   <author>Author's Name (as it appears)</author>
   <description>Description of the mod (as it appears)</description>
   <download direct="true|false">http://download.link</download>
   <editorRating>0-5</editorRating>
</mod>

<!--
   GUIDELINE:
   type = The catigory to sort the mod into, either tech, tileset, scenario, map, or other.
   name = The proper name of the mod. This is as it appears, so remember proper case, etc;
   shortName = The name used to look up user's scores. MUST BE UNIQUE!!!
   version = The version number of the faction. Newer versions will overwrite older ones.
   author = The creator(s) of the mod, as they appear, so remember case.
   description = A description for the mod, as it appears, so remember punctuation and case!
   download = The download link. Direct is a boolean value for wether or not the download is a
                        direct download that starts on its own, or one that has a download page.
    editorRating = Place your IMPARITIAL rating (necessary or the ratings are ALL screwed up)

    Standard XML rules should be followed. To ensure proper parsing, make each element SINGLE LINE!
    Also, use HTML entities &lt;, &gt;, and &amp; for the corresponding symbols.
   
    Failure to create a valid XML may result in your mod not being updated or posted in the MDC.
-->

However, it can easily be changed or expanded, since it was only made to display things needed in the current MDC. I would think that it would have to be a "browser" style program to download though, since PHP recursively reads through the folders scanning the XMLs in a manner simular to how Glest reads a techtree. I'm also planning to change the XML parser to improve on its parsing abilities. There is a web submission form though, as those who have seen the recent MDC should know.
Title: Re: integrated mod installer
Post by: -Archmage- on 24 November 2010, 00:40:20
This is half technobabble.......I'm gonna throw my thoughts out there into the technobabble and see what happens.

GUI: There would be an Addons button, that would have tabs for Mods, Maps, Tilesets, Scenarios, and Updates. Scenarios would have listed prerequisites, that would automatically be downloaded and installed with the scenario. The Addons button would blink(or do something) to notify an update or multiple updates are availble. All tabs would display a list that could be sorted alphabetically, by most downloads, and other things like size. Updates tab would be empty unless there is an update available(could have the update tab blink as well), and if there is an update available it would tell you your current version, and the latest version. The Mods, Maps, and Tilesets tabs would have preview images that could be clicked on to see larger. Maps could have a recommended tileset. For the sake or browsing I think each addon should have a little arrow at the far left that would open and close them, like in the older file managers with the plus and minus. Closed would be maybe 1/2 of an inch tall, enough room for the map's name and other basic info. Open would be as tall as needed to display a description, preview images, and other info. A Download&Install button could be in the open mode as well? A 'refresh lists' button could be added to get the latest info. And possibly a setup tab with setup options for things like automatically downloading updates and stuff like that.

Structure: A server would hold the content. GAE would check the server on startup, and update a config(cfg) file which would hold all the list data. When a download is requested, GAE would get the link from the config file and download the content and any prerequisites.

Updating System: GAE would check your version and check the server's latest. GAE would then update step-by-step, through each version on the server to the latest.
                                    Example: Your version: 2.8    Server version: 2.9.1     Updating: 2.8 --> 2.9 --> 2.9.1
Example with major version change: Your version: 2.9    Server version: 3.1.1     Updating: 2.9 --> 3.0 --> 3.1 --> 3.1.1   Notice that patch 2.9.1 is not installed.
Or course the server wouldn't always be able to hold all the versions of the mod, and if someone had an old version of something and it couldn't be patched up to the latest version, the latest full release would have to be installed and patched up to latest.

What do you guys think? Missing anything? 8)
Title: Re: integrated mod installer
Post by: Omega on 24 November 2010, 06:19:30
This is half technobabble.......I'm gonna throw my thoughts out there into the technobabble and see what happens.

GUI: There would be an Addons button, that would have tabs for Mods, Maps, Tilesets, Scenarios, and Updates. Scenarios would have listed prerequisites, that would automatically be downloaded and installed with the scenario. The Addons button would blink(or do something) to notify an update or multiple updates are availble. All tabs would display a list that could be sorted alphabetically, by most downloads, and other things like size. Updates tab would be empty unless there is an update available(could have the update tab blink as well), and if there is an update available it would tell you your current version, and the latest version. The Mods, Maps, and Tilesets tabs would have preview images that could be clicked on to see larger. Maps could have a recommended tileset. For the sake or browsing I think each addon should have a little arrow at the far left that would open and close them, like in the older file managers with the plus and minus. Closed would be maybe 1/2 of an inch tall, enough room for the map's name and other basic info. Open would be as tall as needed to display a description, preview images, and other info. A Download&Install button could be in the open mode as well? A 'refresh lists' button could be added to get the latest info. And possibly a setup tab with setup options for things like automatically downloading updates and stuff like that.

Structure: A server would hold the content. GAE would check the server on startup, and update a config(cfg) file which would hold all the list data. When a download is requested, GAE would get the link from the config file and download the content and any prerequisites.

Updating System: GAE would check your version and check the server's latest. GAE would then update step-by-step, through each version on the server to the latest.
                                    Example: Your version: 2.8    Server version: 2.9.1     Updating: 2.8 --> 2.9 --> 2.9.1
Example with major version change: Your version: 2.9    Server version: 3.1.1     Updating: 2.9 --> 3.0 --> 3.1 --> 3.1.1   Notice that patch 2.9.1 is not installed.
Or course the server wouldn't always be able to hold all the versions of the mod, and if someone had an old version of something and it couldn't be patched up to the latest version, the latest full release would have to be installed and patched up to latest.

What do you guys think? Missing anything? 8)
Some of that stuff will appear in the next MDC, such as sortable tables and tabbed organization (I'm drastically changing the layout of the Glest Guide itself to have drop down menus instead of some growing ToC on the first page). I'm thinking one problem with this, though, is that modders don't always use very consistent version numbers (if its even a number). For optimal usage, ALL modders will have to learn to adopt standardized version numbering, commonly accepted as A.B.C, where A is the major version, B is the minor version, and C is the revision (optional, and less commonly used). While letters such as a, b, and rc are commonly accepted in version numbering, they make too much of a hassle and should instead simply increase the revision (ie: instead of 2.12a, use 2.12.1). It's a very bad idea to name versions a full word, such as Gimli, since there's no way at all to know if version ASKFLJ is newer or older than version AFJASKF... This ensures its easy to make sure you have the latest version, and numbers are ALWAYS easier to understand than letters.

http://en.wikipedia.org/wiki/Software_versioning
Title: Re: integrated mod installer
Post by: -Archmage- on 24 November 2010, 06:22:03
This is half technobabble.......I'm gonna throw my thoughts out there into the technobabble and see what happens.

GUI: There would be an Addons button, that would have tabs for Mods, Maps, Tilesets, Scenarios, and Updates. Scenarios would have listed prerequisites, that would automatically be downloaded and installed with the scenario. The Addons button would blink(or do something) to notify an update or multiple updates are availble. All tabs would display a list that could be sorted alphabetically, by most downloads, and other things like size. Updates tab would be empty unless there is an update available(could have the update tab blink as well), and if there is an update available it would tell you your current version, and the latest version. The Mods, Maps, and Tilesets tabs would have preview images that could be clicked on to see larger. Maps could have a recommended tileset. For the sake or browsing I think each addon should have a little arrow at the far left that would open and close them, like in the older file managers with the plus and minus. Closed would be maybe 1/2 of an inch tall, enough room for the map's name and other basic info. Open would be as tall as needed to display a description, preview images, and other info. A Download&Install button could be in the open mode as well? A 'refresh lists' button could be added to get the latest info. And possibly a setup tab with setup options for things like automatically downloading updates and stuff like that.

Structure: A server would hold the content. GAE would check the server on startup, and update a config(cfg) file which would hold all the list data. When a download is requested, GAE would get the link from the config file and download the content and any prerequisites.

Updating System: GAE would check your version and check the server's latest. GAE would then update step-by-step, through each version on the server to the latest.
                                    Example: Your version: 2.8    Server version: 2.9.1     Updating: 2.8 --> 2.9 --> 2.9.1
Example with major version change: Your version: 2.9    Server version: 3.1.1     Updating: 2.9 --> 3.0 --> 3.1 --> 3.1.1   Notice that patch 2.9.1 is not installed.
Or course the server wouldn't always be able to hold all the versions of the mod, and if someone had an old version of something and it couldn't be patched up to the latest version, the latest full release would have to be installed and patched up to latest.

What do you guys think? Missing anything? 8)
Some of that stuff will appear in the next MDC, such as sortable tables and tabbed organization (I'm drastically changing the layout of the Glest Guide itself to have drop down menus instead of some growing ToC on the first page). I'm thinking one problem with this, though, is that modders don't always use very consistent version numbers (if its even a number). For optimal usage, ALL modders will have to learn to adopt standardized version numbering, commonly accepted as A.B.C, where A is the major version, B is the minor version, and C is the revision (optional, and less commonly used). While letters such as a, b, and rc are commonly accepted in version numbering, they make too much of a hassle and should instead simply increase the revision (ie: instead of 2.12a, use 2.12.1). It's a very bad idea to name versions a full word, such as Gimli, since there's no way at all to know if version ASKFLJ is newer or older than version AFJASKF... This ensures its easy to make sure you have the latest version, and numbers are ALWAYS easier to understand than letters.

Yea, a standard numbering system should be enforced. :thumbup:
Title: Re: integrated mod installer
Post by: will on 24 November 2010, 10:11:21
Code: [Select]
<mod>
   <type>tech|tileset|scenario|map|other</type>
   <name>Mod Name (as it appears)</name>
   ...
</mod>

Can a mod contain more than one type of content?  How is this specified?
Title: Re: integrated mod installer
Post by: Yggdrasil on 24 November 2010, 10:28:01
There's no type. An addon can contain anything and most mods have various content. To split these would really need dependency checking as scenarios need a certain map, and so on. And i don't like dependency checking as it's difficult to get the addons mounted in the right order with physfs, in case there are overwrites between addons.
Title: Re: integrated mod installer
Post by: Omega on 24 November 2010, 14:34:34
Code: [Select]
<mod>
   <type>tech|tileset|scenario|map|other</type>
   <name>Mod Name (as it appears)</name>
   ...
</mod>

Can a mod contain more than one type of content?  How is this specified?
The type is used to categorize the mod. I will probably have to add a "pack" value to the type. Currently, pack's like the MegaPack are sorted as a tech, since the tech is the primary feature of it.
Title: Re: integrated mod installer
Post by: will on 24 November 2010, 14:56:38
yes, I asked because that confused me.

I'm thinking we need dependency management, and then make physfs mount in the correct order.

I've worked with writing really big systems, and one simple versioning approach that I've seen work very well is to use major.minor numbers in the folder names.  To illustrate:

mods\MRise.1.2.zip\ <-- a zip file, therefore something downloaded and versioned by our new mod installer
mods\MRise.1.3\ <-- not a zip, therefore this is something this modder is making now

The modder runs the packager tool we write.  This tool finds the MRise.1.3 folder, and says "would you like to release version 1.3 of this mod?"

It then walks the files in it, looking for dependencies.  Any dependencies in MRise.1.2 will get copied into the 1.3 zip that is uploaded, other dependencies in other non-MRise folders are allowed, but are recorded in a config file in the new 1.3 zip, rather than copied.  So the packager records what dependencies - other mods - a mod has, and also what it publishes in the sense of maps, scenarios, tilesets, etc.  A 1.3 zip is made, uploaded, the MRise.1.3\ folder is renamed MRise.1.4\ and the zip then placed there.  So the modder moves on a version and carries on modding.

You can push this further, e.g. mods\MRise.1.3.ChazyFraction.0.6.zip would be a mod of a mod, which requires MRise.1.3 (or perhaps later) and so on.  Only modders and the curious see these files; game users just see nice names.

But fundamentally, the idea that things in addons\ are mounted in any order and can replace anything isn't holding.  We'd make the mods\ folder not work this way, but rather follow a strict hierarchy.

Obviously there are lots of finer details and tweaks; but what do people think about this general approach to encapsulating mods into fixed-name folders?
Title: Re: integrated mod installer
Post by: Omega on 24 November 2010, 17:24:11
It has to be a zip file to download though. You can't download an entire folder. It needs to be an archive. 7z is better than zip, and hopefully will be supported in the future.
Title: Re: integrated mod installer
Post by: ChupaReaper on 24 November 2010, 21:51:16
Well I already sort my mod into two parts: MRise_CoreFiles_v1.6.zip which contains the main menu changes, tilesets, maps, scenarions (when I make them) and the tech directory with the resources and mrise.xml.
I then release my factions separate, at the minute only one faction is out as MRise_Necribus_v1.6.zip.
Because maps, tilesets, etc don't take up as much as factions I release them all as Core Files.
Title: Re: integrated mod installer
Post by: will on 24 November 2010, 22:25:07
I am writing a simple test script (to learn the mod structure better, rather than to suggest this is production code) to find all dependencies for a mod.

Just to check I'm not going mad:

It says that vbros_pack_1 is missing some of the textures for pine_woods tileset; and indeed I cannot use that tileset in GAE because it also complains some of the textures are missing.

In Glest/MG, is there a surface2e.bmp etc that is it is 'inheriting' that isn't in GAE, or have I installed it wrong, or is it broken?
Title: Re: integrated mod installer
Post by: Omega on 24 November 2010, 23:14:36
I am writing a simple test script (to learn the mod structure better, rather than to suggest this is production code) to find all dependencies for a mod.

Just to check I'm not going mad:

It says that vbros_pack_1 is missing some of the textures for pine_woods tileset; and indeed I cannot use that tileset in GAE because it also complains some of the textures are missing.

In Glest/MG, is there a surface2e.bmp etc that is it is 'inheriting' that isn't in GAE, or have I installed it wrong, or is it broken?
I'm not familiar with that tileset, but there's no such thing as texture inheriting (yet, and hopefully won't be. I don't want modders to get dependant on that). Most likely your download is shot or it was somehow broken otherwise... Oh, and the best question: is the image there?

Yeah, scenarios are a good place to start, since they're the only things that need dependancies (with the exception of the old FPM, which saves on filesize by using regular Magitech's models for the same units).
Title: Re: integrated mod installer
Post by: will on 25 November 2010, 00:39:49
It really doesn't seem to be there

can anyone else verify that the pine woods tileset in vbros 1 is broken?

(In other news, g2xml doesn't support the old version 3 g3d files; I worked around it but thought it worth mentioning)
Title: Re: integrated mod installer
Post by: silnarm on 25 November 2010, 01:58:49
... And i don't like dependency checking as it's difficult to get the addons mounted in the right order with physfs, in case there are overwrites between addons.

If one addon depends on another, then it shouldn't be overwriting anything from the other addon.  While it would certainly be possible to do things this way, I suspect most addons will be largely self contained, or rely on other addons for maps, or a tech, or whatever.

I don't think dependency checking, and auto download/upgrade of dependencies, should be worried about at first, but I do think it would be nice to include the XML mechanism from the start. This way the addons or repository wont need to be changed later if we do add such support, and in the mean time this information can at least be displayed to the would-be downloader.

It really doesn't seem to be there

can anyone else verify that the pine woods tileset in vbros 1 is broken?

Glest had a bug with file name matching, it's not inheriting it from anywhere, it's just matching a different texture (probably surface2.bmp if there is one, else maybe surface2a.bmp).

There error is indeed in the mod, not GAE.
Title: Re: integrated mod installer
Post by: will on 25 November 2010, 06:43:38
Yes, I was being very careful to suggest we 'silo' mods - that the mods installed would not be able to implicitly rely upon other content.

Are people comfortable with the zip-folder-with-version-number approach to containing mods?
Title: Re: integrated mod installer
Post by: John.d.h on 25 November 2010, 08:15:29
can anyone else verify that the pine woods tileset in vbros 1 is broken?
I would recommend against using anything from the vbros for testing.  Their "quality assurance" is non-existent, and releases are frequently broken in some way or another (like inconsistent spelling between the file names and XML references).
It has to be a zip file to download though. You can't download an entire folder. It needs to be an archive. 7z is better than zip, and hopefully will be supported in the future.
We've already got 7z in recent revisions, but it only works for some types -- something about solid vs. non-solid, and various other things I don't understand.
Title: Re: integrated mod installer
Post by: titi on 25 November 2010, 09:24:44
I would suggest small steps first and you mix different functions here:

1. GAE update
2. mod download and install
3. download/patching existing mods

I for myself think about only step 2 for MG at the moment. An ingame mod download and installation in MG. Prepared packages that I tested and which proofed to be ok(some how ok ;-) ) will be uploaded manually by me to our webserver. Those mods which are in there are presented in the game and can be downloaded and will be installed.
There should also be a way to remove them. To get new versions of mods you have to remove/install them manually in game ( for the first step )
Downloadable will be maps,tilesets and full techtrees.

Regarding 1. ( updating GAE ) is the most tricky thing in my opinion, especially regarding different platforms. I am curious how this will work! I for myself have no really practicable idea at the moment.

Point 3. might be possible to solve either by using existing code/libs from others or writing something on your own.
Title: Re: integrated mod installer
Post by: will on 25 November 2010, 12:03:14
I have written a very simple test script to see how successfully I can naively detect dependencies in a mod.

Here's the python code; it can just be run in python.

https://gist.github.com/715270

For a taste, here's what it thinks about megapack_v4:

Code: [Select]
...
Ignoring tilesets/autumn/models/grass.tga 768.0 KB
Ignoring techs/megapack_v4/factions/persian/units/elephant_cage/sounds/tech_building_fall5.wav 148.6 KB
Ignoring techs/megapack_v4/factions/elves/units/tree_of_life/construction_models/tree1.g3d 1.1 KB
Ignoring techs/megapack_v4/factions/elves/units/wood_hall/images/wood_hall.bmp 12.1 KB
Ignoring techs/megapack_v4/factions/indian/units/thunderbird/sounds/eagle_fly2.wav 426.0 KB
=== Ignored: 675 121.3 MB ===
=== Included: 4681 587.2 MB ===
=== Models: 922 252.7 MB ===
=== Textures: 1040 183.1 MB ===
=== Particles: 120 83.5 KB ===
=== Sounds: 2360 149.9 MB ===
=== Units: 172 824.1 KB ===
=== Upgrades: 53 34.8 KB ===
=== Resources: 7 1.2 KB ===
=== Fractions: magic, norsemen, dark_magic, indian, persian, elves, tech, woodsmen ===
=== Maps: overgrown_city, tt_goldrush_v2, forest_for_four, waterworld, tropical_arena, domination_isles, one_on_one, conflict ===
=== Tile Sets: evergreen, desert2, winter, autumn, jungle, hell ===
=== Tech Trees: megapack_v4 ===
=== Scenarios: m4_kill_the_magic, m4_my_island, m4_beehive_castle, m4_amazones, m4_norsemen_attack, m4_persian_conflict, m4_indian_attack, m4_waterworld_light, m4_waterworld, m4_magic_can_do_it, m4_amazones_light ===
=== Mod check failed ===
(model BROKEN techs/megapack_v4/factions/persian/units/swordman/models/guard_attacking.g3d (referenced by: unit ../swordman.xml)) ('Error reading G3D file', IOError(2, 'No such file or directory')), ('File does not exist',)
(model BROKEN techs/megapack_v4/factions/tech/units/swordman/models/guard_attacking.g3d (referenced by: unit ../swordman.xml)) ('Error reading G3D file', IOError(2, 'No such file or directory')), ('File does not exist',)
(particle BROKEN techs/megapack_v4/factions/persian/units/worker/particle_splash.xml (referenced by: unit worker.xml)) ('File does not exist',)
(scenario BROKEN scenarios/m4_amazones/m4_amazones.xml) ('References missing map', u'in_the_forest'), ('References missing tileset', u'forest')
(scenario BROKEN scenarios/m4_amazones_light/m4_amazones_light.xml) ('References missing map', u'in_the_forest'), ('References missing tileset', u'forest')
(sound BROKEN techs/megapack_v4/factions/norsemen/units/mistletree/sounds/tower_attack1.wav (referenced by: unit ../mistletree.xml)) ('File does not exist',)
(sound BROKEN techs/megapack_v4/factions/norsemen/units/mistletree/sounds/tower_attack2.wav (referenced by: unit ../mistletree.xml)) ('File does not exist',)
...

I really appreciate modders running it on their own mods and others they are familiar with, and then helping me understand:


Its very easy to run; all you need is python, and know where the mod is (the mod should be in a folder, rather as you would unpack an archive)

The thing is, I haven't found a mod that this script doesn't think is broken!  I've squashed most of my mistakes, and iteratively found most, but now I really need help from expert modders to tidy up the last few things I've got wrong....

(I don't think this script will be used in any real GAE solution, its just a quick way to prototype the logic that might be used, and see if its useful)
Title: Re: integrated mod installer
Post by: wciow on 25 November 2010, 15:55:18
Ok I'll test your new script on my undead mod which i have packaged and running on gae 3.2.

Heres a question: If I have two TC mods which both modify the main_menu.g3d how does gae/physfs decide which one shows up at runtime?
Title: Re: integrated mod installer
Post by: Yggdrasil on 25 November 2010, 16:42:26
I agree with silnarm and titi: First step full installation, next patches and then when we really need it (i doubt it) dependency checking. I don't know any mod which relies on another mod.

@will: What you're writing is a packager which is a nice to have tool. I also think the maintainers of the repository should create or at least double check the packages and patches, not the modders. The modders only create addon compatible archives which can be still downloaded from forum users and installed manually. The repository only contains "final" releases which are usable, no alphas or betas.

One big question we still need to sort out: Do we really want do integrate this addon manager with a menu inside the game? Or is an application outside like the map editor better?

Heres a question: If I have two TC mods which both modify the main_menu.g3d how does gae/physfs decide which one shows up at runtime?
The one first in the search path. The order of this isn't well defined, so it could be different on different platforms.
Title: Re: integrated mod installer
Post by: will on 25 November 2010, 18:51:57
I started this thread, I volunteered to over-engineer a mod installer, so its natural I post most, but I've been trying to get others to lead the way as I'm the newcomer.

From the first post we asked "how we manage mods that add fractions vs mods that use the engine for alternative games..." and its clear that addons/ doesn't do this.  We can of course change addons and bend physfs to our will as it is not widely relied upon yet.

The bit that does seem agreed upon is that these mods will be deployed each as a single archive, using stored ZIP with XY solid compression for download.  And we will have xdelta+XY from the beginning too, since that's not where the bugs will creep in.

I see two types of mod:


To my mind GAE should not be bundled with the existing old Glest game data, but rather pre-installed with a Glest+MegaPackV4 mod in the new mod structure.

Furthermore, I think (2) needs dependency checking from the get-go.  And it doesn't hurt (1) either, since all the mods I've looked at - with the exception of MRise, which is nice and clean - are full of MB of debris and even broken links.

If a (2)-type mod has a scenario with the 'pirates' fraction in it, it'd better list the appropriate mod it is relying upon in the manifest so the downloader can ensure all dependencies are met.  I don't see this as being a stretch goal, I see this as hygiene and not too challenging.

In my dependency prototype I ignored the overriden 'core' files, because we need some agreement on how to handle them.  I think they should go into a set folder within the mod archive, and that it would be much more robust if there was an XML file explicitly saying which artwork overrides whatever rather than an implicit naming system.

Regards integration, I think that mod makers should be releasing early and often, even if their audience is their co-conspiritors and other modders.  I think the system should be full of small incremental releases to 'alpha' mods, and that a mod should have a 'stable?' flag when its uploaded so we know whether to only show it to players who have elected to see the bleeding edge.

And on the client-side, I imagine a stand-alone wx-widgets app that does the downloading.  From the beginning the downloader code however should be in the shared lib, with the full intention of eventually bringing it into the game UI.

In the game UI, there should be a top-level menu option for selecting between (1) mods, which naturally swap out all the UI artwork.  The most-recent choice is remembered.  But in the new game screen, if the 'advanced' check-box is checked, you can pick and mix between all installed fractions, maps, tilesets etc.

Its natural people are apprehensive of such naked ambition, but is any got any fundemental against the direction its going in, or is it just seeming to go too fast?
Title: Re: integrated mod installer
Post by: Omega on 25 November 2010, 22:31:29
My two bits:
DEFINATELY a separate program, as I mentioned before. The first step might simply install the mods as a GAE addon (after all, that's as simple as copying the downloaded file to the addons folder. I would think the hardest thing to do is to locate the addons folder (again, I think it should be declared in the INI). After all, if you try to just install where the addons folder defaultly is, you'll just miss out everyone who has modified this (such as me. I don't like programs spreading files all over my computer, and prefer it one place, so I placed the config dir to be the same as the install dir). The simple solution would be to check if the folder exists in the default install location and if it doesn't, check for it in the install directory, and if not there, ask the user to provide its location (if you had the skill to manually change the location, you must know where it is). There should also be a setting (such as a separate ini for this program) to provide this location, incase the auto-detect fails (ie: the folders exist in the default location because they weren't deleted after changing the config dir location).

GAE should NOT be bundled with the Megapack, for one simple reason: It's too darn big! I'm always a few versions behind on MG, and if there's no binary only version uploaded, I don't even download until there is.

As for what we should start as, I think we should start very simple. Download the mod and install it for GAE only, since it's the simplest to do. Then we can expand it so it can install MG and Vanilla Glest as well (if MG has an alternative to the addons folder, extract there. Vanilla will just have to extract it in the install directory). Later, we can impliment a dependancy searcher (which should just *tell* the user they need to also download so and so, not force it, since they could have so and so available from a different source (ie: downloaded it a long time ago or have it for a different engine). As the most ambitious part, an update system should be saved for LAST.

Another thing that would be nice AFTER the update system (aka: the grand finale) would be a way to update the engines themselves, while preserving mods. Obviously this may not always be possible if you move folder locations (but, hopefully you won't move folders). Biggest problem is that engines usually install to a folder that has the version number (thus, you can have GAE 0.2.12 and 0.3 both installed), so it may have to just be an installer, unless the updating would only be allowed for minor versions (ie: GAE 0.3.x can update, but once 0.4 is released, you have to do a full install).

You're fully welcome to program it will. We welcome new comers here (weren't we all one at one point?) and I personally think it's great you are getting involved in helping Glest! :) I can't program well outside of Web design anyway.

Biggest problem: getting modders to package their data the correct way... I have yet to see more than a tiny handful of people do so...
Title: Re: integrated mod installer
Post by: will on 25 November 2010, 23:28:30
update: a log from megaglest with vbros 1 along side: https://gist.github.com/716064

Is this stuff really broken?

E.g. does egypt's air_pyramid really reference technician/sounds/technician_ack1.wav, is it really missing, and what does G/MG/GAE do when sounds are missing?
Title: Re: integrated mod installer
Post by: ChupaReaper on 25 November 2010, 23:29:00
I like the sound of this and would fully package my mod to work with it. Pause/Resume downlaods would be very important for big projects too and also it would be cool if the update was also a launcher that could adjust the gae config and also launch the game with a nice fancy big Launch button or something. This updater should eventually support fancy graphics too at some point.
Title: Re: integrated mod installer
Post by: ultifd on 26 November 2010, 07:40:51
GAE should NOT be bundled with the Megapack, for one simple reason: It's too darn big! I'm always a few versions behind on MG, and if there's no binary only version uploaded, I don't even download until there is.
Well, I guess it is kinda big, but not that much...and I guess you download each version of MG then, cause with each version there is always a binary only version...  :|  ;)
Title: Re: integrated mod installer
Post by: silnarm on 27 November 2010, 02:49:52
Regarding 1. ( updating GAE ) is the most tricky thing in my opinion, especially regarding different platforms. I am curious how this will work! I for myself have no really practicable idea at the moment.

This was discussed a while ago on the mailing list, we decided we would do nothing for linux, or at most a 'notifier' (ie, 'A new version of the engine is available, ...') to point them at a download link, or tell them to update through their package manager.

I've done a little research for the Windows side, and have found GUP (http://gup-win32.tuxfamily.org/) to be a likely candidate, no idea how this should/would work for Mac.

But this will not be step 1 ;)

To my mind GAE should not be bundled with the existing old Glest game data, but rather pre-installed with a Glest+MegaPackV4 mod in the new mod structure.

GAE will continue to ship with a modified magitech, and nothing more. Maybe one day an extended magitech (Dark Magic?) or with a revived FPM.

Quote
Furthermore, I think (2) needs dependency checking from the get-go.  And it doesn't hurt

We generally prefer an iterative development model, I would personally like dependencies listed from the get-go, but in the 'first iteration' only so they can be reported to the user.

Quote
In my dependency prototype I ignored the overriden 'core' files, because we need some agreement on how to handle them.  I think they should go into a set folder within the mod archive, and that it would be much more robust if there was an XML file explicitly saying which artwork overrides whatever rather than an implicit naming system.

See suggested manifest xml below...

Quote
And on the client-side, I imagine a stand-alone wx-widgets app that does the downloading.  From the beginning the downloader code however should be in the shared lib, with the full intention of eventually bringing it into the game UI.

I think we are all agreed here then, separate app, maybe integrate into the game down the track...

Quote
In the game UI, there should be a top-level menu option for selecting between (1) mods, which naturally swap out all the UI artwork.  The most-recent choice is remembered.  But in the

This is already planned, #209 (http://sourceforge.net/apps/trac/glestae/ticket/209)

So, we need a 'manifest' type file for each addon, I don't think this needs a lot of information though, and certainly not a complete actual manifest ;)

A possible system,

For Chuppa's situation there would be, mrise_core.zip/mrise_core.xml :
Code: [Select]
<manifest type="core-data" name="malevolent_rising" version="1.6">
<!-- This pack contains custom tilesets and maps, turn default stuff off -->
<default-data>
<techs value="false" />
<tilesets value="false" />
<maps value="false" />
</default-data>
</manifest>

The type='core-data' would identify it as a TC, and the new addon menu will only ever allow one or zero TCs to be turned on, when turned off any other addons that depend on that addon will also be unmounted.

Chuppas factions would then have something like, mrise_necribus.zip/mrise_necribus.xml :
Code: [Select]
<manifest type="content" name="necribus_faction" version="1.6">
<dependencies>
<dependency name="malevolent_rising" version="1.6">
</dependencies>
</manifest>

Maybe something extra to 'link' it with malevolent_rising might be good, so it is automatically mounted with malevolent_rising, and there should be a description element in there somewhere.

If all addons that go in the repo are required to have such a manifest, the repository.xml could even be auto-generated by scanning the addons.
Title: Re: integrated mod installer
Post by: will on 27 November 2010, 10:20:07
Here's a start: https://forum.megaglest.org/index.php?topic=6207.0
Title: Re: integrated mod installer
Post by: ChupaReaper on 30 November 2010, 02:44:23
With what Silnarm said:
<dependency name="malevolent_rising" version="1.6+">
+ or something like that should also be allowed, in case I have core_files 1.7 but all the factions are ok at 1.6 still.
Title: Re: integrated mod installer
Post by: will on 30 November 2010, 12:59:53
At the moment my mod packer puts some xml in as a zipfile comment.

I think I'll change it so that it writes a /glest-mod-manifest.xml to the mod file describing the dependencies.

If the modder provides a /glest-mod-manifest.xml then it will be sensibly merged with the dependencies that the mod-packer finds.

I like that on many platforms that use version numbers, 'major' version number changes introduce incompatibilities but 'minor' versions do not, so therefore the tool can believe that something depending on mymod.1.2 can work with mymod.1.3 but not mymod.2.1

The tool is coming along nicely, I'd ask everyone to kindly test it and give feedback.
Title: Re: integrated mod installer
Post by: will on 9 December 2010, 06:32:36
So we have a mod packer script that basically seems to work, and does a tidy job.  Its a python script, but its serviceable.

The mods are more like classic glest extensions as opposed to total-conversions, and the distinction is something that will need GAE code changes with the TC picker work.  I say that TCs are version 2!  The immediate goal is to repack all the classic glest extensions and get them hosted on a website so we can test the packing and downloading part.

There are two directions to now work in:


Of these, the second seems to depend on the first, so right now we need a website.  So who wants to help on the website and how do we go about hosting?
Title: Re: integrated mod installer
Post by: silnarm on 9 December 2010, 09:13:38
The mods are more like classic glest extensions as opposed to total-conversions, and the distinction is something that will need GAE code changes with the TC picker work. I say that TCs are version 2!

GAE is quite actively developed, the support required for this would not take long to implement.  Either or.

Quote
Of these, the second seems to depend on the first, so right now we need a website.  So who wants to help on the website and how do we go about hosting?

I can arrange a dedicated server when needed, but we can probably just use sf for now. I know they allow quiet a bit in the 'web services' department, and PHP we can definately run from glestae.sf.net, not sure on if/where we can write uploads to. I'll check again what we have available, and mail the sf ppl if needed.  In the meantime, sign up on sourceforge and mail me your username.

Edit:  misuse of quiet.
Title: Re: integrated mod installer
Post by: hailstone on 9 December 2010, 10:45:41
I might be able to offer my paid web hosting which has python support if other arrangements aren't possible.