PDA

View Full Version : D&D Map Editor


techchallenged
2002.06.06, 01:01 PM
Hi,
I have no programming experience whatsoever. How much education would there be on my part to make a simple map editor for apple users?

I am sure everyone has heard of Dungeons and Dragons - people who play usually make their own scenarios using the old gridpaper and pencil options...pc users have map editors to enable them to make maps for their scenarios using a game editor, but there are no apple map editors.

I would like to try this - it might even be marketable for a small fee.

I am soliciting any constructive advise from anyone on education/tools to do this - many thanks in advance.

NecrosaJoe
2002.06.06, 01:13 PM
Hm... as against-my-own-best-judgement it is to be helping in the creation of a non-freeware product... i've done something exactly like this, so I'd like to help. ^_^

first off, learn C. I don't jest- it's the best way to get a firm grasp of the underlying concepts behind procedural programming, hands-down. Even in OOP languages and APIs like Objective-C and Cocoa, you need at least a little procedural background.

next, make a bunch of fun useless programs in objective-c. have them move strings around textfields, or save files and reload them. it's good practice.

finally, confront your problem:

there are two ways to approach it: the easiest from a lazy standpoint and to conceptualize is a big NSMatrix of NSButtonCells... That way, you can just assign images to the selected ones, whatever. That may be best for what you're talking about doing, even though it has many disadvantages: slow, inflexible, etc etc. But it's fastest to-market and it's really easy. And it will work for just laying out grids of tiles.

the other way is harder, but a lot more useful for things besides just laying out maps. Make a subclass of NSView. have it track mouse clicks so that any click will 'select' a certain (maybe 32X32) tile. click on an image to copy it to the tile(using [theImage compositeToPoint: thePoint operation:NSCompositeCopy] to place NPCs, tables, etc, use NSCompositeSourceAtop). for multitile images, use the selected square as the origin, the bottom-left corner. it all comes down to placing images, basically... not extremely hard, but it will let you do more: multi-tile images are only one example- the other way, you'd need to split it into a bunch of smaller images.

the approach is up to you. the former way is easier. the latter way is better. follow your heart.

-joie

if you promise to opensource the project, or at least make it free, i can give you some code snippets. ^_^ I'm a DM, myself...

NecrosaJoe
2002.06.06, 01:18 PM
To learn C, I suggest Addison and Wesley's "Nitty Gritty Programming Series: C", written by Klaus Schrˆder. Kenighan and Ritchie struck me as too obtuse. ^^;

struct me, even. heh. you'll get it when you learn about data aggregates. ^_^

to learn objective-c, go to Apple's website, Cocoa developer documentation, and read XObjC.pdf, "Object-Oriented Programming and the Objective-C Language." if you know C, it will take 25 minutes to firmly grasp obj-c.

And of course, it goes without saying that you'll need to install the devtools. ^_^

-joie

<edit> don't worry. In February, i didn't know from C, but now I'm rewriting the original Final Fantasy for Mac OS X. ^_^ You can make tremendous progress quickly! </edit>

techchallenged
2002.06.06, 01:20 PM
Thanks for the reply!

I knew it would be complicated - I am used to learning new software because of my job...

Shareware seems the best route - I envisioned a simple grid layout window with an area containing all of the tiles available for placement into the grid area. Tiles could be added, once created using something like Photoshop (I am assuming you could use 72 resolution, rgb jpg's for this).

The whole thing could be put up on a website - new tiles could be submitted by other mac people out there, etc...

Could the thing you did before be modified for this use?

Thanks...

NecrosaJoe
2002.06.06, 01:34 PM
I was less experienced when I did it, so I used the NSMatrix approach. It's not great, but it already is 100% to your purpose, I think. Just change the name. Tiles are any image(preferably 32X32, 72 DPI jpgs or gifs) in ~/tiles/ directory, automagically loaded at startup. it's cheesy, but it works. one cannot place NPCs atop of other tiles, however- support for layering wasn't exactly my greatest concern. (:

i seem to remember it breaking or something... but it could be easily remade. email me if you're intrested. (it took a while to post this because at first, I was going to post the whole thing in here, but then I got lazy. ^^;;)

-joie

NecrosaJoe
2002.06.06, 01:44 PM
Wow... looking back on this code, I want to go back in time and punch myself in the face. Badly coded. Badly conceived. Unnecessary subclassing. Ugghh... <shudder> saving works fine, I think(not so sure; Ian handled saving in a strange way), loading is 100% nonfunctional. But laying tiles works. You could always just do a screen capture and then print it out. ^_^ Ne?

ugh... the biggest project i had done at the time, and therefore the ugliest. ^^;;;

it's smart though, it does automagically load tiles.

-joie

NecrosaJoe
2002.06.06, 01:46 PM
on second thought, i don't think saving works either. i'll just remove it. whoever takes it can do it his own way.

techchallenged
2002.06.06, 01:46 PM
Layering isn't necessary - I agree. Just would like something to make a map of a dungeon, a town or something else with. You know, place wall in this grid, place wall with door in the next one...

Just an easy way to make a map. I would be interested in seeing what you have. I am a graphic designer by trade, so maybe I could add some interesting graphics to the overall look, if you tell me the area (width x height) and what content you want in them.

NecrosaJoe
2002.06.06, 01:57 PM
from now on, it's yours, just email me and I'll send you a .dmg.gz with the source... if you don't have the devtools, i'll give you the compiled app. all you need to make it work is a directory called 'tiles' in your home directory... i hope it works out for you. ^_^ I do a little graphic designing myself, but nothing too exciting. layouts, mostly. at any rate, drop me an email, and the app is in your hands. if you make any changes, please just drop my name and email address. ^_^ it's being@mac.com.

-joie

<edit> oh, and it's OS X-only, if that means anything. ^^;; </edit>

NecrosaJoe
2002.06.06, 03:04 PM
So, i put the binary to the ugly app up on my HTTP server(thank you apple; thank you apache) and it was downloaded. If anyone else is interested, tell me so, and I'll let you have the sources or the binary.

-joie

~THE END~

Bachus
2002.06.07, 05:20 AM
There's always Level Creator (http://www2.swarming.net:4444/levelcreator/) and Sprite World (http://www.spriteworld.org/).

It's incredibly easy to load graphics in to Level Creator and make a map out of them. If you want to do anything with the map when you're done, it's also incredibly easy to write a program that uses SpriteWorld to load in the map and display it in a window (for an experienced programmer, two hours of work, tops).

Both are free and open-source.

Al_Staffieri
2002.06.07, 10:52 AM
Check out RPGMapMaker
http://membres.lycos.fr/fmenneteau/software/rpgmapmaker.htm