Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Map Editor

Author
Message
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 31st Jan 2009 17:35
Hey guys, I need to create a map editor that will export the map into an array. For example, on the editor I place all grass tiles with a sign in the middle it would export this:

000000
000000
000100
000000
000000

I already have this map system implemented, I'm just having trouble figuring out how to read the data from an outer file. I really just need some general guidance on this. The logic is the part I'm stumped on. I'm not sure if anyone has already done this, but some pointers could help.

Thanks in advanced.

I am working on a 2D Side Scrolling MMORPG, the journey is being blogged and I suggest you check it out. Will include all progress, road blocks even drama! http://exoengine.com/blog/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Feb 2009 00:16
I'd cheat - I'd use PAINT BRUSH... Make the image the size of your level... and use RGB codes for the TILE ID's. (I'd use ones I could see though to make it eaiser... e.g. don't start with ZERO and ONE for your color )

Then I'd load the image (Either PNG or BITMAP - something lossless), convert it to a memblock, then loop through the image... when you convert a image to a memblock... the first 12 bytes are the dimensions and bit depth:

IMAGE WIDTH = 1 DWORD = 4 Bytes
IMAGE HEIGHT = 1 DWORD = 4 BYTES
IMAGe BIT DEPTH = 1 DWORD = 4 BYTES (Usually = 32 meaning 32 bits per pixel - RGBA or Red, Green, Blue, alpha)

The rest of the memblock is pixels. 1 DWORD = 1 PIXEL = RGBA. Rows across, then next row, then next etc.

--Jason

SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 1st Feb 2009 19:40
Well it needs to be a dynamic tool, like drag and drop :/

I am working on a 2D Side Scrolling MMORPG, the journey is being blogged and I suggest you check it out. Will include all progress, road blocks even drama! http://exoengine.com/blog/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Feb 2009 20:16 Edited at: 1st Feb 2009 20:18
Even cooler! Same Technique would work!

1: Load Image
2: Make memblock from image
4: delete image - save ID though for reuse later
5: use Memblock like an array... except its pixels - color = some tile type

...user all done.. and wants to save...

6: Make Image from Memblock
7: save Image
8: delete Image (save ID for next go around)

--Jason

[edit]Changed steps a bit to make fail safe[/edit]

wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 12th Feb 2009 14:15
Sorry to "dig up an old post", But if you were to do this, i would make it in layers because the way it would work if it was tile for tile, is the sign wouldnt have any ground texture under it.

Login to post a reply

Server time is: 2024-11-25 13:35:46
Your offset time is: 2024-11-25 13:35:46