Map splitting and Photoshop

Discussion in 'General Modification' started by marc1967, Apr 26, 2014.

Remove all ads!
  1. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    I tried to us the 2D Map splitter and recombiner today, and the process itself worked flawlessly; it's an impressive tool. However, I had problems with the photoshoped images displaying in the game. After recombining, altering, and then splitting them again, all the split images looked just fine when I viewed them in the art folder. But... when they were displayed in the game, they were all totally black. The mobile and static images were still fine, and the game played correctly.

    I traced this back to how photoshop saves the .jpg files. I loaded a combined map into photoshop, made no changes at all, and just saved it. The same problem with the map being all blacked out in the game occured.

    I noticed that the file size was different from the original, so photoshop IS altering it somehow, even though I made no changes to the jpg.

    How should I save the combined map from photoshop? There are a number of options when saving, and I'm probably picking the wrong ones. ("Image Quality", "Format Options", etc.)

    I'm sure some of the map builders here have been through this and can advise me.

    Specs:
    Adobe Photoshop Version: 14.2.1 (14.2.1 20140207.r.570 2014/02/07:23:00:00) x32
    Operating System: Windows 8 64-bit
    Version: 6.2 ​


    EDIT: I figured out the problem, but could still use guidance. Apparently when the map is split back up, it gives all the files different names than they originally had. Is there a feature I'm missing that gives them them back their original names, or do they need to be renamed manually?

    The original names are 001D001B.jpg - 00290026.jpg, and the files that get created are also 8 digit hex looking numbers, but the first 3 digits are all 000.
     
    Last edited: Apr 26, 2014
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I'm not entirely following your process here but the WB splitter will do all that for you if you use it properly.

    Nothing Photoshop does will have an affect on whether the images display or not, assuming you're making jpegs (which the game requires). Bit depth doesn't matter, PPI/DPI doesn't matter, etc. If the game isn't displaying the images, it's because the chunk numbers are wrong (like you mentioned), the map ID is wrong (the hex value that points to the map's numbered entry in modules/ToEE/art/ground/ground.mes), or the modules/ToEE/art/ground and modules/ToEE/maps folders don't match up name-wise.

    Here's what I do to make a new map:

    1. Recombine an existing ToEE map that has the dimensions you want using the WB recombiner. This will provide a working template for your map, including an associated text file with two numeric values that tell the splitter tool how to split the map and name the chunks. Without this, you'll get wrongly named chunks after splitting that won't display properly (will just show black).
    2. Put your new/original map image over the recombined map in Photoshop and save it.
    3. Name the image exactly what the map's name is in maplist.mes. If you have different day/night maps, append -day and -night to the names.
    4. Run the splitter tool on the image. The tool should know how to split the image and name the chunks from step 1.
    5. Move the chunks into a folder named exactly the same as the image you're splitting and put it in modules/ToEE/art/ground.

    The map should display properly, but I'm assuming you've followed all the other steps in getting a map to work as detailed in the sticky thread in the maps and textures forum here.
     
  3. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Everything is working fine, with the exception of the names of the split files being wrong. I must be missing something obvious that is staring me in the face, but I can't get them to rename properly. Ignoring photoshop, let me give you a really simple example:

    1) I recombine the files from C:\Temple\modules\ToEE\art\ground\map-24-vign-neutral. It works perfectly and outputs these 2 files:

    C:\ToEEWB\2D Maps\map-24-vign-neutral.jpg
    C:\ToEEWB\2D Maps\map-24-vign-neutral.txt (which has the numbers 29 and 27)

    2) I split them (selecting the jpg file above). It outputs all the file chunks perfectly to the folder:

    C:\ToEEWB\map-24-vign-neutral

    But the files are named wrong (00000000.jpg, 0000000A.jpg, 0000000B.jpg, 000A0000.jpg, 000A000A.jpg, 000A000B.jpg, etc.)


    I know once I figure this out I'm gonna give myself a big V8 slap to the forehead.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Is your step 1 getting the chunks to recombine from TOEE1.DAT or your game installation? The TN vignette hasn't had any override work done so it doesn't exist in the modpack to take chunks from, and there should be none in the vanilla game. I always recombine maps from the DAT.
     
  5. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110

    I've tried both now. Originally I was working from Temple\modules\ToEE\art\ground. This was an exact copy from Temple\modules\ToEE.dat\art\ground. I put in there to work on so I wouldn't mess up the original files, but I've tried from both place just to be sure. I also tried with three other maps, with the same results - everything is fine except for the names.

    I'll give this one last stab at explaining, with the step by step process I follow, and if the mystery can't be solved I'll just move on to other stuff. There's so much to learn here. Thanks for all the help Gaear.


    First I recombine...

    1. Start ToEE World Builder.

    2. Click on 2D Maps tab.

    3. Click the "Recombine" button in THE BIG MAP section, and it asks for "ToEE Map JPG Constituents".

    4. I navigate to \Temple\modules\ToEE.dat\art\ground\Map-24-vign-neutral and select the first file on the list. It's called 001D001B.jpg. Click "open". (This part is a little odd, as it asks for Constituents, plural, yet it only lets you select one file from the folder.)

    5. World Builder message box says "Built a combined image: map-24-vign-neutral.jpg".

    6. The combined image file called map-24-vign-neutral.jpg is created in \ToEEWB\2D Maps\, and it's perfect. Another file called map-24-vign-neutral.txt is found along with it. It contains two lines. The first line says '29', and second line says '27'.

    Now to split it...

    7. Click the "Split" button in the BIG MAP section of World Builder, and it asks for "ToEE Map Combined Image"

    8. I navigate to \ToEEWB\2D Maps\ and find the combined image I just made moments ago called map-24-vign-neutral.jpg and select it. Click "open".

    9. World Builder message box says "Splitting complete."

    10. The split images are in a folder called \ToEEWB\map-24-vign-neutral. All the files look perfect in terms of image quality, but they are not named properly.
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Okay, I reenacted all your steps exactly and the splitter named the chunks correctly (001D001B, etc.). The fact that in your case it's starting with 0000000 means that it's not reading instructions from the text file (in which case I think it just assumes numbers start with 0 and go up). So we have to figure out why it's not reading the text file.

    Do you have file extensions visible in Windows Explorer? If not, and if it's still listed as 'filename.txt,' that means it's actually called 'filename.txt.txt,' which would likely confuse the OS and cause the splitter to disregard the file. I'd check to see if extensions are set to visible or not and then verify what the file is called with and without. It should be 'filename' without and 'filename.txt' with.
     
  7. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    The comedian Gallagher once said something to the effect "Do you ever lose something and you can't find it, and after a while you start looking in places you just know it ain't gonna be". Or was that Carlin? Anyways, I've reached that stage and I'll put this aside for now. Thanks for all the time trying to help me.

    Yes I have file extensions visible. Also, this morning as a last ditch effort, I reinstalled Temple from scratch, installed Co8 8.0.1, and reinstalled World Builder. The files still won't name right. I'll put this aside for now, and maybe something will come to me in my sleep or whatever.

    The great news is that the other 999 features of World Builder are working just fine and I'm having a grand ole' time modding away, so I'm gonna just let this be for now. :thumbsup:
     
  8. sirchet

    sirchet Force for Goodness Moderator Supporter

    Joined:
    Dec 6, 2003
    Messages:
    3,721
    Likes Received:
    49
    Maybe try making the extensions not visible just for testing purposes.
     
  9. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Well I finally stumbled upon the solution by blind luck.

    The txt file with the two numbers needed to be put directly into the C:\\ToEEWB directory. The recombiner was dumping it into C:\\ToEEWB\2D Maps, along with the jpg. I should have thought of this earlier since that's the default location where WB reads files from, like protos.tab and descriptions.mes. Thanks for pointing me to the source of the problem which was the txt file.


    So now... back to my task of getting the Innkeepers dog to lie prone sleeping by the fireplace at night, and wandering friskily about the Inn during the day. I tried the following command in san_first_heartbeat(), but Fido immediatly stands up when entering. I guess the default reaction for creatures is to stand up.

    attachee.condition_add_with_args( "prone", 0, 0 )

    It would be neat to have all the villagers lying in bed at night too, just for flavor.
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Perhaps setting one of the NPC / Critter property flags (e.g. OCF_PARALYZED) could prevent him from getting up.

    This, however, would be a good time to warn about the slippery slope of adding more features. I don't presume to know your intentions, but I wouldn't go there if you don't see yourself modding this game for the next several years.
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I bet the paralyzed flag would make them get up and then stand stock still - that's what's usually happened when I've tried it for whatever reason.
     
  12. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    I fiddled around with all the flags that seemed could potentially get the job done, including OCF_SLEEPING, OCF_PARALYZED, among others. But they all seemed inconsistant, and would just freeze him standing up as you mentioned. But this seems to do the trick.

    Code:
    def san_first_heartbeat ( attachee, triggerer ):
    	if ( is_daytime() == 0 ):
    		attachee.condition_add_with_args( "unconscious", 0, 0 )
    	return RUN_DEFAULT
    
    The only problem is if combat starts up he stays unconscious unless attacked. Bad dog! I guess I could make an invisible npc that triggers and casts a cure spell on him when combat starts, which will rouse him. But it's not that necessary.
     
Our Host!