?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. <html>
  2.  
  3. <head>
  4. <title>Mappy - Win32 1.4.23 documentation</title>
  5. </head>
  6.  
  7. <body bgcolor="#cccccc" text="#000000" link="#0000ff" vlink="#0000aa">
  8.  
  9. <p><a name="topod"></a></p>
  10. <h2>Mappy - Win32 1.4.23 documentation</h2>
  11. <br>
  12. <p>Index:<br>
  13. <br>
  14. &nbsp; <a href="#disclaim">Disclaimer</a><br>
  15. &nbsp; <a href="#welcome">Welcome and Introduction to MappyWin32</a><br>
  16. &nbsp; <strong><a href="#quicks">Quickstart and Tutorials</a></strong><br>
  17. <br>
  18. <br>
  19. &nbsp; Menubar: -
  20. &nbsp; <a href="#filemenu">File</a> -
  21. &nbsp; <a href="#editmenu">Edit</a> -
  22. &nbsp; <a href="#toolmenu">MapTools</a> -
  23. &nbsp; <a href="#brshmenu">Brush</a> -
  24. &nbsp; <a href="#layrmenu">Layer</a> -
  25. &nbsp; <a href="#cstmmenu">Custom</a><br>
  26. &nbsp; <font size=-1>All the features in the MappyWin32 menus are described
  27. in the corresponding menu link above</font><br>
  28. <br>
  29. &nbsp; Windows: -
  30. &nbsp; <a href="#maped">The Map Window</a> -
  31. &nbsp; <a href="#blocked">The Block Window</a><br>
  32. &nbsp; <font size=-1>The MappyWin32 editor has two windows, the Map Window
  33. for editing the map and the Block Window for selecting and editing blocks</font><br>
  34. <br>
  35. &nbsp; <a href="#scuts">Keyboard Shortcuts</a><br>
  36. &nbsp; <font size=-1>Using the standard and custom keys gives faster
  37. access to more commands (fill, line etc)</font><br>
  38. <br>
  39. <br>
  40. &nbsp; <a href="#features">Features</a><br>
  41. &nbsp; <a href="mapwin32pro.html">MapWin32 Pro documentation</a><br>
  42. &nbsp; <a href="#howit">How It Works</a><br>
  43. &nbsp; <a href="#imgfmts">Supported image formats (BMP, PCX, PNG, TGA)</a><br>
  44. &nbsp; <a href="#simple">Using Mappy as a simple map editor (.MAP format)</a><br>
  45. &nbsp; <a href="#isohex">Important information about FMP1.0, Isometric/Hexagonal/other maps</a><br>
  46. &nbsp; <a href="#hexhlp">+ Hexagonal map help</a><br>
  47. &nbsp; <a href="#isohlp">+ Isometric map help</a><br>
  48. &nbsp; <a href="#designc">Design Considerations</a><br>
  49. &nbsp; <strong><a href="luascript.html">Adding functionality with Lua scripts</a></strong><br>
  50. &nbsp; <a href="#comline">Commandline options</a><br>
  51. &nbsp; <strong><a href="#textstr">TextStrings and Labels</a></strong><br>
  52. &nbsp; <a href="#markers">Using Marker Blocks</a><br>
  53. &nbsp; <a href="#expgba">Exporting map for GBA/mobile</a><br>
  54. &nbsp; <a href="#playlib">The Playback Libraries</a><br>
  55. &nbsp; <a href="#fmpform">The FMP file format</a><br>
  56. &nbsp; <a href="#mapform">The MAP file format</a><br>
  57. &nbsp; <a href="#mapini">mapwin.ini settings</a><br>
  58. &nbsp; <a href="#glossary">Glossary</a><br><br>
  59. &nbsp; <a href="vhistory.html">Version History</a><br>
  60. </p>
  61.  
  62. <hr>
  63.  
  64. <p><a name="disclaim"></a></p>
  65.  
  66. <h3>Disclaimer</h3>
  67.  
  68. <p>&nbsp; This software and associated files are provided 'as is'
  69. with no warranty or guarantees of any kind, you use them at your
  70. own risk and in doing so agree that the author is in no way
  71. liable and cannot be held responsible for any loss of
  72. time/data/hair or anything else that may occur either directly or
  73. indirectly from the use of this software or associated files. <br>
  74. <br>
  75. </p>
  76. <p><a href="#topod">(top of doc)</a> </p>
  77.  
  78. <hr>
  79.  
  80. <p><a name="welcome"></a></p>
  81.  
  82. <h3>Welcome and Introduction to MappyWin32</h3>
  83.  
  84. <p><br>
  85. &nbsp; Thankyou for using MappyWin32, hopefully you will find it a
  86. useful tool in creating your own games. This software is freely
  87. distributable, the only restriction is that
  88. you are not allowed to charge for this editor or distribute a modified version of this editor
  89. without the author's consent. You may, of course, use the maps you create as you wish.
  90. If you like it, you can upgrade this free version to <a href="mapwin32pro.html">MapWin32 Pro</a>
  91. at the tilemap.co.uk site. The example maps provided in the MAPS folder may be
  92. used for tests, but you must get permission for other uses.<br>
  93. <br>
  94. &nbsp; What is it? Well, I have tried to make the most
  95. comprehensive and powerful 2D tile map editor about. The idea is
  96. that you make some graphic 'tiles' of a set size (such as
  97. 16 pixels wide by 16 pixels high) with some paint package like this:<br>
  98. <center><img src="images/TEST.BMP" alt="How to make the graphics"></center><br>
  99. You are then able to put them in a grid using Mappy so they form a large
  100. area. You can assign properties to these tiles so that maybe a
  101. sprite (a graphic on the screen) can't go over certain tiles, or
  102. maybe goes under one tile, but over another. You can also animate
  103. tiles and lots more besides. If you don't find Mappy suitable for
  104. your needs, or have suggestions for it, please email me about it (see the 'about'
  105. option in the 'help' menu of Mappy for email address).<br>
  106. <br>
  107. &nbsp; There are several playback libraries available that
  108. you can incorporate in your games which make loading, display and
  109. animation of the map easy. These playback libraries are available
  110. from the Mappy site, and include MappyDX (for DirectX SDK C and
  111. C++ programmers), MappyAL (for Allegro programmers)
  112. and many others. <br>
  113. <br>
  114. &nbsp;If you want to contact me, please email the address shown when
  115. you select 'About' from the 'Help' menu or the feedback form or discussion board
  116. on the Mappy homepage. The current homepage for Mappy is:
  117. <a href="http://www.tilemap.co.uk">http://www.tilemap.co.uk</a>
  118. </p>
  119.  
  120. <p><a href="#topod">(top of doc)</a> </p>
  121.  
  122. <hr>
  123.  
  124. <p><a name="features"></a></p>
  125.  
  126. <h3>Features</h3>
  127.  
  128. <p>Note: These are the features for Mappy Win32 other platforms
  129. and versions have slight differences in features, but all make
  130. the same FMP files...<br>
  131. <br>
  132. &nbsp; Single FMP file format (0.5) compatible with all versions of
  133. Mappy and playback libraries<br>
  134. &nbsp; User definable MAP file format for compatibility with other systems<br>
  135. &nbsp; Supports 8/15/16/24/32bit colour modes<br>
  136. &nbsp; Supports all resolutions<br>
  137. &nbsp; Imports BMP, PNG, PCX and TGA files<br>
  138. &nbsp; Supports still and animated tiles<br>
  139. &nbsp; Supports tile sizes of 8*8 upto 128*128, including
  140. non-square tiles<br>
  141. &nbsp; <strong>30000</strong> tiles, AND 2048 anims available<br>
  142. &nbsp; Can edit maps with  rectangular, isometric, hexagonal and other shape tiles<br>
  143. &nbsp; Easy to use interface<br>
  144. &nbsp; Fill (with still/animated blocks, brush (multi-block) and
  145. random from brush)<br>
  146. &nbsp; Lines<br>
  147. &nbsp; Zoom (1x, 2x and 4x)<br>
  148. &nbsp; Hotkeys and keyboard shortcuts, inc pickblock and
  149. next/prev tile<br>
  150. &nbsp; New, Cut, Copy and Paste<br>
  151. &nbsp; Brush an area, then draw with it!<br>
  152. &nbsp; Various playback libraries to use with your games to load
  153. and display the FMP map file<br>
  154. &nbsp; All colourdepths converting (display 8bit maps on 16bit
  155. screens? no problem)<br>
  156. &nbsp; Import and Export individual components<br>
  157. &nbsp; Export data as text<br>
  158. &nbsp; Lua support for expanding functionality with scripts<br>
  159. &nbsp; Resize map array with recentering (nice)<br>
  160. &nbsp; Undo (and Undo-undo :)<br>
  161. &nbsp; Grid, for easy positioning/tile recognition<br>
  162. &nbsp; Onion skin transparency<br>
  163. &nbsp; Tidyup/space functions, gets rid of unused data<br>
  164. &nbsp; Map information, see exactly how much space things are
  165. using<br>
  166. &nbsp; DirectX preview (MappyWin32 will run without DirectX
  167. except preview), scroll around your animated map on any valid
  168. DirectX mode (all valid modes for your system are listed),
  169. includes parallax layer for transparency checking. On my
  170. relatively lowly 200Mhz K6 I can run my monitor rate of 75fps in
  171. 800*600*16 with all layers and parallax<br>
  172. &nbsp; Layers, 4 for each block, 8 in the map including
  173. transparency and depth.<br>
  174. &nbsp; Expansive and useful documentation (surely the best
  175. feature?) </p>
  176.  
  177. <p><a href="#topod">(top of doc)</a> </p>
  178.  
  179. <hr>
  180.  
  181. <p><a name="quicks"></a></p>
  182.  
  183. <h3>Quickstart and Tutorials</h3>
  184.  
  185. <p>&nbsp;MappyWin32 runs under Windows 95, 98, Me, 2000, NT
  186. and XP, it should also run under other OS with Windows emulation.
  187. You will need your desktop in 15bit colour or higher
  188. (high or true colour, the more colours the better). Extract the
  189. files from the zipfile to your drive. Double click
  190. mapwin.exe to start it, you can also associate the .FMP map files with
  191. mapwin.exe if you want. <br><br>
  192. &nbsp;To try out and learn how to use MappyWin32 you can follow these
  193. quick tutorials:<br><br><br>
  194. <strong>Tutorial 1: Using MappyWin32</strong><br>
  195. &nbsp;Make the window bigger by clicking the 'maximize' gadget to the
  196. left of the 'X' close gadget in the window's titlebar. Select
  197. 'Open' from the file menu, or simply press ctrl+o, and open the MAPS
  198. folder. You should see the file test2.fmp (or 'test2'), double click
  199. it and it will be loaded into the map editor.<br>
  200. <br>
  201. &nbsp; You should now see the map in the Map Editor (larger)
  202. window, and the still blocks in the Block Editor (smaller) window.
  203. If you have a high resolution desktop and the tiles look a bit
  204. small, select a 'Zoom' from the MapTools menu. Click the left mouse
  205. button over a block in the Block Editor window, you
  206. should see a black and white rectangle appear round it,
  207. indicating it is the active block. Now move the mouse over to the
  208. Map Editor window and click the left mouse button to place the
  209. block in the map. You can hold the left button down and move the
  210. mouse to 'paint' with the block. Try scrolling
  211. around the map with the cursor (arrow) keys, or using the sliders
  212. at the right and bottom edges of the Map Editor window. You can
  213. undo the last action you made by selecting Undo from the Edit
  214. menu (or simply ctrl+z), you can undo your undo by selecting it
  215. again.<br>
  216. <br>
  217. &nbsp; One of Mappy's best features are animated blocks, to see
  218. them click the right mouse button in the Block Editor window, you
  219. should see the title of the window change, and any animated
  220. blocks will be displayed, you can select and use them just like
  221. still blocks, you can right click again to get back to the still
  222. blocks. In a new project, there are no animated blocks to start
  223. with, you should switch to the animated blocks window, and select
  224. 'New' from the Edit menu.<br>
  225. <br>
  226. &nbsp; Handy shortcuts are to use the ',' and
  227. '.' keys to select
  228. the previous/next block and the 'p' key to select the block the
  229. mouse pointer is currently over in the Map Editor window.
  230. You can
  231. double click the left button on a still or animated block in the
  232. Block Editor window to edit its properties, try it on both still
  233. and animated blocks
  234. to see the options. You can use any of the options in the Edit
  235. menu to manage the blocks, a new block only uses 32 bytes of
  236. memory and ordering them does not change the graphics order (so
  237. you can still update your graphics from your original graphics blocks
  238. picture with Import).<br>
  239. <br>
  240. &nbsp; Select the Grab New Brush option
  241. from the Brush menu, now position your mouse over the
  242. corner of the area you want to brush in the Map Editor window.
  243. Click the left mouse button and hold it down and move the mouse
  244. to the opposite corner of the area you want to grab, you should
  245. see a 'bounding box' indicating the area. When you have the area
  246. you want selected, release the left mouse button and name it. You can now
  247. paste that brush anywhere you like with the left button
  248. the top left of the brush will be at the mouse pointer (you can change this
  249. with 'Handle' in the Brushes menu).
  250. Note that any 'block 0' blocks in the brush will be treated as
  251. transparent so you can have non-rectangular brushes, unless you disable
  252. this with the option in the Brushes menu. You can also
  253. use brushes for filling, find an area with a number of identical
  254. blocks next to each other (the black areas are good), place the
  255. mouse pointer over the 'starting block' and press the 'f' key,
  256. that area will now be filled with the brush, over and over with
  257. the top left of the brush where the mouse pointer is, try it and
  258. see. Undo the fill with ctrl+z, now do the same, but press
  259. ctrl+f, the area will be filled with random blocks from the
  260. brush.<br>
  261. <br>
  262. &nbsp; If you want to save the map, select 'Save As' from the File
  263. menu.<br><br><br>
  264. <strong>Tutorial 2: Making a new FMP map with MappyWin32</strong><br>
  265. &nbsp; When you want to make a new map, you will need to create or
  266. obtain some tile graphics. These must be in a grid like this:<br><br>
  267. <center><img src="images/TEST.BMP" alt="How to make the graphics"></center><br>
  268. (you can use these tiles for testing, the TEST.BMP file shown above is in
  269. the docs/images folder). Your tile graphics should be in a BMP, PNG, PCX or
  270. TGA picture, see
  271. <a href="#imgfmts">supported image formats</a> for more information.
  272. The tile graphic picture should be black (index 0 in 8bit, RGB=000000 in
  273. truecolour) where
  274. there are no tiles. Make sure the picture is big enough for all
  275. the tiles you want. If you need to expand the picture later add
  276. the extra space to the bottom (most paint packages let you do this).
  277. If you update or add more tiles to the picture you can re-import
  278. it and the old tiles will be updated and the new tiles will be added.<br><br>
  279. &nbsp;Start MappyWin32 and select 'New Map' from the File menu (ctrl+m).
  280. Fill in the tile dimensions in pixels (first two boxes), and the
  281. map dimensions in blocks (tiles). You can resize later if you need to.
  282. For TEST.BMP the tiles are 16 pixels wide by 16 pixels high. You can
  283. make the map whatever size you want, (for this tutorial choose 100 wide
  284. by 100 high, which will give a map 1600 pixels wide by 1600 pixels high).
  285. The size in pixels is
  286. mapwidth*tilewidth by mapheight*tileheight. Now select the colour depth
  287. of the map, (select truecolour unless you know you need to use 8bit)
  288. then click 'OK'. You will see a messagebox telling you to import some
  289. graphics, so click 'OK' and select Import from the File menu (or press
  290. ctrl+i). Doubleclick your image file (TEST.BMP is in the docs/images folder)
  291. and you should see your tiles loaded. For TEST.BMP the colourkey is
  292. black, so choose 'Map Properties' from the MapTools menu and change
  293. the 24bit colourkey from FF00FF to 000000 this is worth doing even
  294. with 8bit maps as this will be used if you load it in a truecolour
  295. mode. You can also select 'Autoset BG transparency' from the 'Useful
  296. Functions' option in the MapTools menu, any tiles with the transparent
  297. colour in them now have the 'BG transparency' flag set (more on this
  298. later).<br><br>
  299. &nbsp; To save the map in FMP format, select 'Save As' from the File
  300. Menu and type a name for the new map (.FMP will be added if you don't
  301. type it).<br><br>
  302. &nbsp; If you have modified your original graphics file and want to
  303. update the tiles in the map, use 'Import' again from the File menu.
  304. <br><br>
  305. <strong>Tutorial 3: Autofringing and laying paths</strong><br>
  306. &nbsp; New for V1.4.22, the example placer.lua script will autofringe
  307. (smooth) as you draw. To use this, set a mousebutton to Placer.lua
  308. in Mousebuttons in the Custom menu. The blocks need to be arranged
  309. like this in your map (They can be anywhere, and as many as you like
  310. as long as the 3 by 3 grid and 2 by 2 grid are next to each other).
  311. Select the middle of the 3 by 3 grid to use:
  312. <br>
  313. <center><img src="images/smooth.bmp" alt="Fringe order"></center><br>
  314. <br>
  315. An example map 'MAPS/smooth.FMP' is provided, so load it up and
  316. scroll down to a clear area, set Custom:mousebuttons to Placer.lua
  317. then draw with the selected blue tile to see autosmoothing. If you
  318. made the map with an earlier version you will need to reimport your
  319. graphics so the number of blocks per row are known.
  320. <br><br>
  321. Autofringing lets you draw areas on the map with a block,
  322. then select 'Autofringe' from the Custom menu to smooth out the
  323. joins between that area and the rest of the map. An example of
  324. this is putting islands on an ocean. To do this, you will need
  325. 12 fringe blocks in the Block editor window after the block you
  326. were drawing the area with. They need to be in this order:<br>
  327. <br>
  328. <center><img src="images/fringe.png" alt="Fringe order"></center><br>
  329. <br>
  330. &nbsp; Laying a path is done by having 6 blocks (left/right, up/down,
  331. then the corners) in this order:<br>
  332. <br>
  333. <center><img src="images/laypath.png" alt="Lay path order"></center><br>
  334. <br>
  335. Select the first (left/right) block, then set a mousebutton (in
  336. Custom menu) to 'Lay path'. Keep the mousebutton pressed while
  337. you move the mouse over the map to lay the path, it may take a
  338. couple of blocks to start.
  339. The path will look best if you move between adjacent blocks, not
  340. diagonally. Lay path is also useful for things like rivers, walls,
  341. hedges and more.<br>
  342. <br>
  343. <strong>Tutorial 4: Preparing a final FMP map</strong><br>
  344. &nbsp; FMP maps are ready to use from the first time they are saved.
  345. Use a <a href="#playlib">playback library</a> to load and use FMP
  346. maps in a game project. To reduce the size and memory use of a FMP
  347. file you should make sure you have saved the FMP file, then select
  348. 'Remove unused or duplicate' from the MapTools menu. You can see the
  349. difference in 'Map Properties'. Now save the map, but don't
  350. overwrite the original (you should keep that for updating the map).
  351. If the FMP size still seems large, it should reduce down
  352. when you compress it in a zip file or similar.
  353. </p>
  354.  
  355. <p><a href="#topod">(top of doc)</a> </p>
  356.  
  357. <hr>
  358.  
  359. <p><a name="maped"></a></p>
  360.  
  361. <h3>The Map Editor Window</h3>
  362.  
  363. <p>&nbsp; This will show how the map is layed out, and allow you
  364. to edit that layout. Simply select a block, anim, or brush and
  365. paint with it by clicking the left mouse button on the square
  366. where you want to place the tile, you can alter more than one
  367. square by holding down the left mouse button and moving the
  368. mouse. The actions performed by the mousebuttons can be defined
  369. by selectin 'Mousebuttons' in the Custom menu. The mousewheel
  370. can be used to scroll the blocks in the Block editor window.
  371. You can fill an area of blocks with either a still
  372. block, anim block or brush (depending on what is currently
  373. selected as your drawing item) by pressing the 'f' key (make sure
  374. caps lock isn't on) when the mouse button is over the block you
  375. want to start the fill with. You can also fill randomly from a
  376. brush with Ctrl+F, you can weight blocks by having more than one
  377. in a brush (try and see, you can undo a fill with Undo, Ctrl+Z).
  378. Another handy shortcut is to press the 'p' key while the mouse
  379. pointer is over the block you want to pick in the Map Editor
  380. window, this will now be your current block/anim. You can select
  381. the next/previous block/anim by pressing the ',' and '.' keys.<br>
  382. <br>
  383. &nbsp; You can move the area seen in the Map Editor window by
  384. either using the scrollbars on the right and bottom edges of that
  385. window, or by pressing the arrow (cursor) keys, hold them down to
  386. scroll along. When you get to the right or bottom edges of the
  387. map you will see a grey area which cannot be modified.<br>
  388. <br>
  389. &nbsp; Information about the block under the mouse pointer is
  390. given in the window title bar.</p>
  391.  
  392. <p><a href="#topod">(top of doc)</a> </p>
  393.  
  394. <hr>
  395.  
  396. <p><a name="blocked"></a></p>
  397.  
  398. <h3>The Block Editor Window</h3>
  399.  
  400. <p>&nbsp; This shows all the still and animated blocks that have
  401. been created, you can toggle between the still and animated
  402. screens by right clicking the mouse over the Block Editor window.
  403. To select a block or anim, left click the mouse button on it, you
  404. can now draw with it in the Map Editor window.
  405. You can add a new block/anim, cut copy and paste
  406. (all in the Edit menu), new and paste put the block after the
  407. currently selected one. Each block takes only 32 bytes of space
  408. (see Map Properties). Note that cutting a block will remove any
  409. references to it from the map array (they will be replaced with a
  410. reference to block 0), and pasting it will not put them back, so
  411. it's usually best not to cut blocks you are using in the map
  412. array. Also note that cutting a block does not remove the
  413. graphics it was using. Using new, cut, copy and paste does not
  414. affect the graphics you imported in any way, click on the picture
  415. above 'BG' in a block's properties to see the actual graphics.
  416. As long as you don't use 'Remove unused or duplicate graphics'
  417. options the graphics will never change, allowing you to update
  418. them from the original imported image.
  419. Undo does not work when editing the Block
  420. Editor.<br>
  421. <br>
  422. &nbsp; You can see more blocks/anims by scrolling up and down
  423. with the scrollbar on the right of the Block Editor window.<br>
  424. <br>
  425. &nbsp; To edit a block structure, double click it in the Block
  426. Editor window. Depending on whether it is a still or animated
  427. block, you will be shown a dialogue giving details about it and
  428. allowing you to change it.<br>
  429. <br>
  430. &nbsp;<strong>Editing Properties of a Still Block</strong>. You will be shown the
  431. block you double clicked, along with it's properties. The numeric
  432. information is not used by Mappy and is entirely for your own
  433. use, as are the four collision detection, and 'other' bits. The BG
  434. transparency box indicates whether BG transparency is taken into
  435. account (you will nearly always check that in block 0 if you plan
  436. to use transparency, as well as any blocks that have a
  437. transparent colour in the BG graphic. An easy way to set this for
  438. all blocks with some transparent pixels is to select 'Auto set
  439. BG transparency' from the 'Useful functions' option in the MapTools
  440. menu after you have imported your graphics). In the bottom left, you will see the
  441. four layers of graphics that make up the block's appearance,
  442. simply click them to pick a new graphic, BG is used as the back
  443. layer, you will probably only want to use the first FG layer,
  444. this allows you to draw the map in layers in the playback
  445. libraries, sandwiching sprites between them to give depth. You
  446. can go to the next/previous block by clicking the arrows next to
  447. the OK button. TextStrings are covered in the
  448. <a href="#textstr">TextStrings and Labels</a> section.<br>
  449. <center><img src="images/blprop.png" alt="Block Properties diagram"></center>
  450. <br>
  451. &nbsp;<strong>Editing Properties of an Animated Block</strong>. Double clicking
  452. an animated block in the Block Editor window lets you create
  453. animations. Animated blocks are made up of a sequence of still
  454. blocks, you do not pick graphics when you edit them, but still
  455. block structures. The reference block is how the anim appears
  456. when it is not animating (such as in the Block and Map Editor
  457. windows), click it to change. Below that is the sequence of still
  458. blocks, there is a black and white 'C' shape indicating where
  459. frames will be inserted and deleted, simply click where you want
  460. to insert or cut, then click the Insert or Cut buttons. Clicking
  461. Insert will take you to another dialogue where you can pick up to
  462. 30 frames to insert (you can have more than 30 frames in an
  463. animation, just click insert again). When you OK, you are
  464. returned and the new frames will be shown, with the edit point
  465. 'C' cursor at the end of the new frames. The Delay is the number
  466. of calls to UpdateAnims before the next frame is used, so the
  467. higher it is the slower it will animate, the actual speed is
  468. determined by how often you call UpdateAnims (a playback library
  469. function), you can get a rough idea with Anim Preview from the
  470. MapTools menu. To the right of Delay is the style of animation,
  471. click to change, LOOPF continually loops forward, ONCE only plays
  472. the anim once (this is so your game can trigger an event), PP
  473. pingpongs between the start and end frame via the middle ones.</p>
  474.  
  475. <p><a href="#topod">(top of doc)</a> </p>
  476.  
  477. <hr>
  478.  
  479. <p><a name="filemenu"></a></p>
  480.  
  481. <h3>The File Menu</h3>
  482.  
  483. <p>&nbsp; This has the standard file features such as Open (open
  484. a .FMP or .MAP mapfile for editing), Save (saves current .FMP or .MAP file under
  485. it's current name, if it hasn't been named this is the same as
  486. Save As), Save As (requests a name to save the map, .FMP will be
  487. added if you don't type it in then saves it), Exit (quits Mappy,
  488. same as clicking the 'X' gadget in the window titlebar, you
  489. will be warned if you have modified a map but not saved it), and
  490. some Mappy specfic ones, which are:<br><br>
  491. &nbsp; <strong>New Map</strong>. Brings up the new map dialogue where you choose
  492. settings for the new map, you should have carefully decided on
  493. the values you enter here. Either the default values will be shown, or
  494. the values for the currently loaded map (currently loaded map
  495. will be cleared from memory if you OK from New Map), you can
  496. modify these values to any legal value. If you are creating a
  497. map with non-rectangular tiles click 'Advanced'.
  498. Note: Your Windows desktop doesn't need to be in, or support,
  499. that depth, your Windows desktop does need to be in high or true
  500. colour though (yes, even for 8bit maps :).<br>
  501. <strong>Advanced dialogue:</strong>
  502. FMP version: this allows you to specify the version
  503. of the FMP file, you can change it in Map Properties later on.<br>
  504. Block gap x and y: this is the gap between blocks, if x is the same width,
  505. the blocks will be next to each other. For isometric maps,
  506. gapx should be the same as blockwidth, and
  507. gapy should be the same as blockheight.<br>
  508. Block stagger x and y: This is the offset for every other row, for
  509. isometric, stagger x should be half blockwidth, stagger y should be half
  510. blockheight. You can change all these in Map Properties later on if it doesn't look right.<br>
  511. <br>
  512. &nbsp;When you 'OK' you will be given a map
  513. filled with one block (shown in the Block Editor 'still' window)
  514. this is a special block, you can edit it's properties (by double
  515. clicking) but not give it any graphics or delete or move it from
  516. the first position. Now may be a good time to check 'Map
  517. Properties' in MapTools to see how much space is being taken up.<br>
  518. <br>
  519. &nbsp; <strong>Import</strong>. This is used to get your tile graphics into your
  520. map, see <a href="#imgfmts">supported image formats</a>.<br>
  521. <center><img src="images/TEST.BMP" alt="images/TEST.BMP"></center><br>
  522. The editor defaults to simpleimport, this allows you to import one image
  523. file and update or add more graphics by modifying the image file and importing again.
  524. If you disable simpleimport in the mapwin.ini file (not recommended),
  525. you can import more than one image file, when you have selected the image
  526. file to import, you will get the question: &quot;Make all
  527. imported graphics into NEW block structures?&quot; If you answer
  528. 'Yes' new blocks will be created in the Block Editor 'still'
  529. window that have each new graphic tile as the BG (see Block
  530. Structures in the <a href="#glossary">glossary</a>), if you
  531. answer 'No' you will be asked: &quot;Replace existing
  532. graphics?&quot;. Answering 'Yes' to that will write over the
  533. current map graphics (except the special first one), the most
  534. common reason to do that is when you have updated the map graphics.
  535. If you have added more blocks to the end you will be asked if you
  536. want new structures for the new blocks.
  537. If you say 'No' to replacing existing graphics the new ones will
  538. be added to the map, but won't be visible until you incorporate
  539. them into a Block Structure.<br>
  540. &nbsp; You can also import Map Array (.MAR and .MAP) layers here, these MUST have been
  541. previously exported from this map, and you must not have altered
  542. the block order.<br>
  543. <br>
  544. &nbsp; <strong>Import at</strong>. Please use import instead<br><br>
  545. &nbsp; <strong>Export</strong>. You can export individual parts of the map as
  546. separate files, which you may need for various reasons, though
  547. the playback libs use the FMP files.
  548. Click the checkboxes to indicate what to export
  549. (they will be given the name at the top of the dialogue with
  550. the indicated extension and be put in the same
  551. directory as the map file). <br>
  552. <strong>?.MAR</strong> The current layer map array is saved as
  553. an array of short ints mapwidth wide by mapheight high, so
  554. a 100*100 map would produce a 20000byte .MAR file. These .MAR
  555. files can be re-imported ('import' in the File menu) if you
  556. don't change the block order in the Block editor window. Most
  557. playback libs have a function for loading .MAR files, this is
  558. one way of having many levels.<br>
  559. <strong>?.TXT</strong> This is the same as selecting 'Export
  560. as text' from the File menu, see below.<br>
  561. <strong>?.CSV</strong> Saves the current layer as comma
  562. separated values in a text file, if csvusebg is 1 in mapwin.ini
  563. the BG value is used, if 0 the block number is used.<br>
  564. <strong>?scrn.BMP</strong> Saves the current layer as a BMP
  565. file, as maps can cover a large area this image can be very big
  566. also there seems to be a limit of 32768 pixels in each direction.
  567. BMP is 8bit if map is 8bit, 24bit for all other map depths.<br>
  568. <strong>?.BMP</strong> Saves the graphics blocks in a BMP
  569. file, click 'skip block 0' if you dont want the blank tile
  570. at the start. BMP is 8bit if map is 8bit, 24bit for all other
  571. map depths. You can use this picture to modify the graphics
  572. by re-importing it.<br>
  573. <strong>?.CMA</strong> The colour map is exported as a 768 byte file containing
  574. 256*3byte values of 0xRRGGBB, this is the same as the CMAP chunk
  575. of the FMP file.<br>
  576. <strong>?.ABD</strong> The Anim and Block data is exported as a long
  577. int offset to the split between the anim and block structures
  578. then the anim info, then the block structures. This raw
  579. information is not generally useful.<br>
  580. <strong>?.GFX</strong> All the raw blockgraphics one after the other, so
  581. that's blockwidth*(blockdepth/8)*blockheight*numblockgfx.<br>
  582. <br>
  583. &nbsp;<strong>Export as text</strong>. This option allows you to save data from the
  584. current .MAP or .FMP in text form to be included in a compiled
  585. programme (for gba or a mobile device, for example). The file
  586. created uses the name at the top with a .txt extension. 'Use
  587. name as prefix' uses this name to prefix each part (eg: cmap
  588. becomes name_cmap). There are four main parts:<br><br>
  589.  
  590. Colour Map - outputs the 256 colour table in either RGB or 16bit
  591. GBA format.<br><br>
  592.  
  593. Anim and Block structure data - The Block properties in BLKSTR
  594. and ANISTR format, unused fields (all '0') can be automatically
  595. cut if you check that box, you will need to adjust BLKSTR to fit
  596. the new format. BLKSTR and ANISTR are defined in mapdefs.h<br><br>
  597.  
  598. Map Array(s) - GBA Merge Flip will merge the V and H flip bits
  599. into the array, and User7 as the palette index if you choose
  600. 16 colour tiles. Auto resolve BG will use the BG field as the
  601. value, rather than the block number, if you don't export
  602. Anim and Block structure data.<br><br>
  603.  
  604. Block graphics - If you choose GBA 8x8, tiles will be output
  605. as 8x8, if you have 16x16 tiles you will get 4 8x8 tiles for
  606. each tile. 16 colour tiles will do just that for GBA (check
  607. GBA 8x8 too). If you don't choose GBA 8x8, tiles will be
  608. output 'as is'.<br><br>
  609. </p>
  610.  
  611. <p><a href="#topod">(top of doc)</a> </p>
  612.  
  613. <hr>
  614.  
  615. <p><a name="editmenu"></a></p>
  616.  
  617. <h3>The Edit Menu</h3>
  618.  
  619. <p>&nbsp; This contains New, Cut, Copy and Paste for use with the
  620. blocks in the Block Editor window (see
  621. <a href="#blocked">Block Editor</a> for how those work).
  622. <br>
  623. &nbsp; Undo is very useful, but doesn't work on everything, it
  624. will undo everything since the last left mouse click in the Map
  625. Editor window (including the area you can't see), especially
  626. useful for undoing Fill or when you 'paint' by holding the
  627. mousebutton down.</p>
  628.  
  629. <p><a href="#topod">(top of doc)</a> </p>
  630.  
  631. <hr>
  632.  
  633. <p><a name="toolmenu"></a></p>
  634.  
  635. <h3>The MapTools Menu</h3>
  636.  
  637. <p>
  638. &nbsp;<strong>Map Properties</strong>. This allows you to put your name and a 3 line
  639. description of the map, the length of each line is limited to 68
  640. characters, this information is saved in the FMP file. Below is
  641. how much memory each type of object is using in the map along
  642. with the total space used for those objects. There are also a
  643. variety of things you can fiddle with. The Alt Graphics: Load allows
  644. you to add another set of graphics to support an 8bit display in
  645. a truecolour map, if
  646. Anim Preview is set to an 8bit mode, you can see them there... If you import
  647. graphics, these will be freed. To make them: export tiles as a BMP, convert
  648. to 8 bit, Load 8bit BMP as Alt graphics.<br>
  649. Map version allows you to select which FMP type is used, you can
  650. freely change this at any time, FMP0.5 is most supported by
  651. other libraries (check your playback library) but is limited
  652. to 1024 tiles.<br>
  653. Colourkey allows you to choose the transparency colour for the map,
  654. this is saved in FMP files.<br>
  655. You should ignore the clickmask, stagger and gap values for
  656. normal rectangular tile maps.<br>
  657. A clickmask MUST be set for non-rectangular tile maps (like isometric)
  658. you should set this to a number of a graphic tile that is a solid mask
  659. for the shape of blocks. The gap values are the pixels between blocks,
  660. the stagger values are the offsets of the odd rows.<br>
  661. Don't cache in VRAM allows you to stop a
  662. playback lib using VRAM for certain graphics (like marker blocks), example:
  663. 1-20,28,30,35-40 would not load blocks 1 through 20, 28, 30, and 35 through
  664. 40 in VRAM, using sysmem instead. This feature requires a playback lib that supports it,
  665. if it doesn't the map will still work and this info will be ignored.<br>
  666. <br>
  667. &nbsp;<strong>Anim preview (DirectX)</strong>. Runs the map in fullscreen
  668. DirectDraw using the settings from 'Preview setup'. You can
  669. scroll around the map (starting at the point where the Map Editor
  670. window is currently viewing) and see the animated blocks animating as
  671. well as the transparency. Zoom and flipped tiles are not used in
  672. this preview.<br>
  673. &nbsp;<strong>Preview setup</strong>. Select the screenmode you want to
  674. use from the list, these are reported by DirectX so only valid
  675. ones are shown, it defaults to whatever you set as apmode in
  676. <a href="#mapini">mapwin.ini</a>, bpp is the depth of the map
  677. pick whichever you like,
  678. preferably the one your game is going to run in, beware that
  679. running excessively high resolution modes on monitors not
  680. designed for that mode may damage the monitor. Check the boxes
  681. below for which block layers are drawn (the default is background
  682. (BG) with the first foreground layer). Below are the transparency
  683. options, check the box to enable transparency on the preview, if
  684. you want a parallax layer (very handy for checking proper
  685. transparency) enter the number of the GRAPHIC (this may not be
  686. the same as the block number, 0 will be plain black or colour 0,
  687. you can see what the graphic numbers are by editing a still
  688. block, clicking on the BG image and looking at the list) this
  689. will be repeated over and over in any transparent regions
  690. (remember to check the BG transparency box, in the Block properties
  691. editor) and move at half the speed
  692. of the other layers creating a rather lovely effect. There is also a box
  693. specifying the logic rate, leave this at 0 if you want the logic
  694. to match the monitor refresh rate, or specify your own. If you are
  695. making a game you usually can't rely on the refresh rate of the
  696. monitor to regulate speed as it varies (so speed will vary on
  697. different machines). Most games update internally at a set rate
  698. (try 100fps) which unfortunately leads to jerkier movement but
  699. at least the speed is the same on all machines.<br>
  700. <br>
  701. &nbsp;<strong>Range Edit Blocks</strong>. Allows you to selectively
  702. adjust a set range of block structures. It is simple to
  703. use, type the numbers for the start and end of the range of blocks
  704. you want to alter, then adjust ONLY the things you want to change.
  705. If any of the checkboxes are greyed out, or the user fields are
  706. completely blank the information in each block will be left
  707. unaltered. For more information on these fields, see
  708. <a href="#blocked">Block Editor</a>.<br>
  709. <br>
  710. &nbsp;<strong>Resize Map</strong>. Allows
  711. you to resize the map array of all layers. Before resizing it is
  712. advisable to save the map as you can't Undo it (though you can
  713. resize back to the original size). Enter the new width and height
  714. of the map in blocks. When you have done that, you can click one of the 9
  715. buttons on the left which show which edges rows and columns will
  716. be removed/added to, the default is 1, rows and columns
  717. will be added/removed from the lower right to make the new size
  718. map). You can alternatively enter which block position should be at
  719. the new top left in the 'New Left' and 'New Top' boxes (negative offsets
  720. are allowed). Click OK to resize, or Cancel to keep the old size.<br>
  721. <br>
  722. &nbsp;<strong>Useful functions</strong>. Contains miscellaneous
  723. functions:<br>
  724. <strong>Change block size/depth</strong>: Will destroy the current graphics
  725. but keep all other data, you can then import the new size
  726. graphics into the map (you can do this by exporting the current
  727. graphics, resizing, then re-importing them.<br>
  728. <strong>Convert 16x16 blocks to 8x8 (GBA)</strong>: 8bit only, download GBAMappy
  729. to see how to use. Often used with the 'Export 16x16 GBA table'
  730. custom export script.<br>
  731. <strong>Split blocks (Halve block dimensions)</strong>: Splits all blocks
  732. and graphics into four (for example, 32x32 size tiles become 16x16)><br>
  733. <strong>Auto set BG transparency</strong>: Checks the BG transparency box for
  734. every block that has any transparent colour pixels in the BG image.<br>
  735. <strong>Create map from big picture</strong>: Loads a large image file into the
  736. current map (such as one exported as ?scrn.BMP), optionally
  737. removing duplicate tiles. Select the option for full instructions.<br>
  738. <strong>Save FMP without graphics</strong>: Saves all information just like a
  739. FMP file except the graphics (allowing sharing of graphics
  740. between maps). The file is saved with a .FMA extension as
  741. these maps are not FMP compliant. If you want to reload a
  742. FMA file into MappyWin32 (1.4 and above only), load the
  743. FMP with the graphics in first, then load the FMA file.
  744. You will need to type the whole FMA name in the open
  745. requester as FMA files are not shown (eg: level1.fma).
  746. As only the graphics are missing, an FMA map can have
  747. different blocks, map size, brushes, number of layers etc
  748. to the FMP file it is using the graphics from.
  749. In order to load an FMA file with a playback library, you
  750. will either:<br>
  751. 1) Modify it so the FreeAll function does not
  752. free the graphics from the FMP file, then load the FMA
  753. file with MapLoad, or:<br>
  754. 2) Export the graphics as a .GFX file and modify the DecodeBGFX
  755. function to load that after loading the FMA file, or:<br>
  756. 3) Load the graphics from a BMP file or other.<br>
  757. You should consider exporting .MAR files instead as these
  758. are supported by playback libraries.<br>
  759. <br>
  760. &nbsp;<strong>Remove Unused or Duplicate</strong>. Useful when you have
  761. completed a map and want to reduce its size. Make sure you have
  762. a backup! If you select remove anims, any anims that aren't used
  763. in the map will be removed, this probably won't save much space
  764. on its own, but when you remove graphics you could save a lot
  765. more, be careful, if you have made an anim sequence that is
  766. inserted into the map in realtime by your game, it will still be
  767. deleted if it is not in the map. Remove blocks removes any block
  768. structures not used by the map array or anim sequences. Remove
  769. graphics removes any raw graphics not used by block structures,
  770. this will mean you can no longer update your graphics from your
  771. original picture, export the blocks as a BMP if you need to
  772. modify them after this. To check these savings, view Map
  773. Information before and after doing this.<br>
  774. <br>
  775. &nbsp;<strong>Show user info on tile</strong>. Lets you select
  776. one of the Block Properties fields to show over the tile
  777. graphic in the Map and Block Editor windows (if the field is
  778. not 0). The value is truncated if it is too big to show on the
  779. tile. See also: <a href="#markers">Using Marker Blocks</a>.<br>
  780. <br>
  781. &nbsp;<strong>Show Pillar bases only</strong>. On isometric maps
  782. with risers, this toggles whether the whole riser is drawn
  783. (obscuring parts of the map), or just the base.<br>
  784. <br>
  785. &nbsp;<strong>Pillar Riser mode</strong>. Toggles riser mode,
  786. see the <a href="isohex">Isometric section</a> for details.<br>
  787. <br>
  788. &nbsp;<strong>Flipped tiles mode</strong>. Toggles flipped tiles
  789. mode, when enabled you can flip the tile graphics vertically and/or
  790. horizontally in the block properties of each block. Most playback
  791. libraries do not support this mode, used mainly for GBA development
  792. and MappyGL. Flipped tiles
  793. mode is not saved in the map file, if you use flipped tiles,
  794. you can set this mode on by default in the mapwin.ini file.<br>
  795. <br>
  796. &nbsp;<strong>Rotated tiles mode</strong>. Toggles rotated tiles
  797. mode, when enabled you can rotate the tile graphics 0, 90, 180
  798. and 270 degrees by setting the USER7 field to 0, 1, 2 or 3
  799. repectively. The change will not be shown until you OK or
  800. change the tile. Currently only MappyGL (see mappygl.c) supports this.
  801. <br>
  802. &nbsp;<strong>3D walls mode</strong>. When enabled, shows a line
  803. on the side of a block where a vertical side face is. Currently only
  804. supported in MappyGL. To make a riser,
  805. add a block (ctrl+n or copy and paste), check the first 'other' box in
  806. Block Properties. Now BG=West face, FG1=North, FG2=East, FG3=South
  807. (hence 'wnesmode'), leave face blank for no face. The next block is
  808. attached above a riser block, multiple attached blocks make a taller
  809. tower. At the top of the tower you must have a block without the
  810. first other box set, this will have the BG flat over the top of the
  811. tower and end the chain. If you set BG and FG on the end block, BG
  812. is drawn flat at the base of the tower, FG flat at the top.
  813. <br><br>
  814. &nbsp;<strong>Grid</strong>. This toggles between 'off', 'on1'
  815. which is the default and highlights the block in the Map Editor
  816. window the mouse cursor is over, and 'on2' which also puts a border
  817. around the blocks in the Block Editor window. If you want to
  818. grid all the blocks in the Map Editor window, see the
  819. <a href="#markers">Using Marker Blocks</a> section.<br>
  820. <br>
  821. &nbsp;<strong>Dividers</strong>. Select to show the dividers
  822. options. Toggle off and on with the 'Enable dividers' box. Choose
  823. the colour with 'Line colour', 000000 is black, FFFFFF is white.
  824. Set the spacing between dividing lines with Pixel gap X and Y.
  825. Setting the gap the same as your tile width and height gives a
  826. useful grid, setting the gap the size of your game screen is
  827. useful for flipscreen type games.<br>
  828. <br>
  829. &nbsp;<strong>Zoom (x 0.25, x 0.5, x 1, x 2, x 4)</strong>.
  830. Zoom shows things at a quarter normal size at Zoom x 0.25,
  831. half normal size at Zoom x 0.5, normal
  832. size at Zoom x 1, twice normal at Zoom x 2, and four times
  833. normal size at Zoom x 4.</p>
  834.  
  835. <p><a href="#topod">(top of doc)</a> </p>
  836.  
  837. <hr>
  838.  
  839. <p><a name="brshmenu"></a></p>
  840.  
  841. <h3>The Brushes Menu</h3>
  842.  
  843. <p>
  844. &nbsp; Often you will have 'objects' that consist of several
  845. blocks, maybe a house or road or something, there is an easy way
  846. to put these in. First, put the blocks in the Map Editor as they
  847. are supposed to be layed out, then
  848. select <strong>Grab New Brush</strong> from the Brush menu, move the mouse pointer over
  849. one corner of the object you want to pick up as a brush, then
  850. hold down the left mouse button and move the mouse pointer to the
  851. opposite corner, you will see a bounding box as you do this.
  852. Release the left mouse button to finish picking the brush. You can
  853. name/rename a brush at any time by selecting Rename Current Brush. Now
  854. you will be able to paste the whole object anywhere on the map
  855. with a single click, the block the mouse pointer is over will be
  856. the corner of the brush specified by 'Handle'. You can reselect
  857. the brush at any time by selecting it from the Brushes menu, they
  858. are also saved with the map so you can use them when you load it
  859. next time. You can Fill with a brush as
  860. well, either tiling, or randomly, see <a href="#maped">Map Editor
  861. Window</a>. If you want to save a bit of space (and it will be a
  862. very small amount) choose the Destroy All Brushes option.<br>
  863. <br>
  864. &nbsp;<strong>Grab Brush</strong>. Works like Grab New Brush,
  865. except it will replace the currently selected brush.<br><br>
  866. &nbsp;<strong>Grab brush from block sequence</strong>. Allows you
  867. to make a brush from consecutive block structures without having
  868. to get them from the map. Size the Block Window so the area is
  869. aligned, select the top left block of the brush to grab, then
  870. select the bottom right block of the brush, then select
  871. 'Grab Brush from block sequence' in the Brushes menu and accept
  872. the defaults.<br>
  873. <br>
  874. &nbsp;<strong>Disable brush transparency</strong>. When selected,
  875. means that block 0 parts of the brush will overwrite when pasted
  876. rather than not affecting the map.<br>
  877. <br>
  878. &nbsp;<strong>Handle</strong>. Selects which corner of the brush
  879. is under the mouse pointer when it is placed in the map (useful
  880. for pasting the brush partially on the map).<br>
  881. <br>
  882. &nbsp;<strong>Brush</strong>. A list of the 16 brushes that can
  883. be created per map. Selecting a brush lets you paste it in the
  884. Map Editor window.<br>
  885. <br>
  886. &nbsp;<strong>Rename current brush</strong>. Lets you rename
  887. the currently selected brush.<br>
  888. <br>
  889. &nbsp;<strong>Destroy all brushes</strong>. Destroys all brushes
  890. in the map saving a (very small) amount of space.<br>
  891.  
  892. </p>
  893.  
  894. <p><a href="#topod">(top of doc)</a> </p>
  895.  
  896. <hr>
  897.  
  898. <p><a name="layrmenu"></a></p>
  899.  
  900. <h3>The Layers Menu</h3>
  901.  
  902. <p>&nbsp; There are two different layer systems in Mappy, one is
  903. Block Layers, which are the four layers associated with Block
  904. Properties, the other is Map Layers, which is what this menu
  905. manipulates. Map Layers are identical in size and shape to the
  906. numbers you specified in New Map's map width and map height. The
  907. idea is you can use a layer for games objects (like pickup items)
  908. or perhaps changes in a level when a lever is pulled in the game.
  909. The options in this menu are fairly self explanatory. If you just
  910. want to do a load of levels for a game with the same graphics and
  911. blocks, you can export the map array (the current layer) as a .MAR
  912. file and this
  913. will be much smaller than a whole .FMP file.<br><br>
  914. &nbsp; You can export and import layers as .MAR files, but
  915. the map you are working on MUST have identical blocks and be the
  916. same size. This is handy if you are doing a 100 level game as
  917. Mappy only handles 8 layers internally. Most playback libraries
  918. have a 'MapLoadMAR' function or similar to load new levels after
  919. loading the main FMP file for unlimited layer support.<br>
  920. <br>
  921. &nbsp;<strong>Add Layer</strong>. Adds a new layer and makes it
  922. the current layer.<br>
  923. &nbsp;<strong>Duplicate Layer</strong>. Adds a new layer, copies
  924. the current layer to it and makes the new layer the current layer.<br>
  925. &nbsp;<strong>Delete Layer</strong>. Deletes the current layer.<br>
  926. &nbsp;<strong>Clear Layer</strong>. Clears the current layer to
  927. block 0. You can fill the layer with a different block with the
  928. 'f' key.<br>
  929. &nbsp;<strong>Slide layer</strong>. Slides only the current layer
  930. in four directions, with optional wrapping, you can use 'undo'
  931. afterwards if you make a mistake.<br>
  932. &nbsp;<strong>Adjust values</strong>. (advanced), changes the
  933. block numbers in the current layer by a requested amount.<br>
  934. &nbsp;<strong>Remove marker graphics</strong>. Deletes graphics
  935. used by blocks on this layer, see also
  936. <a href="#markers">Using Marker Blocks</a>.<br>
  937. <br>
  938. &nbsp;<strong>Layer (0 to 7)</strong>. Select which layer to
  939. edit in the map.<br>
  940. <br>
  941. &nbsp;<strong>Onion Skin</strong>. Allows you to see transparently
  942. through a layer to one other selected layer, or all other layers.
  943. It's best to keep this
  944. feature off if you aren't using it. The current layer (ie the one
  945. which has the tick next to it in the layers menu) is the top
  946. layer which will be the one altered. The background layer is
  947. selectable in the Onion Skin dialogue and will be shown behind
  948. the current layer, you can optionally make this appear darker so
  949. the current layer stands out more. The background layer is drawn
  950. as a guide and will not be altered when you are editing the
  951. current layer. Remember to switch it off when you've finished,
  952. and selecting a layer that doesn't exist for the background is
  953. not advisable :) Loading a map will switch off onion skin.<br>
  954. <br>
  955. &nbsp;<strong>Background layers darkened</strong>. Toggles
  956. darkening of the non-current layers (for example with onion skin
  957. or object layer).</p>
  958.  
  959. <p><a href="#topod">(top of doc)</a> </p>
  960.  
  961. <hr>
  962.  
  963. <p><a name="cstmmenu"></a></p>
  964.  
  965. <h3>The Custom Menu</h3>
  966.  
  967. <p>
  968. &nbsp;<strong>Mousebuttons</strong>. You can define which action
  969. each button performs. Drag map allows you to scroll the map
  970. by holding the button and dragging the mouse over the Map Editor
  971. window. Placer.lua runs the Placer.lua script in the luascr folder.
  972. <br><br>
  973. &nbsp;<strong>Lua scripts</strong>. The rest of this menu contains
  974. a list of lua scripts which can be defined in the mapwin.ini file.
  975. Some example scripts are provided in the luascr folder, they are
  976. just text files with a .lua extension. For information on the
  977. MappyWin32 lua interface, please see the
  978. <a href="luascript.html">MappyWin32 Lua scripting documentation</a>.</p>
  979.  
  980. <p><a href="#topod">(top of doc)</a> </p>
  981.  
  982. <hr>
  983.  
  984. <p><a name="scuts"></a></p>
  985.  
  986. <h3>Shortcuts</h3>
  987.  
  988. <p>&nbsp; This is a list of shortcut keys, excluding those listed next
  989. to items in the menus (see the menus for these, for example ctrl+m is new map).
  990. Be sure you don't have caps lock on:<br><br>
  991. f = fill area with current block/brush (from mousepointer)<br>
  992. ctrl+f = fill area with current brush randomly (from mousepointer)<br>
  993. l = draw a line from last placed block to mousepointer (8 directions)<br>
  994. o = toggle picklayer (isometric)<br>
  995. p = pick (select) current block/anim from under mouse pointer<br>
  996. , = (comma) select previous numbered block/anim<br>
  997. . = (fullstop) select next numbered block/anim<br>
  998. e = edit current block/anim properties<br>
  999. cursor keys = scroll map<br><br>
  1000. &nbsp;You can also set the function keys and number keys (main keyboard)
  1001. to any function you want, you will need to change the values in the
  1002. <a href="#mapini">mapwin.ini</a> file to any of these values (so keyF2=400
  1003. will run the first lua script in the custom menu when F2 is pressed,
  1004. keyF3=124 will change to layer 1 when F3 is pressed etc):<br><br>
  1005. <br>
  1006. LUA01 to LUA16: 400 to 415,
  1007. EDITBLKPROP 182,
  1008. LAYERBGDARK 181,
  1009. TOOLDIVIDERS 180,
  1010. TOOLROTATILES 179,
  1011. TOOLHALVEBLOCKDIMENSIONS 178,
  1012. TOOLSAVENOGFX 177,
  1013. FILEEXPORTTEXT 176,
  1014. CUSTOMBUTTONS 175,
  1015. TOOLIMPORTBIG 174,
  1016. TOOLUSERINFO 173,
  1017. LAYERDUPLICATE 172,
  1018. TOOLFLIPTILES 171,
  1019. TOOLZOOM025 170,
  1020. TOOLZOOM05 169,
  1021. TOOLRESIZETILES 168,
  1022. TOOLAUTOBG 167,
  1023. TOOLLINE 166,
  1024. BRUSHGRABNEW 165,
  1025. LAYERADJUSTVALUES 164,
  1026. LAYERREMOVEMARKERS 163,
  1027. BRUSHHANDLEBR 162,
  1028. BRUSHHANDLEBL 161,
  1029. BRUSHHANDLETR 160,
  1030. BRUSHHANDLETL 159,
  1031. TOOL16X16TO8X8 158,
  1032. LAYERSLIDE 156,
  1033. PICKLAYER 155,
  1034. TOOLPILLARS 154,
  1035. TOOLREVEAL 153,
  1036. FILEIMPORTALT 152,
  1037. BRUSHRENAME 151,
  1038. BRUSHGRABBS 150,
  1039. BRUSHGRABNT 149,
  1040. TOOLRANGE 148,
  1041. LAYERCLEAR 137,
  1042. LAYERONION 147,
  1043. TOOLZOOM4 146,
  1044. TOOLZOOM2 145,
  1045. TOOLZOOM1 144,
  1046. TOOLREMOVEUNUSED 141,
  1047. BRUSHDESTROY 140,
  1048. TOOLANIMSETUP 139,
  1049. TOOLANIMPREVIEW 138,
  1050. EDITUNDO 135,
  1051. TOOLFILLRANDOM 210,
  1052. TOOLFILL 209,
  1053. TOOLINFO 134,
  1054. TOOLGRID 208,
  1055. FILEEXPORT 133,
  1056. TOOLRESIZE 132,
  1057. LAYER0 to LAYER7: 123 to 130,
  1058. LAYERDELETE 122,
  1059. LAYERADD 121,
  1060. PICKBLOCK 207,
  1061. BLOCKNEXT 206,
  1062. BLOCKPREV 205,
  1063. ARROWRIGHT 203,
  1064. ARROWLEFT 202,
  1065. ARROWDOWN 201,
  1066. ARROWUP 200,
  1067. HELPABOUT 120,
  1068. HELPCONTENTS 119,
  1069. BRUSH1 to BRUSH16: 300 to 315,
  1070. BRUSHGRAB 110,
  1071. EDITPASTE 109,
  1072. EDITCOPY 108,
  1073. EDITCUT 107,
  1074. EDITNEW 131,
  1075. FILEEXIT 106,
  1076. FILEIMPORT 105,
  1077. FILEIMPORTAT 136,
  1078. FILESAVEAS 104,
  1079. FILESAVE 103,
  1080. FILENEW 102,
  1081. FILEOPEN 101
  1082. </p>
  1083.  
  1084. <p><a href="#topod">(top of doc)</a> </p>
  1085.  
  1086. <hr>
  1087.  
  1088. <p><a name="howit"></a></p>
  1089.  
  1090. <h3>How It Works</h3>
  1091.  
  1092. <p>&nbsp; I have designed Mappy to hopefully be expandable,
  1093. produce small mapfiles with lots of features, and most
  1094. importantly be fast and easy to playback. The FMP format (how the
  1095. maps are stored) is a 'chunk' based format which allows all the
  1096. information for the map (graphics, array, anims, block data etc)
  1097. to be stored in a single file, you can also add your own chunks
  1098. to this file if you want, more details in <a href="#fmpform">FMP
  1099. file format</a>.The <a href="#playlib">playback libraries</a>
  1100. then provide functions to load and play the map within your game.
  1101. MappyWin32 can also read and write custom MAP formats, see
  1102. <a href="#simple">Using Mappy as a simple map editor</a> and
  1103. export map information as text for GBA etc.<br>
  1104. <br>
  1105.  
  1106. &nbsp; The map editor comes in several versions, this
  1107. documentation is concerned with the Win32 version. To make a FMP map
  1108. from scratch, you will need to make, or get some 'tile graphics'
  1109. (if you don't know what some of these terms mean, see the <a
  1110. href="#glossary">glossary</a>) and
  1111. import them into a map (see next section). It is important to be
  1112. aware of the hierarchy of the objects within Mappy, you have the
  1113. top level which is the <font color="#FF0000">Map Array</font>
  1114. (this is shown in the Map Editor window), the elements in that
  1115. are short int offsets to either <font color="#FF0000">Block
  1116. Structures</font> if they are positive, or <font color="#FF0000">Anim
  1117. Structures </font>if they are negative, <font color="#FF0000">Anim
  1118. Structures</font> contain offsets to <font color="#FF0000">Block
  1119. Structures</font>, <font color="#FF0000">Block Structures</font>
  1120. have 4 offsets to the <font color="#FF0000">Graphics Blocks</font>
  1121. (amongst other things).</p>
  1122.  
  1123. <p>MapArray ------&gt; Block Structures --------&gt; Graphics Blocks<br>
  1124. ......\............................/<br>
  1125. ........\Anim Structures/</p>
  1126.  
  1127. <p>&nbsp; That's about as much as you need to know if you don't
  1128. intend adding your own objects, linked lists etc and are going to
  1129. use the playback libraries.</p>
  1130.  
  1131. <p><a href="#topod">(top of doc)</a> </p>
  1132.  
  1133. <hr>
  1134.  
  1135. <p><a name="imgfmts"></a></p>
  1136.  
  1137. <h3>Supported image formats (BMP, PCX, PNG, TGA)</h3>
  1138.  
  1139. <p>&nbsp;MappyWin32 can import the following graphic formats:<br><br>
  1140. 8bit (paletted) maps:<br>
  1141. <strong>BMP</strong> - 8bit (uncompressed)<br>
  1142. <strong>PCX</strong> - 8bit<br>
  1143. <strong>PNG</strong> - 4bit and 8bit (4bit is converted to 8bit on importing)<br>
  1144. <strong>TGA</strong> - 8bit<br>
  1145. Transparency is by a nominated palette index in MapTools:Map Properties<br><br>
  1146. <br>
  1147. 15/16/24/32bit (truecolour) maps (graphics are converted to the map depth on importing):<br>
  1148. <strong>BMP</strong> - 8bit (uncompressed) and 24bit<br>
  1149. <strong>PCX</strong> - 8bit and 24bit<br>
  1150. <strong>PNG</strong> - 4bit, 8bit, 24bit, 32bit (with alpha on 32bit maps)<br>
  1151. <strong>TGA</strong> - 8bit, 24bit, 32bit (with alpha on 32bit maps)<br>
  1152. Transparency is by a nominated RGB value in MapTools:Map Properties<br><br>
  1153.  
  1154. &nbsp;Alpha channel is only supported in 32bit maps, and where a playback
  1155. library supports it (eg: MappyGL). Alpha channel is shown in MappyWin32 V1.4.19 or later.<br>
  1156. <br>
  1157. &nbsp;To use PNG format, two extra files are needed, <strong>libpng12.dll</strong>
  1158. and <strong>zlib.dll</strong>. These are available from the tilemap.co.uk site
  1159. and many other places and should be placed in the same folder as mapwin.exe.<br>
  1160. <br>
  1161. &nbsp;When loading a MAP format map file, PNG and TGA are not supported. If you
  1162. need to use PNG or TGA with a MAP, either save the MAP from a FMP map, or
  1163. just keep a copy of your tile graphics in BMP or PCX format.
  1164. </p>
  1165. <p><a href="#topod">(top of doc)</a> </p>
  1166.  
  1167. <hr>
  1168.  
  1169. <p><a name="simple"></a></p>
  1170.  
  1171. <h3>Using Mappy as a simple map editor (.MAP format)</h3>
  1172.  
  1173. <p>&nbsp; Mappy is designed for creating and editing FMP maps, these have all
  1174. the features listed in the <a href="#features">features</a> section, and this
  1175. is the format supported by the playback libraries. However, sometimes you may
  1176. want to use a simpler format, and in Mappy this is MAP.<br><br>
  1177. &nbsp; New in version 1.2 of MappyWin32 is the ability to edit
  1178. 'simple' maps. These maps lose nearly all the features of FMP, but
  1179. you can use them without a playback library, often with the built-in
  1180. functions of other packages. These maps have the .MAP extension,
  1181. rather than .FMP, and only contain the width and height of the map array
  1182. (optional) and the map array itself in a format of your choosing. When editing
  1183. a MAP you should not use features of Mappy that can't be saved in a .MAP
  1184. (such as animated blocks and block properties) as these will be lost
  1185. on exit. To configure the format of the .MAP files see the
  1186. <a href="#mapform">MAP format</a> section.<br><br>
  1187. &nbsp; To create a new simple MAP, ensure you have set the correct format (see
  1188. <a href="#mapini">mapwin.ini</a>) and use New Map from the File menu. Next,
  1189. select Import from the File menu, and choose your image file with the blocks in.
  1190. You can now edit the map. To save a
  1191. MAP rather than a FMP, simply select 'Save as' from the
  1192. File menu, but type the name to save with a .map extension, for example
  1193. <strong>level1.map</strong> you will be notified you are saving a MAP. That's it!
  1194. You can now use the 'Save' option to save your map with the same name. Please
  1195. note that if you have a negative adjustment when you save the map, any blocks
  1196. that would be made negative become 0, for example, with -1 adjustment, block 0
  1197. will not change on save, all others will become 1 less. On load, all become +1
  1198. so there will be no block 0. This may sound confusing, but really it just means
  1199. block 0 will become block 1 so don't be surprised when you reload the map (block
  1200. 0 is not valid with -1 adjustment) try it and you'll see... If you want to avoid
  1201. such confusion, simply fill the map with block 1 at the start.<br>
  1202. <br>
  1203. &nbsp; Using the .map format you can create files compatible with CDXMap, CDXIsoMap,
  1204. and many other custom formats.<br><br>
  1205. &nbsp; To load a .MAP, simply select Open from the File menu and open it. For the
  1206. tiles, Mappy will try to load the mapdefBMP specified in mapwin.ini, if that
  1207. doesn't exist, it will try the map name with a .BMP extension (so
  1208. <strong>level1.map</strong> will try <strong>level1.bmp</strong> in the same folder),
  1209. if these don't exist it will ask you for a BMP file to use.<br>
  1210. <br>
  1211. &nbsp; Most of the rest of this documentation is to do with FMP files, which have
  1212. much more advanced features, so if you are just doing a MAP they are not relevant.
  1213. You can save a FMP as a MAP and a MAP as a FMP by changing the name when you
  1214. 'Save As'. MAP files can't store all the information from FMP maps, so this
  1215. conversion may not be useful for complex FMP maps.<br>
  1216. <br>
  1217. &nbsp; If neither .MAP or .FMP are suitable, you can write a
  1218. <a href="#cstmmenu">lua script</a> to import and export data in a custom format.<br>
  1219. </p>
  1220.  
  1221. <p><a href="#topod">(top of doc)</a> </p>
  1222.  
  1223. <hr>
  1224.  
  1225. <p><a name="isohex"></a></p>
  1226.  
  1227. <h3>Important information about FMP1.0, Isometric/Hexagonal/other maps</h3>
  1228.  
  1229. <strong>FMP1.0</strong><br>
  1230. <p>&nbsp; The difference between this and the older FMP format is that this
  1231. allows up to 30000 blocks, rather than 1024. Also, wherever a value was saved
  1232. as a byte offset, it is now a 'unit' offset. The downside is you need a playback
  1233. library that supports FMP1.0. You can freely change between FMP versions in
  1234. MapTools&gt;Map Properties as long as you have 1024 blocks or fewer.
  1235. </p><br><br>
  1236. <strong>Isometric/Hexagonal/other maps</strong><br>
  1237. <p>&nbsp; This is a new feature added in version 1.3 of MappyWin32. If you are
  1238. making a map with non-rectangular tiles there are a few things you should be
  1239. aware of. Firstly, they are always drawn transparently (obviously), so if you use
  1240. block 0, this will leave trails when you scroll in Anim Preview or a playback library, so
  1241. it is best not to use block 0, fill the map with block 1 at the start. Next, you will need a playback
  1242. library that supports FMP1.0 (this should be clearly stated in the playback library),
  1243. even though you can save as FMP0.5. The 'clickmask' MUST be set in MapTools&gt;Map Properties.
  1244. This should be the number of the graphic to detect transparent areas which allows the
  1245. editor to let you click tiles pixel-perfectly, normally 1 or 2. If you are editing a
  1246. .MAP rather than a .FMP, you should set the values correctly in
  1247. <a href="#mapini">mapwin.ini</a> for stagger and clickmask. The Block Parallax
  1248. functions are not supported. Non-rectangular tiles also take longer to draw.<br><br>
  1249. &nbsp;
  1250. As from version 1.3.1 Mappy now supports true isometric. This means that you can have
  1251. scenery that appears to rise out of the ground, and will be properly depth sorted
  1252. with both other scenery and sprites etc you may have in your game. In order to do
  1253. this, there is now a new mode which you must set by selecting MapTools:Riser mode.
  1254. To make a pillar you must first create a new block (Ctrl+N),
  1255. then select a BG graphic as usual, but the FG fields now work differently.
  1256. FG1 will overlay BG, FG2 will appear immediately above FG1, and the FG3 will
  1257. appear above FG2 (rather than overlaying it). What's that? It's not tall enough?
  1258. That's OK you can create a chain of blocks to stack on top of each other which
  1259. will be treated as just one pillar. To do this, simply check the left most of
  1260. the three 'other' boxes and the following block will be used to continue the
  1261. pillar. Any blocks which are attached will treat BG as an FG field. Attached blocks
  1262. will have a red border in the Blocks window (if Grid is on), indicating you
  1263. shouldn't use them directly.<br><br>
  1264. Isometric can be quite tricky to do, so I'd recommend looking up some information
  1265. about it on the 'net. Not all block sizes tile properly, 64x31 with block gap
  1266. 64x32 and block stagger 32x16 works well. I'll probably do a proper Mappy
  1267. Tutorial for Isometric at some point in the future...<br><br>
  1268. Version 1.3.6 now allows you to draw the left or right half of pillars by checking
  1269. the 2nd (for left) or 3rd (for right) boxes of the 'Others' in block properties.
  1270. See iso_lr.fmp for an example, and iso_lr.bmp (in maps) to see the graphics I used.
  1271. This is common for isometric as it vastly reduces overlapping.
  1272. Also in 1.3.6 you can now specify a 'picklayer' in <a href="#mapini">mapwin.ini</a>
  1273. to allow easier picking of pillars (the blocks window is a bit confusing). Create
  1274. the picklayer just like a normal layer (in layers menu) and place your pillars on it.
  1275. Change back to your original layer, then just
  1276. press 'o' (the letter, not zero) to toggle between current layer and picklayer, move
  1277. mouse to base of pillar you want then press 'p', then 'o' again to return.<br><br>
  1278. I added Isometric to MappyWin32 as it was requested and easy to do, however there
  1279. are a couple of things which may be worth noting, and if they are a problem, you
  1280. should perhaps try a different isometric editor. The first is that the isomaps
  1281. are stored staggered, rather than the more common and easier to use rotated diamond
  1282. shape maps which means pathfinding etc in games is trickier to implement. You
  1283. could write a lua script to save as a diamond shape map. The
  1284. second is that the pillars are made out of block sized parts.
  1285.  
  1286. </p>
  1287.  
  1288. <p><a href="#topod">(top of doc)</a> </p>
  1289.  
  1290. <hr>
  1291.  
  1292. <p><a name="hexhlp"></a></p>
  1293. <p>
  1294. Here is some brief information on using the staggered row maps produced by Mappy.
  1295. A staggered row map has all the odd rows offset by an x and y stagger value which
  1296. allows you to make hexagonal and isometric maps. This document is most helpful
  1297. if you are using a 'sprite array' see Mappy Tutorial 1, or the isometric examples
  1298. in MappyAL or MappyDX for more info on sprite arrays.<br><br>
  1299.  
  1300. <h3>Hexagonal</h3>
  1301. <p>
  1302. First, hex maps, here is a diagram
  1303. showing how to get to an adjacent hex from a hex at x, y (block coords, as shown in
  1304. Mappy's titlebar). There are two diagrams, use whichever your hexes resemble:<br><br>
  1305. <img src="images/hexdiag1.gif"><br><br>
  1306. So, to get from x, y to the adjacent hex to the right and above, use a bit of code
  1307. like this:<br><br>
  1308. <strong>
  1309. int a = 1-(y&amp;1);<br>
  1310. x = (x-a)+1;<br>
  1311. y = y-1;<br><br>
  1312. </strong>
  1313. To convert your block coords to pixel coords, use:<br><br>
  1314. <strong>
  1315. px = x*mapblockgapx;<br>
  1316. py = (y/2)*mapblockgapy;<br>
  1317. if (!(y&amp;1)) {    //an even (not staggered) row<br>
  1318. // start of the map (0,0)  is offset by the stagger values<br>
  1319.          px -= mapblockstaggerx;<br>
  1320.          py -= mapblockstaggery;<br>
  1321. }<br>
  1322. px += mapblockwidth/2;    // centre of block<br>
  1323. py += mapblockheight/2;<br><br>
  1324. </strong>
  1325.  
  1326. So now if you draw a pixel at px-scrlx, py-scrly (where scrlx and
  1327. scrly are the coords you pass to MapDraw) it should be in the centre
  1328. of the block.<br><br>
  1329. <p><a href="#topod">(top of doc)</a> </p>
  1330.  
  1331. <hr>
  1332.  
  1333. <p><a name="isohlp"></a></p>
  1334. <h3>Isometric</h3>
  1335. <p>
  1336. The most common type of isometric map is the rotated/diamond type, but Mappy
  1337. produces a staggered row isometric map. If you really want to use a rotated/diamond
  1338. type you can change the playback libs to convert them on loading. Here's how they
  1339. compare:<br><br>
  1340. <img src="images/isodiag1.gif"><br><br>
  1341. To move one block in any direction use the following guide:<br><br>
  1342. <img src="images/isodiag2.gif"><br><br>
  1343. So, to get from x, y to the adjacent iso to the right and above, use a bit of code
  1344. like this (same as for the hex maps):<br><br>
  1345. <strong>
  1346. int a = 1-(y&amp;1);<br>
  1347. x = (x-a)+1;<br>
  1348. y = y-1;<br><br>
  1349. </strong>
  1350. To convert your block coords to pixel coords (same as for the hex maps), use:<br><br>
  1351. <strong>
  1352. px = x*mapblockgapx;<br>
  1353. py = (y/2)*mapblockgapy;<br>
  1354. if (!(y&amp;1)) {    //an even (not staggered) row<br>
  1355. // start of the map (0,0)  is offset by the stagger values<br>
  1356.          px -= mapblockstaggerx;<br>
  1357.          py -= mapblockstaggery;<br>
  1358. }<br>
  1359. px += mapblockwidth/2;    // centre of block<br>
  1360. py += mapblockheight/2;<br><br>
  1361. </strong>
  1362.  
  1363. So now if you draw a pixel at px-scrlx, py-scrly (where scrlx and
  1364. scrly are the coords you pass to MapDraw) it should be in the centre
  1365. of the block. If you are using a sprite array MapDrawRow is usually better.<br><br>
  1366. <h3>Moving anywhere on a staggered row isometric map</h3>
  1367. This is more complex to understand than a rotated map, but you can use a
  1368. function like this to make it
  1369. as easy (and pretty much the same) as using a rotated style map, just copy and paste
  1370. into your source:<br><br>
  1371. <strong>
  1372. void IsoMove (int ew, int ns, int * x, int * y)<br>
  1373. // ew = negative is west movement, positive is east<br>
  1374. // ns = negative is north movement, positive is south<br>
  1375. // x and y are coords to modify<br>
  1376. {<br>
  1377. int a = ew-ns;<br>
  1378. if (a&gt;0) a++;<br>
  1379. y[0] += ew+ns;<br>
  1380. x[0] += a/2;<br>
  1381. if ((y[0]&amp;1) && ((ew+ns)&1)) x[0]--;<br>
  1382. }<br><br>
  1383. </strong>
  1384.  
  1385. So, I can use this bit of example code to move 4 squares northward (as in the direction
  1386. shown in the comparison diagram above) and 3 squares east:<br><br>
  1387. <strong>
  1388. int myx = 7; //start at block at 7, 7<br>
  1389. int myy = 7;<br>
  1390. IsoMove (3, -4, &amp;myx, &amp;myy); // negative values are north or west, positive south or east<br><br>
  1391. </strong>
  1392. <br>
  1393. </p>
  1394.  
  1395. <p><a href="#topod">(top of doc)</a> </p>
  1396.  
  1397. <hr>
  1398.  
  1399. <p><a name="designc"></a></p>
  1400.  
  1401. <h3>Design Considerations</h3>
  1402.  
  1403. <p>&nbsp; Before spending hours on a huge project it is important
  1404. to think about various aspects of it, what size are the tiles
  1405. going to be? What resolution(s) and colour depth(s) is the game
  1406. going to run in? What sort of view is it going to have (overhead,
  1407. side, oblique, isometric)? How are the other game objects going
  1408. to interact with the map? If you haven't done many tile based
  1409. games before, it may be best to do a very simple pacman or
  1410. shootemup project, just to get the hang of things.<br>
  1411. <br>
  1412. &nbsp;I would recommend
  1413. that the width of the tile is a multiple of 4 (better memory
  1414. alignment), try 16pixels wide by 16pixels high for low res games
  1415. (320*240, 320*200) or 32*32pixels for 640*480 screen resolutions.<br>
  1416. <br>
  1417. &nbsp; Remember that computers are advancing all the time, try to
  1418. support multiple colour depths and resolutions (if you think it's
  1419. worth it), also consider doing your map in 24bit colour even if
  1420. you are aiming for a 16bit screen, with an option to select any
  1421. high colour depth, MappyDX supports colour conversion, check the
  1422. docs for the other libs, of course, 24bit colour uses more disk
  1423. space than 16bit. If you are aiming for a lowspec machine with a
  1424. low resolution (such as VGA 320*200) use the Zoom option to get a
  1425. better idea of the graphic size in Mappy, also if you know you
  1426. aren't going to be able to access the video acceleration on the
  1427. videocard (for example using VESA under DOS) bear in mind there
  1428. will be a huge performance hit (the Anim Preview in MappyWin32
  1429. uses DirectDraw blitter acceleration found on almost all graphic
  1430. cards)...<br>
  1431. <br>
  1432. &nbsp; The FMP file is ready to use from the first time you save
  1433. it, so it makes sense to develop your game code at the same time
  1434. as the map so you can see how things work and how fast they go,
  1435. also remember to adjust the preview setup in MappyWin32 to the
  1436. screen res. you are going to use...<br>
  1437. <br>
  1438. &nbsp; When making your graphics for tiles, use a picturesize
  1439. that is a multiple of the tilesize, for example 32*32 and 16*16
  1440. tiles fit nicely on a 640*480 or 320*240 picture.<br>
  1441. <center><img src="images/TEST.BMP" alt="How to make the graphics"></center><br>
  1442. </p>
  1443.  
  1444. <p><a href="#topod">(top of doc)</a> </p>
  1445.  
  1446. <hr>
  1447.  
  1448. <p><a name="comline"></a></p>
  1449.  
  1450. <h3>Commandline options</h3>
  1451.  
  1452. <p>&nbsp; Most of the time, you can just double click the mapwin.exe
  1453. icon or set up a shortcut to it. You can, though, run from a
  1454. commandline or .bat file, just type mapwin (or mapwin.exe) from the
  1455. correct directory, then optionally add a lua script and map file.
  1456. Here's a couple of examples:<br><br>
  1457. mapwin MAPS/TEST.FMP<br>
  1458. mapwin "luascr/Tile graphic test.lua" maps/test.fmp<br><br>
  1459. filenames with spaces must be in quotes. A handy hint, use:
  1460. mappy.sendMessage (106, 0) to exit the editor from a lua script,
  1461. the '106' is the FILEEXIT code, see 'Key Shortcuts' for more)<br>
  1462. </p>
  1463.  
  1464. <p><a href="#topod">(top of doc)</a> </p>
  1465.  
  1466. <hr>
  1467.  
  1468. <p><a name="textstr"></a></p>
  1469.  
  1470. <h3>TextStrings and Labels</h3>
  1471.  
  1472. <p>&nbsp; You can add TextStrings to a map by selecting Custom:Set Text Strings.
  1473. Your strings should be on seperate lines in a .txt file. You will be prompted for
  1474. the textfile and which user data field you want the string index to be stored in.
  1475. These strings can be changed in the properties dialogues for blocks and objects,
  1476. they will change the value in the user field you set. These text strings can be
  1477. seen if enabled in MapTools:Show user info on tile (choose the user field you
  1478. chose for the text strings). Text strings are stored in the FMP map file in
  1479. the TSTR chunk, the first int is the offset to the strings.</p>
  1480.  
  1481. <p><a href="#topod">(top of doc)</a> </p>
  1482.  
  1483. <hr>
  1484. <p><a name="markers"></a></p>
  1485.  
  1486. <h3>Using Marker Blocks</h3>
  1487.  
  1488. <p>&nbsp; These are blocks which can be used to identify
  1489. properties in the map. You can use the fields in Block
  1490. Properties to indicate what a block does, which is
  1491. parsed by your game. Usually you make some tile graphics
  1492. with symbols on them for marker blocks, such as an arrow
  1493. pointing left to show this block would push you left,
  1494. or a start location graphic. Use the transparency colour
  1495. to let you overlay them on other tiles.<br>
  1496. <br>
  1497. &nbsp;Normally, you would not want these symbols to be
  1498. visible in your game, just the editor. A good way to do
  1499. this is to use the FG3 field in a block's properties,
  1500. which will show up in the editor, but not in your game
  1501. if you don't draw the FG3 field. Alternatively, you
  1502. can make a new layer (from the Layers menu), use onionskin
  1503. and put your marker blocks on this 'object layer'. Your
  1504. game can then parse this layer to find where objects start.
  1505. When you finish your map, you can remove these marker
  1506. graphics with 'Remove marker graphics' from the Layers menu
  1507. if you want.<br>
  1508. <br>
  1509. &nbsp;Another way to see what properties a block has is
  1510. to use 'Show user info on tile' in the MapTools menu.
  1511. This will overlay one of the block properties fields
  1512. on the tile.<br>
  1513. <br>
  1514. &nbsp;For a grid overlaying your whole map, use dividers
  1515. (in the MapTools menu) set to the width and height of your
  1516. tiles.<br>
  1517. <br>
  1518. &nbsp;Tip to find what graphic number a tile is: Click
  1519. the icon above 'BG' in a block's properties, find the
  1520. graphic you want and click it, note the number and click
  1521. 'cancel' so you don't change the block.<br>
  1522. <br>
  1523. &nbsp;Tip: Creating new blocks (ctrl+n) uses only 32 bytes
  1524. per block, you can edit the properties and share graphics
  1525. with other blocks.<br>
  1526. <br>
  1527. &nbsp;See 'Mappy Tutorial 1' for more information about
  1528. marker blocks, it can be downloaded from www.tilemap.co.uk<br>
  1529. <br>
  1530. &nbsp;See also <a href="#textstr">TextStrings and Labels</a><br>
  1531. </p>
  1532.  
  1533. <p><a href="#topod">(top of doc)</a> </p>
  1534.  
  1535. <hr>
  1536.  
  1537. <p><a name="expgba"></a></p>
  1538.  
  1539. <h3>Exporting map for GBA</h3>
  1540.  
  1541. <p>&nbsp; Download GBAMappy at www.tilemap.co.uk for full examples, sourcecode and tutorial on how to do this. In brief:<br><br>
  1542. Remember, setting flippedtiles=1 in mapwin.ini (remember to restart mappy) or selecting 'flipped tiles mode' from the MapTools menu lets you use flipped tiles
  1543. in the 'Block Properties' dialogue (copy a block with ctrl+c then double click it and change it):<br>
  1544. Also, remember, MapTools:Anim Preview will not show the tiles flipped<br>
  1545. You can change the csvadjust value in mapwin.ini to adjust numbers up and down<br>
  1546. Make a FMP map in 8bit with either 8x8 or 16x16 tiles.<br>
  1547. SAVE the original FMP map, you will probably want to keep this for further editing etc<br>
  1548. If you used 16x16 tiles, and you want to have an 8x8 map, when you want to export use Maptools:Convert 16x16... (may take several seconds).<br>
  1549. You can keep your map as 16x16 though if you want, each graphic tile will then be exported as 4 consecutive 8x8 tiles in blockgfx (so for each tile 4 graphics will need to be set)<br>
  1550. I found keeping 16x16 tiles to take up the least space in most cases as an 8x8 map requires 4 times the memory for the array<br>
  1551. Select MapTools:Remove Unused or Duplicate, if you have flippedtiles=1 in mapwin.ini even flipped duplicates are removed and flip bits set which can save a lot of tiles if you have planned your graphics<br>
  1552. Select File:Export: and tick 'Data as text' then OK<br>
  1553. Select preferred options then OK, note the filename ending in .txt<br><br>
  1554. Some of the following information is as yet untested, so maybe some mistakes:<br>
  1555. Copy the .txt file and gbamappy.h to your source directory<br>
  1556. You can now add this include to your GBA source file:<br>
  1557. #include "mapdefs.h"<br>
  1558. #include "filename.txt"<br>
  1559. If you chose 2D array and have no anims you can access the map like this (maparray will have a layer number after it if you chose 'all layers' eg: maparray0[y][x]):<br>
  1560. <strong>
  1561. tileindex = blockstr[maparray[y][x]].bgoff;<br>
  1562. </strong>
  1563. If you don't export block structures, the bg field will be used in maparray (Auto resolve BG), you can use maparray[y][x] as your tileindex<br>
  1564. If you enable 'merge flipbits' these will be merged to bits 10 and 11 of the tile fields of the block structures, or if you don't enable the block structures the flip bits will be merged with the BG field and written into the maparray<br>
  1565. <strong>Tip:</strong>You could specify the bank number in a user field to choose a different colour set for a tile with same graphics<br>
  1566. <strong>Tip:</strong>If you uncheck the 'Anim and Block structure data' box, the maparray will autoadjust to store the tileindex (with flipbits if you also check 'merge flipbits' and bank number if 16 colour tilesfrom the User7 field)<br>
  1567. If you have animations, use this<br>
  1568. <strong>
  1569. if (maparray[y][x]&lt;0) tileindex = blockstr[animseq[animstr[-maparray[y][x]].ancuroff]].bgoff;<br>
  1570. else tileindex = blockstr[maparray[y][x]].bgoff;<br>
  1571. </strong>
  1572. If you want code to get the map to animate, adapt the MapUpdateAnims function from MappyAL (easy)<br><br>
  1573. 256 colour tiles: tileindex*64 is the byte offset for the tile graphics in blockgfx[] (as each tile graphic is 64bytes)<br>
  1574. 16 colour tiles: tileindex*32 is the byte offset for the tile graphics in blockgfx[] (as each tile graphic is 32bytes)<br>
  1575. flip information is held in the unused2 (fliph) and unused3 (flipv) fields of blockstr[?]<br><br>
  1576. <strong>Important</strong>. Although the blockgfx are saved as unsigned char, you need to write them to GBA video memory 16bits at a time, cast it to unsigned short.<br>
  1577. I made a test GBA application with devkitadvance and it seemed to work fine. If any GBA developer would like to provide a proper example it would be appreciated. Also note the utility FMP2GBA available from www.gbadev.org<br>
  1578. </p>
  1579. <p><a href="#topod">(top of doc)</a> </p>
  1580.  
  1581. <hr>
  1582.  
  1583. <p><a name="playlib"></a></p>
  1584.  
  1585. <h3>The Playback Libraries</h3>
  1586.  
  1587. <p>&nbsp; A large part of Mappy are the playback libraries, these
  1588. allow you to easily load, manipulate, display, animate and scroll
  1589. maps stored in .FMP files with a few simple function calls. You can
  1590. get these from the Mappy Homepage, all source is supplied so you
  1591. can modify them as you like. At the time of writing, there are
  1592. MappyDX, for C++ compilers with the DirectX SDK, this editor uses
  1593. a modified version for its Anim Preview, MappyAL (older
  1594. versions were called MappyPB), MappyJV, MappyGL, CDXMappy and
  1595. SDLMappy and many others. Visit www.tilemap.co.uk for a full list.
  1596. You do not have to use these
  1597. libraries, you could write your own, but they are very
  1598. convenient.</p>
  1599. <p>&nbsp; The playback libraries are also an excellent way to add
  1600. more abilities to the editor. For example, you could build a sprite
  1601. editor with them for your game.</p>
  1602.  
  1603. <p><a href="#topod">(top of doc)</a> </p>
  1604.  
  1605. <hr>
  1606.  
  1607. <p><a name="fmpform"></a></p>
  1608.  
  1609. <h3>The FMP file format</h3>
  1610.  
  1611. <p>&nbsp; This is technical information about the FMP file structure.
  1612. You do not need to know this if you are using the playback libraries<br><br>
  1613. The first 12 bytes are as follows:<br>
  1614. 4bytes ASCII = 'FORM'<br>
  1615. long int = size of file less header (which is filesize-8)<br>
  1616. 4bytes ASCII = 'FMAP'<br>
  1617.  
  1618. NOTE: The chunk size long ints like the one above are stored in Motorola
  1619. format, NOT Intel. You will have to byteswap to get the correct value, ie:
  1620. Bytes 1,2,3,4 need to become 4,3,2,1.<br><br>
  1621.  
  1622. The chunks in the file follow on one after the other, and consist of an 8byte
  1623. header, and the information specific to that chunk. See how the playback source reads
  1624. in the information. The chunks can be in any order, and some chunks may not
  1625. be used in a particular file. Also, don't rely on chunks being a certain size, for
  1626. example the MPHD is now 4 bytes bigger than in the last version<br><br>
  1627.  
  1628. Chunk header:<br>
  1629. 4bytes ASCII = ChunkID (example: 'MPHD')<br>
  1630. long int = size of chunk data less header<br><br>
  1631.  
  1632. These are the chunks as of V1.2:<br>
  1633. ATHR - Up to 4 ASCII strings of author information, separated by 0 values,
  1634.                  always an even size.<br>
  1635. MPHD - Map header, see struct in the editor source download<br>
  1636. EDHD - Editor information, see struct in mappy.c<br>
  1637. CMAP - Colour palette for 8bit maps, red byte, green byte, blue byte for
  1638.                  however many colours are needed (so usually 256*3 bytes).<br>
  1639. BKDT - Block data. Contains BLKSTR structures for however many block
  1640.                  structures were made.<br>
  1641. ANDT - Animation data. Contains ANISTR structures for however many
  1642.                  animation structures were made, and also animation data.<br>
  1643. BGFX - The raw graphics in whatever format the map is in. Examples: 8bit:
  1644.                  mapwidth*mapheight bytes per block, in forward format *numblocks
  1645.                  16bit: mapwidth*mapheight*2 bytes per block, each word contains
  1646.                  5 bits red, 6 bits green, 5 bits blue.<br>
  1647. BODY - An array of short ints containing positive offsets into BKDT, and
  1648.                  negative offsets into ANDT.<br>
  1649. LYR? - Where ? is an ASCII number form 1 to 7. These are the same size and
  1650.                  format as BODY, and allow object layers to be used.<br>
  1651. You can add your own chunks to a map file, if you load it into mappy,
  1652. when you save it, those additional chunks will be saved in the file, but
  1653. not necessarily in the same place as before.<br><br>
  1654. FMP1.0 notes:<br>
  1655. This is very similar, but the values in all the chunks refer to units rather than bytes,
  1656. ie. in BODY 0,32,64,96 would be 0,1,2,3 in FMP1.0.
  1657. </p>
  1658.  
  1659. <p><a href="#topod">(top of doc)</a> </p>
  1660.  
  1661. <hr>
  1662.  
  1663. <p><a name="mapform"></a></p>
  1664.  
  1665. <h3>The MAP file format</h3>
  1666.  
  1667. <p>&nbsp; MAP is a user definable format which you can use for basic maps. To
  1668. define the format you need to change the <strong>maptype</strong> line in the
  1669. mapwin.ini file to how you want it. It is also recommended to change importskip=0.
  1670. The values are between the quotes and the
  1671. default: &quot;LW4H4A4-1&quot; is the usual format for CDX maps. What is this
  1672. cryptic rubbish? The first letter is either L or M and specifies the endianness
  1673. of the MAP file, for Intel this is L, for Motorola M. The next parts are letters
  1674. followed by numbers, currently you can have:<br><br>
  1675. W = Width of map in blocks, the next number is size of this field in bytes<br>
  1676. H = Height of map in blocks, the next number is size of this field in bytes<br>
  1677. A = map array, the next number is size of each cell in bytes, the number after
  1678. that is the adjuster, if the blocks look wrong, you can adjust them up or down
  1679. to match them up, -1 normally compensates. The array is stored in plain number=block
  1680. form and all layers will be saved consecutively.<br><br>
  1681. &nbsp; So, for example, if I ONLY wanted the map array in bytes I might use
  1682. &quot;LA1-1&quot;. This means L=Intel format, A1-1=Array 1 byte per cell,
  1683. with -1 adjustment. If I wanted to be strange I could have &quot;MW2W4H4H2A20&quot;
  1684. which is M=Motorola format, W2=Width as 16bit, W4=Width as 32bit, H4=Height as 32bit,
  1685. H2=Height as 16bit, A20=Array 16bits per cell, 0 adjustment.<br>
  1686. <br>
  1687. &nbsp; It is very important to set the other 'map' values correctly in the
  1688. <a href="#mapini">mapwin.ini</a> file.<br>
  1689. maptype = "LW4H4A4-1"<br>
  1690. It is vital to set mapdefw to the width of your map (in blocks) when working with MAP files which DON'T contain map width (W)<br>
  1691. mapdefw = 100<br>
  1692. It is vital to set mapdefh to the height of your map (in blocks) when working with MAP files which DON'T contain map height (H)<br>
  1693. mapdefh = 100<br>
  1694. It is vital to set mapdefbw to the width of your tiles (in pixels) when working with MAP files, the exception is when it is 0 where a requester will be used every time a .MAP file is opened<br>
  1695. mapdefbw = 32<br>
  1696. It is vital to set mapdefbh to the height of your tiles (in pixels) when working with MAP files<br>
  1697. mapdefbh = 32<br>
  1698. It is useful to set mapstaggerx to the odd row offset (in pixels) when working with Isometric MAP files<br>
  1699. mapstaggerx = 0<br>
  1700. It is useful to set mapstaggery to the odd column offset (in pixels) when working with Isometric MAP files<br>
  1701. mapstaggery = 0<br>
  1702. It is useful to set mapclickmask to the block for the mask when working with Isometric MAP files<br>
  1703. mapclickmask = 0<br>
  1704. If you want to, set this to your tiles bitmap for MAP files, see
  1705. <a href="#simple">Using Mappy as a simple map editor</a><br>
  1706. mapdefBMP = "nodefault.bmp"
  1707. </p>
  1708.  
  1709. <p><a href="#topod">(top of doc)</a> </p>
  1710.  
  1711. <hr>
  1712.  
  1713. <p><a name="mapini"></a></p>
  1714.  
  1715. <h3>mapwin.ini settings</h3>
  1716.  
  1717. <p>&nbsp;The mapwin.ini file is in the same folder as the mapwin.exe file (the
  1718. MappyWin32 map editor). Use Notepad or another <strong>plain text</strong> editor
  1719. to change the values of the settings then save, normally you can double click .ini
  1720. files to edit them (if the '.ini' part of the name is hidden, this is the file
  1721. called mapwin with an icon that looks like a document with a gear in the corner).
  1722. You must restart MappyWin32 to use the new settings (not the whole computer,
  1723. just Mappy). mapwin.ini is now fully documented so read it for more information.
  1724. </p>
  1725.  
  1726. <p><a href="#topod">(top of doc)</a> </p>
  1727.  
  1728. <hr>
  1729.  
  1730. <p><a name="glossary"></a></p>
  1731.  
  1732. <h3>Glossary</h3>
  1733.  
  1734. <p>&nbsp;</p>
  1735.  
  1736. <p>&nbsp; <strong>Anim Structure</strong> a 16 byte structure and
  1737. associated list of frames (Block Structure offsets) of unknown
  1738. length<br>
  1739. &nbsp; <strong>Block</strong> I have tried to make 'block' mean
  1740. the block structures for this documentation<br>
  1741. &nbsp; <strong>Block Editor </strong>The window that allows you
  1742. to select and edit both still and animated blocks. Right clicking
  1743. the mouse on it toggles between still/animated<br>
  1744. &nbsp; <strong>Block Structure</strong>&nbsp;a 32 bytes structure
  1745. that acts as information about a particular block, it is
  1746. referenced by the Map Array and Anim Structures, and in turn
  1747. references the raw Tile Graphics<br>
  1748. &nbsp; <strong>BMP</strong> Standard Windows graphic file format,
  1749. MappyWin32 only imports and exports 8bit and 24bit uncompressed
  1750. versions (Other colour depths are imported/exported as 24bit)
  1751. currently<br>
  1752. &nbsp; <strong>FMP</strong> Flexible MaP format, a collection of
  1753. all the information needed to render and animate a map for a
  1754. game.<br>
  1755. &nbsp; <strong>FMA</strong> A FMP file, but without the graphics
  1756. (BGFX).<br>
  1757. &nbsp; <strong>MAR</strong> A map array file.<br>
  1758. &nbsp; <strong>MAP</strong> MAP format, a very basic user defined
  1759. format for compatibility with other systems<br>
  1760. &nbsp; <strong>Graphics Blocks</strong> See 'Tile'<br>
  1761. &nbsp; <strong>Map Array</strong> an array of short int (16bit)
  1762. values&nbsp;that reference Block Structures (when positive) and
  1763. Anim Structures (when negative). There can be up to 8 layers of
  1764. this array by using the Map Layers<br>
  1765. &nbsp; <strong>Map Editor </strong>The window where you fill in
  1766. the map array using the various tools provided<br>
  1767. &nbsp; <strong>Map Layers</strong> There can be up to 8 layers of
  1768. the map array for objects, ingame changes, etc. Normally you
  1769. would only have 1 or 2 layers. These can be selected and changed
  1770. in the Playback Libraries<br>
  1771. &nbsp; <strong>Mappy</strong> A 2D tile map editor with lots of
  1772. features, this is the Win32 version but there is also a DOS and
  1773. WinAllegro version<br>
  1774. &nbsp; <strong>Playback Library</strong> these are available
  1775. separately for free at the Mappy homepage, there are several
  1776. versions for different platforms, they provide an easy way to
  1777. access the map in your game<br>
  1778. &nbsp; <strong>Tile</strong> I have tried to make 'tile' mean the
  1779. raw graphics the block structures use for this documentation<br>
  1780. &nbsp; <strong>Tile Graphics</strong> All the graphics
  1781. information for the map</p>
  1782.  
  1783. <p><a href="#topod">(top of doc)</a> </p>
  1784.  
  1785. <hr>
  1786.  
  1787.  
  1788. <p>This documentation is for Mappy Win32 version V1.4.23 by
  1789. Robin Burrows 30/12/2009.</p>
  1790.  
  1791. <p><a href="http://www.tilemap.co.uk">www.tilemap.co.uk</a></p>
  1792. </body>
  1793. </html>
  1794.