Author Topic: Recreate .MAP files  (Read 5854 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Recreate .MAP files
« on: January 17, 2012, 09:38:18 PM »
Along with some of my latest development work, I've created a new tool to recreate a .MAP file, given an input set of RESOURCE.XXX files.  Not sure how useful this is, but maybe someone out there has a corrupted map file & needs to recreate it.

This should work against all SCI0 games (games found here as well as Sierra games) as far as I can tell.

I've uploaded it in this post as well as to the wiki.


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Recreate .MAP files
« Reply #1 on: January 18, 2012, 12:16:44 AM »
I don't have Perl installed on my system. Can this be compiled into an EXE? Now if I had a stand alone tool to add and remove resource files to a RESOURCE.XXX file, too.
KQII Remake Pic

Offline gumby

Re: Recreate .MAP files
« Reply #2 on: January 18, 2012, 09:05:06 AM »
I'll compile it when I get home.  In all honesty, I already had everything I needed from my textDumper tool and I just ripped it out the relevant pieces & cleaned it up a bit. 

As for adding & removing resources, the textDumper tool does exactly that - just specialized for text resources.  I should be able to manipulate it to allow for any resource.  Probably need to start with an 'inventory listing' tool so that the user is informed about which resources are in a resource file.  Maybe a menu-driven interface or something.

In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Recreate .MAP files
« Reply #3 on: January 18, 2012, 09:00:19 PM »
Compiled and added into zip.  I must mention as always that compiled Perl scripts are slow to 'start-up' and it took over 10 seconds to do anything on my machine when I tested it.  Wiki is updated with new zip as well.

Edit:  I keep getting timeouts trying to upload the file (about 4 megs).  It's here: http://sci.sierrahelp.com/download.php?file=Files/Gumby/recreateMapFile.zip

Cloudee, is there some other way I can get this over here?  I'll try to upload it as a new game.
« Last Edit: January 18, 2012, 09:08:09 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Recreate .MAP files
« Reply #4 on: January 22, 2012, 08:42:27 AM »
Found a pretty severe bug that came up in testing this tool.  The last byte of each 6 byte entry was wrong (it was always zero).   The is the byte that indicates what resource file (RESOURCE.001, RESOURCE.002, etc) the game resource is in - so valid values are 04, 0C, 10, 14, 18, etc - corresponding to 001, 002, 003, etc.  These values of the resource file #s are packed into the left 6 bits of the byte.

I've re-compiled & packaged it up.

Another note:  It is interesting how Sierra MAP files are put together.  Sierra put commonly used resources in many of the resource files, to prevent disk swapping.  When looking at their MAP files, they put all the same resource references together.  So if a resource was packed into 4 difference resource files, the MAP entries would all be placed together.

This tool creates the MAP by going through each resource file linearly, so all the resource.001 MAP entries come before all the resource.002 entries, and so on.  Essentially, the MAP is built in the order of how the resources appear in the resource files, in directory listing order.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Recreate .MAP files
« Reply #5 on: January 22, 2012, 02:00:43 PM »
Sierra used to duplicate some AGI resources across disks for the multi disk games, too. Of course, this would have been not needed as badly on machines new enough to run SCI games. A higher percentage would have had hard drives than in the AGI era.
KQII Remake Pic

Offline ViolentValence

Re: Recreate .MAP files
« Reply #6 on: September 10, 2012, 11:19:20 PM »
I'm needing the advice of Gumby & company, of all you helpful SCI types.

I've managed to make my resource.001 file disappear, through a combination of having to minimize a running instance of my game (I was caught in an infinite loop of gProgramControl remaining permanently TRUE), and, inexcusably, attempting to compile my scripts without realizing the game was still running in my taskbar (win XP.) The resources seemed to be wiped, 'repair resources' produced an error (I'll see what I can do about finding it, is there a log for those?), and the resource.001.bak file became a sturdy 0 bytes, and backing up a file that seems to have never existed.

Does the compiler have some kind of temp, phantom place it may have ferreted it away to?

SO very much work at stake. Eternal gratitude, my firstborn's name, cashmoney for any leads.

 P.S. keep up the fine work!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.038 seconds with 22 queries.