by Baker » Sat Sep 25, 2010 4:14 am
I'm going to draft up quickly a blue print for writing a mod installer for the Quake engine here and post the code as I implement it.
I have this all written in my head and in notes, but I won't have the kind of free time to code it until Monday or Tuesday.
Features:
1. Basic GUI menu system with a basic graphical interface. To keep this simple, we will use hotspots and just track the mouse release event and feed it to the menu system.
2. We will use R00k's HTTP Download which was derived from Warsow. Ironically, the code is going to resemble FitzQuake's SCR_ModalDialog in many respects. Unlike R00k's server implementation, to keep this simple we will have mod downloading have exclusive control of Quake while it is occurring, with a cancel button.
3. We need to draw the menu and allocate the textures because I think it is important to keep interfaces graphical. So we will be using external media (similar to JoeQuake-like engines that reserve a few texture slots for, say, QMB water caustic textures and such).
Since I want to keep this initial version simple:
1. No scrollbars in the GUI. It isn't that scrollbars are hard, they aren't. I always screw up and write them 1 pixel off somewhere in 3 different places and spend the next 24 hours combing through to figure out where I foobared it.
An additional reason, the simple implementation in my head clearly has the currently selected mod visible on-screen. With a scrollbar, the selected mod might be moved off the visible portion of the screen.
2. Let's keep it to a finite set to mods. I'm going to draw the arbitrary line at 30. We will need a simple "database" to tell the engine certain characteristics about the mod. Like gamedir name, startup parameters.
Now since we will need to store that, we might as well make it fun by keeping track of the number of times it has been played. I think would also be cool to keep track of completed mods ... but that can't really be achieved correctly in engine code unless you want to track when a changelevel is called from whatever the final map of a mod is.
This will require an existing implementation of gamedir switching in an engine.
Finally, we'll need a way to unzip the downloaded mod archive and install it. I'm going to opt for using the method JoeQuake uses to play Dzip demos ... which I have modularized into some system code (which happens to be Windows only, which I hate, but reality is that most users are using Windows by far). This is the sole operating system specific Achillies heel in this and I wouldn't mind any good suggestions that don't require a complete memory system rewrite. (Does EZQuake's zip support work on compressed .zip files or just uncompressed ones? I'll have to check).
The night is young. How else can I annoy the world before sunsrise?

Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..