Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411283 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 29, 2024, 12:22:07 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Map editing interface
Pages: [1]
Print
Author Topic: Map editing interface  (Read 3131 times)
cag
Level 0
**


View Profile
« on: January 02, 2008, 09:46:40 PM »

So I've been working on a personal game engine in C for 2D games, and I'm currently starting to implement a tile map editor. Game engine's 2D via 3D hardware. Hopefully, I'll eventually finish and release this little project (and games to boot?? LOL).

A naive list of things I'm trying to implement:
Multiple "rooms"
Multiple layers
Unlimited tiles, with option to flip horizontally and/or vertically
Alpha blending and color scaling
Parallax
Scripted zones (I LOVE LUA!)
N inspired:
  Obstructions (and sophisticated collision detection)
  Edges n' stuff
And probably a couple of other ideas floating around in my head I've forgotten about as I'm writing this.

I thought I'd like to start up a discussion about tile maps and their editors here.

Anybody here have implemented a map engine before? Thoughts on whether a map editor for this for 2D/3D games would be useful? Thoughts on map editors in general? Suggestions for other features I might want to have? Horror stories? Warnings? Tips? Green soy?!?

Actually, above all, I'd like some thoughts on map editor user interface. What sort of elements in a map editor's interface would be most useful to people? I could've probably cut this post down to that question... but I didn't for some reason. Sorry.
Logged
ravuya
Level 7
**


Yip yip yip yip yip


View Profile WWW
« Reply #1 on: January 02, 2008, 10:04:28 PM »

I'm actually planning out my interface as well; I've worked on a bunch of logic for picking and some other gubbins, and now it's time to make it actually do things.
Logged

Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #2 on: January 14, 2008, 08:37:51 AM »

I store all my maps in png-format and have the development version of the game check if the maps have been updated on file and then reload them. That way I can draw blocks infront of the feet of the main character while i play the game AND draw the map at the same time. I have the same approach for tiles and sprites too.

/ robo
Logged
Massena
Level 4
****


Satisfied.


View Profile
« Reply #3 on: January 14, 2008, 11:27:22 AM »

I store all my maps in png-format and have the development version of the game check if the maps have been updated on file and then reload them. That way I can draw blocks infront of the feet of the main character while i play the game AND draw the map at the same time. I have the same approach for tiles and sprites too.

/ robo

That sounds really hard, any good tutorials on coding something that changes .pngs?
Logged

ravuya
Level 7
**


Yip yip yip yip yip


View Profile WWW
« Reply #4 on: January 14, 2008, 12:23:33 PM »

You'd probably just modify a pixel buffer in memory, and then write it to a PNG file when you're done with it. It makes no sense to constantly load and save files, since that's monstrously slow (and blocking).
Logged

cag
Level 0
**


View Profile
« Reply #5 on: January 14, 2008, 07:37:26 PM »

@robo: that's an interesting workflow... maybe I should look into doing something like that. do you modify maps as PNGs directly, or modify tiles as PNGs? if the latter is true, do you edit/load tile maps on the fly while editing?

@massena: it seems to be a lot simpler than it sounds: just check whether a file has changed or not, and if it has, reload the file using whatever function you've written to load it with.

@ravuya: I imagine the only realistic way to actually modify a pixel buffer in memory while simultaneously running an editor of some sort is to embed the editor in the engine. I don't know how much extra work that would require, but loading files on the fly wouldn't really be that blocking, providing that the checking is relatively efficient.
though an editor in the actual developmental engine would be cool..., and I do like the idea... hmm...

on a side note, it seems that I'm ending up refactoring my code, on account of me having a late c++ renaissance. (I've used c for a while now, and while it has served me well, it's time to move on...)
Logged
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #6 on: January 15, 2008, 03:27:39 PM »

@Massena: I think you missunderstood me. My game engine doesn't write any PNG. It reads the PNGs that I'm drawing in an external program (I use Promotion). The whole reason for using PNGs for map data is so that I won't need to write a map editor.

@ravuya: Again, my design time game engine only reads map-files (and spritesheets and tilesheets) and only if they are updated on file with a slight delay to keep the file accesses down. There is no writing.

@cag: I have tilesheets and a tilekey where each tile is assigned its own color. The map-files are then drawn with those colors and each pixel represents one tile in-game. Since I've got 8x8 tiles the map is at 1/8 of its actual size.

I also use another "map" where each pixel represent what type of material each tile should be in. That way I can have walls you can walk through or water that you can walk on.

To make things worse I've got depth-maps and reflection-maps but that's a different thread...

Logged
NickWaanders
Level 0
**


View Profile
« Reply #7 on: January 16, 2008, 12:13:02 AM »

One tip I would have for the OP is to not make the editor in C, unless you plan to ship the editor with the game. I'd suggest using a quicker-to-change language like C# or Java. I mostly have experience with C#, and this language come with a huge amount of built in functionality such as FileChangeWatchers, loading and saving bitmaps, etc. Writing a somewhat working map editor in C# is a matter of a few days, and then you can save it out to your own format instead of relying on png's as your map data.

The reason I would use my own level format is that most likely you will want to store more than just an index into a tileset for your maps, and that's where png's become harder to manage. For example, the robots in N have quite a few parameters that dictate their initial direction, their 'program' they use for their movement, etc. I'd hate to edit that in a png somehow.. Smiley

Cheers,
Nick
Logged
Massena
Level 4
****


Satisfied.


View Profile
« Reply #8 on: January 16, 2008, 11:43:50 AM »

Editing maps while you play sounds great, but I guess I'm still light-years away from having the kind of experience necessary.  Embarrassed
Oh well, someday!  :D
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic