aliens

Author Topic: Map Editor/Creator  (Read 12496 times)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Map Editor/Creator
« Reply #15 on: May 22, 2017, 10:14:39 pm »
I've noted that none of the sprites in the pck files ive look at so far are 1,280 pixels(32x40).  In this included pic you can see the first sprite in the blanks.pck is 32x15.  So are these all just parts of potential 32x40 tiles? I guess once i start drawing them it may make more sense.

BLANKS is a special terrain file, because it should be included on every terrain (in addition to the other MCD/PCK/TAB files). The first entry on blanks is an empty tile, which is used for all the 'black' spaces on the map that are out of bounds. Probably that's why it only has a 32x15 size.
« Last Edit: May 22, 2017, 10:17:32 pm by Hobbes »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Map Editor/Creator
« Reply #16 on: May 23, 2017, 06:00:24 am »
the palette information is stored in the PALETTES.DAT file and in standardized LBM formatted images for TFTD.
more info here: https://www.ufopaedia.org/index.php/PALETTES.DAT

Offline MadHaTr

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Map Editor/Creator
« Reply #17 on: May 23, 2017, 03:19:56 pm »
Okay that makes sense for blanks.

  • Each of my pixels as decimals can contain 0-255.
  • Each palette inside PALETTES.DAT is essentially 0-255 as well(Sets of 3 bytes= 768)
  • There are 5 palettes inside the DAT file so 0-1279 locations.
  • Okay I am making the assumption that each pixel is it's own reference to a colour in the palette, is this correct?  If so...
  • Is there a byte somewhere telling me an offset(since a byte can't reference inside all 5 palettes), or is it just hard coded that if I am opening BARNS.PCK  it will be using palette 5. Tactical Palette.

Actually... I guess since this is a map editor I can ignore all other palettes right? All I need is the tactical palette.  Could I still get question one answered,  also if someone sees a reason for me not ignoring the other palettes let me know.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2159
    • View Profile
Re: Map Editor/Creator
« Reply #18 on: May 23, 2017, 06:26:23 pm »
Yes, each pixel is a 0-255 reference to the color on the palette (0 is transparent). Palette colors are actually 0-63 (since VGA was 6-bit, not 8-bit) RGB values.
For your purposes it's probably easier to just hardcode the tactical palettes (UFO and TFTD) instead of loading and converting the arcane formats since they'll never change. You can probably find copies of them in MapEdit, if not spread around Ufopaedia and such.