MAPPY

Advanced game related topics
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

MAPPY

Post by Flype »

hello,
is there somebody who have done a procedure to load and read a file created with mappy (.FMP) (this is a famous map editor which can be found here : http://www.tilemap.co.uk/index.html ) ??
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

There is a map importer on the site coded in BliztBasic for loading and using .FMP files, maybe someone here could convert it? I've had no experience of BB (..and don't really want to :) ).
--Kale

Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

for those who need a multidir scroller :
i quickly coded (so, not very well coded but works) an example of how to import Mappy .MAP files and then display it on screen.

direct download here : http://serveurperso.com/~flype/purebasic/PbMario.zip

hope it could help ! :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Nice one Flype, any chance of coding the entire Playback Library for use with PB, I'd love to use Mappy for a game but don't know really how to get started to code the library. :(
--Kale

Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Reading .MAP files is quite easy, but reading .FMP files should be a bit more tricky as FMP includes graphics in the file. Perhaps one day, if i have enough time, and the file structure is public, so...
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Reading from 'MAPWIN.HTM' included with Mappy v1.3.21

The FMP file format
The FMP format (how the maps are stored) is a 'chunk' based format which allows all the information for the map (graphics, array, anims, block data etc) to be stored in a single file, you can also add your own chunks to this file if you want, more details in FMP file format.The playback libraries then provide functions to load and play the map within your game.

This is technical information about the FMP file structure:

Code: Select all

Chunk header:
4bytes ASCII = ChunkID (example: 'MPHD')
long int = size of chunk data less header

These are the chunks as of V1.2:
ATHR - Up to 4 ASCII strings of author information, separated by 0 values, always an even size.
MPHD - Map header, see struct in mappy.c
EDHD - Editor information, see struct in mappy.c
CMAP - Colour palette for 8bit maps, red byte, green byte, blue byte for however many colours are needed (so usually 256*3 bytes).
BKDT - Block data. Contains BLKSTR structures for however many block structures were made.
ANDT - Animation data. Contains ANISTR structures for however many animation structures were made, and also animation data.
BGFX - The raw graphics in whatever format the map is in. Examples: 8bit: mapwidth*mapheight bytes per block, in forward format *numblocks 16bit: mapwidth*mapheight*2 bytes per block, each word contains 5 bits red, 6 bits green, 5 bits blue.
BODY - An array of short ints containing positive offsets into BKDT, and negative offsets into ANDT.
LYR? - Where ? is an ASCII number form 1 to 7. These are the same size and format as BODY, and allow object layers to be used.
You can add your own chunks to a map file, if you load it into mappy, when you save it, those additional chunks will be saved in the file, but not necessarily in the same place as before.

FMP1.0 notes:
This is very similar, but the values in all the chunks refer to units rather than bytes, ie. in BODY 0,32,64,96 would be 0,1,2,3 in FMP1.0.
I would love to get started on this. I'm just going through it all trying to understand the format and trying to understand the syntax and code of the other playback libs. (Don't hold your breath! :roll: )
--Kale

Image
RJP Computing
Enthusiast
Enthusiast
Posts: 202
Joined: Sun Apr 27, 2003 4:44 am
Location: Michigan, USA
Contact:

Post by RJP Computing »

This would be SOOOOOOOOOO cool. Just what a newbie game writer would need. :wink:
-Ryan
RJP Computing

Ubuntu 8.10/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, nVidia GeForce 7600GT 512MB
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

i'm agree, it could be sooo cool for begginners and the others !
but i'm not a good enough coder to make such a library ! It's a big work to make it... and i've no time at this moment...
I would love to get started on this
But, perhaps, Kale can do it :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

But, perhaps, Kale can do it
i have a week off soon ill have a good look into it then :)
--Kale

Image
Surgeon
New User
New User
Posts: 5
Joined: Sat Sep 13, 2003 9:10 am
Location: Minsk, Belarus

Post by Surgeon »

Any progess since then? :)

I;ve been trying to work with mappy.dll - not sure about pointer to IDirectDraw object :(
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

I'm trying to get this working as my first PB project..... :)

I can load a 2d map, with anims etc and scroll all aound it.....

It's not pretty and it's probably very slow..... as I'm still not familiar with all the grafix functions yet !

More work to do though.... as I want it to do Isometric ;)

I'll keep you posted....
spot
User
User
Posts: 16
Joined: Fri Oct 10, 2003 9:20 pm
Location: switzerland
Contact:

Post by spot »

yeah. using mappy as a standard for tilebased games is a perfect idea. when the pb codes are ready i think they should also be posted on the mappy site to give purebasic more attention (blitz and dark are also linked there).
-- spot | www.nothing.ch
Haplo
User
User
Posts: 25
Joined: Tue Jun 08, 2004 8:45 pm

Post by Haplo »

Has anyone worked on this any further?
-----

If a man is standing in the middle of the forest speaking, and there is no woman around to hear him, is he still wrong?
Valgar
New User
New User
Posts: 8
Joined: Sat Jun 26, 2004 10:54 pm

Post by Valgar »

I have read on the forum of another mapeditor that it's autor is about to convert the loader code of it's editor to PB (i have this editor to work with blitz so i visit the forum many times).
The program is called Universal MapEditor and is really greath!
Haplo
User
User
Posts: 25
Joined: Tue Jun 08, 2004 8:45 pm

Post by Haplo »

Valgar wrote:I have read on the forum of another mapeditor that it's autor is about to convert the loader code of it's editor to PB (i have this editor to work with blitz so i visit the forum many times).
The program is called Universal MapEditor and is really greath!
Thanks for the heads up. I will keep an eye on this in anticipation :)
-----

If a man is standing in the middle of the forest speaking, and there is no woman around to hear him, is he still wrong?
Post Reply