INSTRUCTIONS FOR USING PWHEXE.DAT_EDITOR

1.  GENERAL
The pwhexe.dateEditor will allow you to edit the map data file (pwhexe.dat) associated with the game, War in the Pacific:Admiral's Edition (or AE for short).  Please see the About file for credits, acknowledgements, and disclaimers.  The editor is designed to be fairly simple tool to use but does require some understanding of the way that AE works in order to be used effectively.  The file, Pwhexe.dat_file_format.doc, distributed in this package contains our most recent understanding of the file format of the map data file.  If you wish to edit the AE map, spending some time with this document is a good place to start.  

2.  INSTALLATION
The editor is distributed in a zip file which uncompresses to a folder (pwhexe_editor).  The pwhexe_editor folder contains the editor program plus several reference and ancillary files, such as these instructions.  It is recommended that a separate installation of AE be created and that the pwhexe_editor folder can be placed anywhere in that installation (in the War in the Pacific:Admiral's Edition folder is convenient).  Using a separate installation is a good protection against corrupting your basic AE installation and any ongoing games.  It is also recommended that you backup the pwhexe.dat file in this working installation so that you can return to the baseline, original, file easily.  You also need to make a copy of the pwhexe.dat file you intent to edit and place it in the Pwhexe_editor folder.  This is somewhat cumbersome but deliberate.  It would have been possible to use the Windows facilities for opening and saving files anywhere but the potential for confusion is great!  All pwhexe.dat files, modified or not, have the same file name.  It is up to the user to keep track of what he is doing, using the file modified dates (and other means) to maintain configuration control of his work.

3.  CONTROLS AND DISPLAYS
Upon starting the editor, you are presented with a main screen which has all of the controls and displays provided for working with the pwhexe.dat file.  A brief description of how these work is as follows:

3.1  Pull-Down Menus.
There are three pull-down menus, File, Options, and Help.
3.1.1 File Menu.  The File menu provides two choices, Open and Save.  Open will look for a pwhexe.dat file within the pwhexe_editor folder and load it into RAM, so that it may be edited.  If this is successfully done the File Status indicator will be set to green with a message of:  File Loaded.  Save will take the pwhexe.dat data that is currently in RAM and write it to the pwhexe.dat file in the pwhexe_editor.
3.1.2  Options Menu.  The options menu provides a choice for those portions of the pwhexe.dat that are not directly editable using the combo boxes in the main window.  To put it another way:  Only some of the bytes in the pwhexe.dat file may be edited using this editor, that is , the ones you see in the main window.  There are quite a few SPARE bytes and some for which we do not currently have a good understanding of how they work.  So for these bytes, the normal procedure would be to skip them during the editing process and simply copy the existing data into the new, edited file.  In some instances, a modder may wish to fill these bytes with zeroes.  These options allow you to selectively do just that.  If you wish to have some other values than the existing or zero then you will have to use a binary file editor to work on those portions of the file.  There is a brief descritption of how to do that further along in these instructions.
3.1.3  Help Menu.  This menu allows you to call up these instructions or the About information from within the program.

3.2 File Status Display.
The file status display lets you know when you have a pwhexe.dat file loaded into RAM and thus can edit.  If no file is loaded, the indicator is red and when you load a file it will turn to green.  You cannot perform READ or WRITE operations unless a file has been loaded.

3.3 Location (Start) and Location (Finish) Selectors.
The Location (Start) and Location (Finish) Selectors have up/down inputs where you can type in (or use the up/down controls) to select an X,Y location for READ or WRITE operations.  For a READ operation the Location (Start) values are used to read hexagon parameters to the dispalys on the main window.  For a WRITE(Single) operation, the Location (Start) values are used to write the main window displayed parameters to RAM for the X,Y location indicated by the Location (Start) numbers.  For a WRITE (Multiple) operation, the Location (Start) values are used to write the main window displayed parameters to RAM for the X,Y location indicated by the Location (Start) numbers and then for all of the successive hexagon locations until the Location (Finish), inclusive, hexagon is reached.

3.4  READ button and READ directional buttons
Clicking the READ button will copy the hexagon parameters from RAM to the main window displays for the X,Y location indicated by the Location (Start) control.
3.4.1 READ Directional Buttons.  The six directional buttons that surround the READ button will move the location one hexagon in the indicated direction and perform a read operation.  If you reach the edge of the map it will not scroll any further in that direction.

3.5  WRITE (Single) button.
Clicking the WRITE (Single) button will copy the hexagon parameters from the main window displays to RAM for the X,Y location indicated by the Location (Start) control.  The WRITE operation is also controlled by Options settings (see above) and by the LOCK checkboxes (see below).

3.5  WRITE (Multiple) button.
Clicking the WRITE (Multiple) button will copy the hexagon parameters from the main window displays to RAM, starting with the X,Y location indicated by the Location (Start) control and continuing for successive locations until the Location (Finish), inclusive is written  The WRITE operation is also controlled by Options settings (see above) and by the LOCK checkboxes (see below).

3.6  Hexside Combo boxes.  There are six sets of hexside combo boxes, one for each of the six hexagon directions (E,SE,SW,W,NW, and NE).  EAch set has five combo boxes, one each for Hexside,Road, Railroad,River Type, and Strait Type parameters.  Each combo box, when clicked on, will open up a small window that will allow you to change the current parameter value for that box.  Please refer to Pwhexe.dat_file_format.doc, discussed in 1.0 above, for more information regarding the meaning of each of these parameter selections

3.7  Hexagon Parameter Combo Boxes.  There are twelve hexagon parameter combo boxes. Each combo box, when clicked on, will open up a small window that will allow you to change the current parameter value for that box. Please refer to Pwhexe.dat_file_format.doc, discussed in 1.0 above, for more information regarding the meaning of each of these parameter selections

3.8 Lock Controls.
The Lock checkboxes allow you to selectively edit hexagon parameters.  If a Lock checkbox is checked, then WRITE operations for that parameter are ignored.  An example of how this could be used would be if you desired to erase all Road and Railroad construction across some swath of the map.  You could set all of the checkboxes to Lock (checked) except for the six ROAD and six RR checkboxes.  You would then set the twelve ROAD and RR combo boxes to 00-none and the Location (Start) and Location (Finsih) selectors to the proper span of coordinates.  Finally, you would click on WRITE (Multiple), completing the operation.  The LOCK ALL and UNLOCK ALL buttons provide an easy way to set or clear all of the chceckboxes.

3.9 EXIT Button.
The EXIT button will end the program, after a reminder to save your work.  The window close control (top right corner of the main window) will similarly close the program, but without the reminder.

4.0  Binary File editing.  The pwhexe.dat_editor program does not provide complete control of the values that are possible within the pwhexe.dat file.  If you desire finer control over specific bytes then a binary file editor would be the tool of choice.  There are many such.  I have used the editor, HxD available at 
http://mh-nexus.de/en/.  If you set horizontal display width to 56 bytes then each row will correspond to one of the hexagon locations.

5.0  Feedback.  Comments on the program are welcome.  The best way to get a comment to me is by PM at the Matrix forum.  PM to dwbradley.  Or just post in the AE mods forum.  Positive comments are of course welcome but so are negative ones as that is the best means to improve the program.

Last modified on 11/15/2010

Dave Bradley


