Shandalar Deck Injector
The Shandalar Deck Injector is a small Java program I put together to facilitate the easy creation and use of your own decks in MicroProse's Magic the Gathering: Shandalar. It also allows you to edit a couple of in game stats, namely food and gold.
If you like this tool be sure to check out CirothUngol's Shandalar SVE Tool at the SlightyMagic forums. It performs everything the Shandalar Deck Injector does and more! And particularly importantly it is kept up to date with all the awesome updates being completed by Korath.
Current State (Last updated - 07 May 2012)
I used to pick this game up every now and then and have a play through for a couple of hours but then I found myself getting less and less interested in the actual game and more interested
in the format it used to save its data. I was particularly interested in the difference between the save format used for decks created in the Duel program and the way they are saved in the
saves files from the Shandalar games (these saves are the MAGICX.SAV files where X is a number starting from 4).
A quick comparison between 2 saves, save 1 having the deck you start with and save 2 having the same deck but with a couple of cards sold, quickly turned up where the data was being stored. Then came the long and arduous task of systematically changing the save data to see what resultant cards were in the deck when the game was loaded back in.
Thankfully by this time I had signed up to the Shandalar forums on SlightlyMagic.net where I got talking to someone else who had done a lot of work on this game, Snacko. He was kind enough to share a .dat file he had extracted from the game containing the offsets of all the memory addresses for the cards in game. Thanks to him I was able to save hours, even days of work by combining this data with the information I had already gathered giving me the relationship between cards in Duel saves and cards in Shandalar saves.
After that it was just a case of writing a program to read bytes from the Duel game save and write them into the Shandalar save and the first version of the deck injector was born. With the core functionality complete I then went on to add some polish: injecting into any of the 3 deck locations, reusing cards already held by the player, not overwriting cards already held and the ability to export decks from the game.
Once this was done (and whilst I was doing it) I decided to explore the save data a little more and found some more interesting things such as the location of gold and food and also the storage location of the amounts for each of the different coloured amulets. I also learnt a lot about how health was calculated and sadly it isn't as easy as just a single variable but it is tied closely into the amount of manalinks that the player has which in turn are tied into the town data which is all over the place!
As part of my final release of the deck injector I changed about the layout a little and added an additional tab for the player's stats where I made it possible to edit the amount of food and the amount of gold the player was carrying. At this point I decided to also release the source for the project as I was ready to take a break from it and wasn't sure if I would ever return to it.
After several people contacting me about the injector I decided to return to it to fix a couple of problems. It turns out the deck builder program allows you to create decks with some cards that aren't available in Shandalar (presumably they can be used in Manalink). It doesn't stop the program working but it means if you try to inject these cards it won't manage and it won't tell you why. Sadly it is way too much work for me to add the cards to the game so the best I can do is add an error message letting you know it can't be used.
It also turned out the World Magic check boxes weren't working properly, which I fixed, although checking the Tome of Enlightenment doesn't actually raise your card allowance so there must be something else I need to do to get that working.
Finally I added in the ability to alter the amount of amulets you have.
|A short instructional video I made during the early stages of the project showing how to use it. The layout has changed a little and there are more features now but the core instructions remain the same.|
Want To Know More?
If you want to know more about this project I recommend posting in my topic in the Slightly Magic.net forums or you can email me using the details in the About page.
DeckInjector.zip - The jar file and source files for the project. Just double click to run, assuming you have Java installed which everybody should!