Difference between revisions of "MCDEdit"

From UFOpaedia
Jump to navigation Jump to search
Line 53: Line 53:
  
 
== PCK editor ==
 
== PCK editor ==
Embedded PCK editor is a new part of MCD editor which allows you to edit 8bit PCK images quite handy way.
+
Embedded PCK editor is a new part of MCD editor which allows you to edit 8bit PCK images without the need to use another image editor, in order to reduce any incompatibilities or palette mishandling.
  
 
At the top there's a toolbar where you can '''save changes''' (they will immedately reflect in other screens).
 
At the top there's a toolbar where you can '''save changes''' (they will immedately reflect in other screens).

Revision as of 10:57, 18 August 2014

MCD Edit tool

The application title bar shows which file is opened, whether it is vanilla or custom, and in custom mode, the path to the file.

Tilesets in xcom1/2 consist of 3 files with the same name and different extensions. MCD is the main file with values and references to images. PCK+TAB are the files of sprite images. The number of tiles in the MCD is not necessary equal to the number of images in the PCKs. If there are animated tiles, the number of PCK entries will be more than number of MCDs. In some tilesets, single PCK images are reused in several MCDs, but with different heights.

Main screen

main screen
  • Custom button opens custom MCD set (tileset automatically fetches all *.mcd files from specified folder) - same as File->Open custom MCD .... If you open an MCD from the vanilla folder (as defined in the config file) - it will switch to vanilla mode.
  • Tileset switches between different MCDs in the folder. Don't forget to save the current MCD if you don't want to lose your work (File->Save MCD+PCK+TAB or File->Save MCD+PCK+TAB as.... The '*' sign indicates it's a vanilla MCD, and you will not be able to change the number of MCDs in the file, this is in order to prevent breaking the vanilla maps.
  • Checkered button changes the image background from black (or underwater background) to checkered, just to highlight any holes you've made. Kinda handy when dealing with dark sprites.
  • UFO/TFTD changes gametype. Vanilla mode will switch between game folders and re-read Tilesets. In custom MCD mode it will simply change associated LOFT and SCANg (and will treat tiles as of another game type). It doesn't affect anything else.
  • Palette dropdown menu changes the current palette. The current palette is displayed at the right top corner. Ambiguous color entries in the palette will be highlighted (different indexes but same RGB) - these colors could cause problems when working with RGB graphics (not indexed). mtPaint is a recommended free tool to edit paletted png files in indexed mode.
  • Edit PCKs opens PCK list window from which you can manipulate with PCKs.

At the top of the main area is the MCD preview/selection line with the bar. Yellow highlighted MCDs are animated. You can use the mouse wheel to scroll this list, and cursor key/home/end/pgup/pgdown to change the selected MCD. RMB calls the context menu for the clicked MCD (Copy MCD / Paste MCD / Insert MCD / Add MCD / Delete MCD / Clear MCD) - same as in the Edit menu. If you are not allowed to change the number of MCDs (ie: in vanilla mode) these menu entries will be greyed out.

Below are 16 small images showing the different light levels of the tile (so you can preview how will it look). LMB on these small shaded sprites toggles animation mode (off by default).

Slightly lower is the stipe with the 8 zoomed animation frames of this tile (if MCD is not animated - all of them are the same). LMB on a particular image opens the PCK selection screen. RMB calls for context menu with Edit PCK entry which opens PCK editor for this frame.

At the right of them is the animated zoomed tile and a voxelized 3D representation. Hold LMB to rotate the voxel view (after release it will switch back to the center). The small bar below changes view angle permanently.

The rightmost part is the heap of voxel slices or LOFTs. LMB click on particular layer image to open LOFT sheet and change it.

The bottom part is the main MCD fields editor. When editing a field, a description shows in the box at the right. Tab/Shift+Tab jumps between fields.

The status bar at the bottom shows current PCK file size (in bytes), TAB (in number of records, or PCK images), LOFTemps size (in images), and SCANGs (also in images). The last two are fixed for each particular game type.

SCANg icon is clickable and opens the minimap image selection.

You can also create the new tileset (MCD+PCK+TAB) by clicking File->New MCD. It will ask you for the path and filename for the new MCD, and if it is in a vanilla folder - it will automatically switch into the respective game mode/palette.

pck list

PCK list

Besides selecting PCK images you can also manipulate the PCK sheet, associated with the current MCD.

RMB on each PCK opens a context menu (PCK info / Export PCK / Import PCK / Delete PCK / Insert PCK / Export PNG sheet / Import PNG sheet).

Single PCKs are exported as png images at 32x40 resolution, 8bit color (with current palette). Color 0 is "invisible". When importing an image to a PCK, it takes the top-left 32x40 pixels, everything else will be ignored.

It can import RGB+alpha PNG files. If the alpha is greater than 128, it assumes this pixel is invisible, even if there are color components - Xcom uses binary transparency. Other color RGB values are taken from the closest matching color of the current palette, excluding system parts. Colors 254/255 can't be used because they are used for PCK encoding, and colors below 16 are treated as system thus also not used. For TFTD palettes it also don't use colors of group 9 (144..159).

If it's a paletted PNG, and the palette isn't changed, and matches the current selection - it keeps every pixel index intact (it won't re-convert and won't add ambiguity). If even a single color is changed, or doesn't match the current palette, it treats it as a "different" palette, and re-converts as if it's RGB+alpha.

PNG sheets are exported and imported as consisting of sprites with 32x40 size (without any spacing). The image itself can be of any size, it just runs from the top to the bottom, from the left to the right, if the sprite can't fit in the rightmost part it just skips it. Last empty images (at the tail of the sheet) are ignored.

pck edit

PCK editor

Embedded PCK editor is a new part of MCD editor which allows you to edit 8bit PCK images without the need to use another image editor, in order to reduce any incompatibilities or palette mishandling.

At the top there's a toolbar where you can save changes (they will immedately reflect in other screens). Next to it "mode" buttons: Pixel selection, Rectangle selection, Lasso selection, Color selection and Drawing mode.

At the right are toggle buttons, for the following from the left to the right: checkered background, regular grid, isometric template, and wrap scrolling.

Palette selector is also present (though you can't change its value with mouse wheel or cursor keys).

Top part of the palette is the current Foreground (LMB) and Background (RMB) colors (with hex and decimal index values).

Palette selector works as color picker for both LMB and RMB. Selected colors are shown as contrast dots at the top left/right corners of the color square. Small dot at the bottom indicates that color is used within this sprite.

Below are preview of the sprite (2x zoomed and 2x2 adjacently tiled).

The bottommost right part is the color/group modification tool. It changes colors of selected part of sprite either as shadow level (moving colors within color group), or changing the color group itself.

Controls

  • Mouse wheel scrolling - change foreground color within color group.
  • Ctrl+Z - undo last action (number of current undo levels are shown in the status bar)
  • Ctrl+Shift+Z - redo actions.
  • Ctrl+A - select all.
  • Esc - deselect all.
  • Ctrl+Shift+I - invert selection.
  • Ins - fill selected area with foreground (LMB) color.
  • Del - fill selected area with background (RMB) color (ie clears).
  • Cursor keys - move selected area. Affected by Wrap scrolling mode.
  • LMB Dragging over selected pixels move selected area. Also affected by Wrap scrolling.
  • Ctrl+C - copy selection into the clipboard, as text, which is interchangable with 'Copy/Paste as TXT from PCK selection screen.
  • Ctrl+V - paste selection. Pasted fragment temporarily is in the "second layer" mode (Paste mode in the status bar), and can be repositioned with ctrl+cursor or ctrl+lmb drag. Any other action applies it to the sprite.
  • Ctrl - modifier for scissors mode: cuts selected part and moves it either by cursor keys, or LMB dragging. Cut area is filled with background (RMB) color. Moved fragment gets into the "Paste mode" and affected by Wrap scrolling mode.

In selection modes you can use Shift to add to the selection (cursor gets '+' sign), or Alt to subtract from the selection (cursor gets '-' sign). Without these modifiers selection just renews.

Drawing mode

Alt key switches into color picker/highlighter mode, LMB and RMB are respectively changes colors assiciated with those mouse keys. Same modifier key marks all pixels of same color index. In palette selector Color picker works without Alt pressed.

Pixels are drawn with LMB and RMB of respective colors. It works in "smart" drawing mode, when diagonally "touched" neighbour pixels aren't changed (as is often a problem with pixel-based editors).

If selection does present - pixels can be modified only at selected area.

MCDEdit.txt

The config file contains paths to the game folders for ufo and tftd and optionally folders for "alternative" versions.

Setting alternative folders switches MCDEdit into compare mode - if MCD values are different, they will be shown at the right of the current values in red.

Also it contains information about editable MCD fields (index, name, type, help text). If you want to clarify help/field names - you can do that any time, and feel free to share the config.

boxpat entries are defining "isometric template", you can modify it if you want.

Download

Current version 1.16 (2014-08-17) (download)