Latest Diablo 3 News
DiabloWiki Updates
Support the site! Become a Diablo: IncGamers PAL - Remove ads and more!

Creating a version switcher.

Discussion in 'Single Player Forum' started by Thorham, May 11, 2008.

Thread Status:
Not open for further replies.
  1. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Creating a version switcher.

    After making two scripts to run two versions of the game, I found out, that if I wanted to add more versions, such as Median 2008, or just plain old 1.0, I would have to update all the scripts and make another one for each added version. So I decided to write a version switcher in freebasic.

    At this point the program is only really suited for self-use, however, if there are any people who would like the idea of a fully featured program, I do intend to make a proper program out of it. Which leads me to the following question: What are the file differences between the versions? This includes the differences between LOD and non-LOD. I suspect that none of the larger files are different, and that most of the differences are in the dll files, but I'm not sure, so any pointers are much appreciated.

    Just in case anyone wonders: The current version just renames copies of the Diablo II folder to the original name. This is nice and clean (no messing with the registry, each version has it's own save folder), but currently requires that each version has it's own folder with all the files present.

    Just one more thing: If anyone has any ideas for features for this program, feel free to post them here.
     
  2. silospen

    silospen IncGamers Member

    Joined:
    Feb 16, 2004
    Messages:
    3,512
    Likes Received:
    0
    Trophy Points:
    255
    Re: Creating a version switcher.

    Of course all the larger files are different, what do you think they contain :p

    MPQ = Big zip file (essentially) containing all game data. Depending on the MPQ, these are different between releases.

    If you're on *nix, do a diff and find out for sure.



     
  3. Peppe

    Peppe IncGamers Member

    Joined:
    Nov 3, 2004
    Messages:
    330
    Likes Received:
    0
    Trophy Points:
    122
    Re: Creating a version switcher.

    You might check what trenshadow did for his version switcher scripts.
     
  4. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    Yes, I suppose I could do a diff. Good idea. I can just write one myself. Although it means I'll have to do a reinstall of the game, it does mean I can find all the differences for all non-lod and lod versions (if all the patches are still available).
    I actually have! Trenshadows version switcher moves the smaller files, such as dll files around, and leaves the large mpq files alone (as far as I know). The problem is that I want my version switcher to work with all versions, while trenshadows switcher apparently supports only the most played versions (which makes sense. but I want completeness).
     
  5. Thyiad

    Thyiad Moderator Single Player, D2 Assassin, Barbarian

    Joined:
    Mar 3, 2006
    Messages:
    15,295
    Likes Received:
    204
    Trophy Points:
    488
    Re: Creating a version switcher.

    For median I made a Median directory inside the D2 directory which contains only the .mpq and doc files. I then made a separate shortcut on the desktop which starts in the median directory. The same as I have for the vanilla installation.
     
  6. silospen

    silospen IncGamers Member

    Joined:
    Feb 16, 2004
    Messages:
    3,512
    Likes Received:
    0
    Trophy Points:
    255
    Re: Creating a version switcher.

    Read the scripts again, they move around MPQs too.
     
  7. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    Thanks! Thats quite interesting. I had no idea that would work. Guess it's time for a re-install and try out various methods of running different versions, and pick the best one.
    Done. After searching through the scripts, patch_d2.mpq seems to be the only one that gets moved around, and that mpq is quite small. Unless I missed some other mpqs, it should be possible to switch versions without having to copy the large mpq files.
     
  8. silospen

    silospen IncGamers Member

    Joined:
    Feb 16, 2004
    Messages:
    3,512
    Likes Received:
    0
    Trophy Points:
    255
    Re: Creating a version switcher.

    You might want to double check on that for classic. I suspect classic doesn't use some of them and probably modifies some (maybe D2 char/music/speech/video/etc) as it doesn't have act5 and the 2 extra classes :)

    I hadn't looked at the sizes, I usually play around inside the MPQs, so it had slipped my mind that patch_d2 was only small.



     
  9. Hrus

    Hrus IncGamers Member

    Joined:
    Jul 6, 2003
    Messages:
    7,279
    Likes Received:
    1
    Trophy Points:
    346
    Re: Creating a version switcher.

    I just want to remind you, that Tren-Shadow version switcher scripts can run more versions of the same game as well as different mods. Just to save your time if you don't know that the version switcher already exists. I use it myself for running mods (median) or older versions (1.09).
    BTW you can run classic character from Expansion version - when creating the character, you just tick the classic box...
     
  10. silospen

    silospen IncGamers Member

    Joined:
    Feb 16, 2004
    Messages:
    3,512
    Likes Received:
    0
    Trophy Points:
    255
    Re: Creating a version switcher.

    Ack, I had forgotten about that tickbox. I play 1.09 classic, so it's a different install and doesn't have expansion included :p



     
  11. moo-cow

    moo-cow IncGamers Member

    Joined:
    Jul 3, 2003
    Messages:
    817
    Likes Received:
    0
    Trophy Points:
    120
    Re: Creating a version switcher.

    this seems like an ok thread to hijack my question into. if I take my D2 full install and delete the cinematic files will it in essence downgrade to a "multiplayer" install and free up some 600 MB or just crash on me randomly.
     
  12. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    Yes, I'm going to do that. I've already reinstalled the game, and I'm going to patch it using all the patches I've downloaded from frozenkeep (24 patch files :shocked:), and check the large mpqs for differences. Hopefully none of them change...
    My version switcher is actually a version launcher, where you run that and press a number key to run the version assigned to that key. The whole idea is to make it a good looking and easy to use program (current version is just for personal use), where the user just needs a single Diablo 2/LOD installed and my program does the rest, including handling different mods.
    Yes, you can. I just now reinstalled the game, and renamed the cinematics mpq, and it works fine as far as I can tell.
     
  13. Hrus

    Hrus IncGamers Member

    Joined:
    Jul 6, 2003
    Messages:
    7,279
    Likes Received:
    1
    Trophy Points:
    346
    Re: Creating a version switcher.

    Tren Shadow version switcher uses only one installation of your D2 and then includes all "moddable" dlls in the special directories. That's exactly what you want? It doesn't have the selection menu, but you can easily just take Tren Shadow version switcher and create the selection menu of your own.



     
  14. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    You're right, that's exactly what I want in terms of switching functionality. However, I don't want to mix freebasic code (which is compiled) and vb script, and besides, the selection menu is by far the most work anyway! Really, the actual switching is very simple code, and very small, too. Not a lot of work at all, and programming is my hobby, so I don't really see it as work :smiley:

    What I want for the menu is the animated diablo logo, the menu graphics and fonts for the gui, the animated diablo mouse pointer, enable setting of command line options (for windowed mode and completeness), some sort of mod installer, have all patch versions for plain and expansion available and maybe use a different switching method (if I can come up with something). As you can see, the actual version switching is only a very small part of the program, so it's no work.


     
  15. Hrus

    Hrus IncGamers Member

    Joined:
    Jul 6, 2003
    Messages:
    7,279
    Likes Received:
    1
    Trophy Points:
    346
    Re: Creating a version switcher.

    As a reminder, with some large mods which change a lot in the game, some other files than patch_d2.mpq including most of dll files could be changed/modified.
    IIRC some dlls also changed from 1.09 to 1.10.



     
  16. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    Thanks for the info :thumbsup: I'll be sure to check a whole bunch of mods to know what they do, and make the program handle them properly. I'll also have to install all versions, and make a program to check for the differences automatically. This is because there are mpq files other then just patch_d2.mpq that can change from version to version. One is (obviously) the character animation mpq, which is smaller in v1.0 then in v1.07 lod. I've tried v1.0 with the v1.07 lod, and it seems to work properly, but you'd have to play through the entire game with all chars to be sure. It all may sound a little ambitious, but it's not hard, just a little time consuming, and it would be a cool program to have.


     
  17. muzzz

    muzzz IncGamers Member

    Joined:
    Apr 10, 2006
    Messages:
    2,421
    Likes Received:
    0
    Trophy Points:
    165
    Tren's can work with any mod or version. It only comes pre-packaged with popular versions, but you can add versions manually. Just copy/paste one of the subdirs and replace the game files in there with files from an appropriate version/mod.

    If I were you, I wouldn't create an entirely new switcher. Tren's really does all you want it to do (and more), except for the GUI. It would be much less work to scan for directories containing a launchable mod/version, let the user pick one of those from a nice menu, and execute Tren's script in the selected directory.

    EDIT: As for MPQ's, you only need to move around Patch_D2 for versions of LoD*. The same goes for the few mods I've tried. AFAIK, Patch_D2 overrides the other MPQ's. So I don't think there's any reason a sane modder would include more MPQ's.
     
  18. silospen

    silospen IncGamers Member

    Joined:
    Feb 16, 2004
    Messages:
    3,512
    Likes Received:
    0
    Trophy Points:
    255
    Re: Creating a version switcher.

    You forget, it was I who suggested it :laugh:



     
  19. muzzz

    muzzz IncGamers Member

    Joined:
    Apr 10, 2006
    Messages:
    2,421
    Likes Received:
    0
    Trophy Points:
    165
    Re: Creating a version switcher.

    Yeah, I'm glad you usually stick to stuff you understand, like dropcalcs :tongue:

    Forgot the footnote in the above post:
    *) Of course, there is no Patch_D2 for 1.07, so you need to remove it to make that switch.
     
  20. Thorham

    Thorham IncGamers Member

    Joined:
    Jan 20, 2008
    Messages:
    136
    Likes Received:
    2
    Trophy Points:
    42
    Re: Creating a version switcher.

    As long as there are no practical reasons other then spending time on a new program, I'm still going to do it. The bulk of the work is the gui, while the version switching is very simple to do. Also, I want the user to be able to run different versions/mods in different ways (for compatibility), and I don't want to use trenshadows vb script files for four reasons:

    1. Trenshadow uses two scripts. One to switch/launch and one to recover from a game crash, and those two scripts have to be copied for every version used. My launcher doesn't need any scripts, just a single program for as many versions as the user wants.

    2. The scripts change the registry, which to me is a big no-no. My program will do everything by just moving files around.

    3. Offer another choice, as, as far as I know, trenshadows switcher is the only one. People who like trenshadows switcher can just use his/hers, while people who have trouble using it, or just don't like it, can have a look at mine.

    4. Hobbyist programmers do it for fun :rolleyes:

    Thanks for the info :thumbsup: It does seem rather silly to also mod the other mpqs. Blizzards software mod's some of the other mpqs, though, so it's still worth checking out all versions for differences (long, slow process :grin:)
     
Thread Status:
Not open for further replies.

Share This Page