RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Mon Nov 13, 2006 10:22 pm    Post subject: Mappy question (saving format) [quote]

Hey everyone,
My first post here. Looks like a nice community though. Onto the question... I'm trying to save my map into a 2d array format...i.e. int map[][]. I know I can save it as an array, int map[] when I save the map as .csv and rename it to .txt.

However, when I choose the save as Map Array (.mar), it is saved as a MS Access shortcut or what not. What do I do now? I double-click it and other than the app. opening, nothing happens.

I'd really appreciate some help :)

EDIT:wow.... is this a stupid questions...? or does noone really know what I'm talking about? I swear, noone will tell me. I'm just trying to learn, so c'mon peoples :) I know many of you must've used Mappy.
Back to top  
tunginobi
Wandering Minstrel


Joined: 13 Dec 2005
Posts: 91

PostPosted: Tue Nov 14, 2006 6:59 am    Post subject: [quote]

The community can be a bit sleepy at times.

MS Access hijacks .csv for "Comma Separated Values," which it can load. Here's something: try entering your filename in double quotes. It may be that MS Access is appending to your filename automatically. (::EDIT:: or have I misinterpreted you, and you're really using Mappy? Solution may still work.)

Also, go into Explorer's settings and turn off "Hide extensions for known file types." Worst. Default. Setting. Evar.
Back to top  
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Tue Nov 14, 2006 7:15 am    Post subject: [quote]

tunginobi wrote:
The community can be a bit sleepy at times.

MS Access hijacks .csv for "Comma Separated Values," which it can load. Here's something: try entering your filename in double quotes. It may be that MS Access is appending to your filename automatically. (::EDIT:: or have I misinterpreted you, and you're really using Mappy? Solution may still work.)

Also, go into Explorer's settings and turn off "Hide extensions for known file types." Worst. Default. Setting. Evar.


Hey Tunginobi,
cool name. where'd you get it?
Anyway, I'm using Mappy to create my map. Now I want to export it as a 2d array, so I choose the .mar option and it saves it as a Access shortcut. When I double click it, nothing happens.

Atleast when I saved it as .csv, I could rename it to .txt and open it in notepad. That just doesn't work with .mar. I'd REALLY appreciate some help in this matter.

p.s. are you talking about internet explorer? i use firefox.

EDIT:
Tried your double quote suggestion. I entered "map1" and then hit ok. I get this message "Some elements were not exported correctly." Then, I see nothing is saved; no file shows.
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Tue Nov 14, 2006 7:30 am    Post subject: [quote]

white_wolf wrote:
p.s. are you talking about internet explorer? i use firefox.

He is talking about Windows Explorer, the graphical shell that is permanently integrated into the Windows desktop. It has a number of settings, spread out everywhere on the box on which it is installed. For the current generation Windows operating system, you can get to the setting he was discussing by opening "My Computer", clicking on "Tools->Folder Options", and then navigating to the "View" tab. Under the options listed therein is one which states, "Hide extensions for known file types", which is on by default. As tunginobi suggests, this is, quite possibly, the worst default option ever, especially as Explorer interprets files primarily by extension (which is an entirely different WTF).

If you were so inclined, you could change the associations of given files in the tab next to "View", named "File Types", which has a slew of extension/application bindings.

Also, you need not change the file extension of a given file in order to open it in an application such as notepad; you can often drag the file directly into notepad, or open it under notepad's file menu. If you are masochistic enough to actually use cmd, you could also just "notepad filename".
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Tue Nov 14, 2006 7:49 am    Post subject: [quote]

LeoDraco,
I just realized it's a shortcut. Also, I realized it's a MS Access Report?

EDIT: I removed file association and also went under File Types and removed the association. when i open it in notepad, a few strange characters. no number arrays :(

Noone's ever had this problem before?? wtf!
Back to top  
Terry
Spectral Form


Joined: 16 Jun 2002
Posts: 798
Location: Dublin, Ireland

PostPosted: Tue Nov 14, 2006 8:20 am    Post subject: [quote]

To be honest, you're probably better off coming up with your own tools for map editing. Once you have a tile engine in place for your game, it shouldn't really take much more than an evening's work, it'll do exactly what you want and you won't have to mess around with unnessicarily complicated formats. (the few strange characters you're seeing are probably the result of mappy's binary output.)

Plus, if you make your own map editor, you can do cool things like build it into your actual game, so that if you're playtesting it and you decide you don't like how something looks, you can just hit F1 or whatever and change it. It's well worth the time investment! :)
_________________
http://www.distractionware.com
Back to top  
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Tue Nov 14, 2006 6:02 pm    Post subject: [quote]

Echo wrote:
To be honest, you're probably better off coming up with your own tools for map editing. Once you have a tile engine in place for your game, it shouldn't really take much more than an evening's work, it'll do exactly what you want and you won't have to mess around with unnessicarily complicated formats. (the few strange characters you're seeing are probably the result of mappy's binary output.)

Plus, if you make your own map editor, you can do cool things like build it into your actual game, so that if you're playtesting it and you decide you don't like how something looks, you can just hit F1 or whatever and change it. It's well worth the time investment! :)


Hey Echo,
Thanks for the advice. I am quite new to game programming. I wanted my focus to be on game programming instead of having to code the "tools"; i.e. a map editor.

I have asked this question at other places too; I just can't believe noone has experienced this problem or I'm just doing something totally wrong exporting it. THe weird thing is NOONE can tell me how to save it in 2d array. That is all i want.

I refuse to believe noone has experienced it. Does anyone know if DeveloperX visits the site (or how often)? He made the Allegro tutorials in which he himself uses a 2d array to store the map. Perhaps he'd be willing to help?

Would someone be willing to even check out Mappy themselves and try saving as .mar? I know that's asking for much...
anyway, TIA.
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Tue Nov 14, 2006 9:39 pm    Post subject: [quote]

It's not that we haven't experienced it, but simply that we know a bit more.

Those weird characters you're talking about is notepad trying to read binary data into ASCII. If you don't know what this means, go back to your C books before continuing making a game.

Mappy should have its different file formats specified somewhere in its help. I don't know for sure because I create my own tools (the best way to learn) and don't want to install Mappy.
Back to top  
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Wed Nov 15, 2006 12:39 am    Post subject: [quote]

Ninkazu wrote:
It's not that we haven't experienced it, but simply that we know a bit more.

Those weird characters you're talking about is notepad trying to read binary data into ASCII. If you don't know what this means, go back to your C books before continuing making a game.

Mappy should have its different file formats specified somewhere in its help. I don't know for sure because I create my own tools (the best way to learn) and don't want to install Mappy.


First, I didn't mean to come off as a pompous ass. I have looked up Mappy's different file formats, but other than telling me what .mar does, it doesn't go any further.

I know that Mappy should be sufficient for my purpose (or a noob in general), so I am hoping to learn it.
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Wed Nov 15, 2006 1:05 am    Post subject: [quote]

Quote:
Export. You can export individual parts of the map as separate files, which you may need for various reasons, though the playback libs use the FMP files. There are five checkboxes, click them to indicate you want to export that particular item (they will be given the same name and be put in the same directory as the map file, so if your map was called test.fmp, the colour map would be exported as test.cma any file with that name will be overwritten!). The colour map is exported as a 768 byte file containing 256*3byte values of 0xRRGGBB, this is the same as the CMAP chunk of the FMP file. The Anim and Block data is exported as a long int offset to the split between the anim and block structures then the anim info, then the block structures. The map array is simply an array of short ints mapwidth wide by mapheight high, so a 100*100 map would produce a 20000byte .MAR. Block Graphics (.GFX) are all the raw blockgraphics one after the other, so that's blockwidth*(blockdepth/8)*blockheight*numblockgfx.Block Graphics (.BMP) is a standard uncompressed BMP file in 8bit (if the mapdepth is 8bit) or 24bit for any other depth, you can specify how many blocks per row and this will affect the shape of the BMP file, this is useful for modifying the graphics, then re-importing them.


See? Just a dump of the 2D array with two bytes per tile.
Back to top  
RedSlash
Mage


Joined: 12 May 2005
Posts: 331

PostPosted: Wed Nov 15, 2006 2:20 am    Post subject: [quote]

Quote:
The map array is simply an array of short ints mapwidth wide by mapheight high, so a 100*100 map would produce a 20000byte .MAR.

Code:

short map[100*100];

fp = fopen("map.mar","rb");
if(!fp) error();
fread(map,2,100*100,fp);
fclose(fp);
Back to top  
tunginobi
Wandering Minstrel


Joined: 13 Dec 2005
Posts: 91

PostPosted: Wed Nov 15, 2006 5:24 am    Post subject: [quote]

Bleh, so obvious, I should have seen it earlier.

Opening *.mar files in Mappy

Windows Explorer file association problem, easy to fix/modify.

Go to the file using Windows Explorer, and select it. If it has a non-generic file icon, note the name of the file's type. Go to Tools -> Folder Options, and select the file types tab (whatever it's named). Find that file type name in the list. Delete it and create your own file association. Do this by clicking the right buttons (haven't used Windows in months), and you'll end up with a dialog box with two textboxes. Enter Open (a label) for the top box, and the command to run with the bottom (that would be the path to the Mappy binary, followed by "%1" in quotes). Set it to the default action if you want, so that double-clicking will open the file in Mappy.

If the file icon is generic, just do the above, but instead of deleting any associations, just make a new one for files ending with "mar". Poke around with other file types to get a feel of what each text field should look like.

Opening *.mar files as a map in a game/demo

Load it as you desire, using the formats that Ninkazu has helpfully provided. It's just a pile of (presumably) little-endian 2-byte ints. Looks like it needs the supplementary data loaded too, since these *.mar files only hold the tile graphic indices.
Back to top  
white_wolf
Pretty, Pretty Fairy Princess


Joined: 13 Nov 2006
Posts: 10

PostPosted: Fri Nov 17, 2006 6:32 am    Post subject: [quote]

thanks for the help all!

In the end, I just chose the GBA text option. Open the text, and the very first part will be the 2d map array. Don't copy the whole text file as it includes other things, which I didn't need.
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum