Original Post
I was just wondering what it takes to make a simple 2d map editor, for a platform and also a rpg(zelda sytled)? im using: allegro c/c++
Quote:
Original post by nightech
My save files for example have the first 4 bytes as the x and y dimensions (2 bytes each), following this, for each tile 1 byte stores the texture ID, 1 byte stores the height. Since my maps never have units on them (no saving on the map) i don't need the additional information stored. Also whether the tile is passable is determined by the texture ID, that's something else you might need.
Quote:
3. Draw the textures: for my implementation, i have a single bitmap that has all the tiles lined up beside each other, i use the textureID and the known width of the texture to read the block at that pixel within the bitmap. This just gets drawn on the screen based on the location of the player. For example, you may have a 128x128 map, the character may be at (40,60) and you might want to draw just the 10 squares either side, you would use the array location of your character, find all the surrounding squares and draw them to the screen one at a time from your texture file.
Quote:
4. Make different layers: This depends entirely on what you mean. if you want different layers that move at different speeds, it's beyond the scope of my knowledge, if you just want to specify which units go on top of what, just draw them from the bottom up (higher things are drawn last).
Quote:
Original post by NimbleSpeed
When trying to make the editor, what should i already have done. by this i mean do i need an already functional version of the game?
Quote:
Original post by Captain P
You can easily extend this with layers by saving multiple blocks. You can then also easily use one layer for the visuals and another for collision purposes. You may also want to store a list of texture filenames in the file somewhere, or, in your case, the name of the tileset bitmap. It's a bit more flexible than using a single bitmap for all levels. Especially when you're working with multiple levels and when you have a variety of styles that may become very useful.
Then again, it may also be feature creep for your game. ;)
Quote:
You're more or less using the player position as a camera offset. Personally I find it useful to separate these concepts. I'd then tie the camera to the player, and when doing cut-scenes, I'd tie it to something else. Parallax scrolling becomes easier, too.
Quote:
A layer can simply be a group of sprites. If you use a camera as a drawing offset, then different movement speeds are easy: every layer multiplies the camera position with a certain value and uses the result. A layer that moves equally fast as the camera would use factor 1, a background layer that's moving very slow would use a smaller factor, and so on.
Quote:
@NimbleSpeed: Point 6 depends a lot on the specific requirements of the games, but it's not impossible to use one editor for both, if you take a generic enough approach.
However, if your goal is to write games, then write games. There's quite a few editors around already, so just take one and perhaps modify it a bit. You know what? You'll learn what's valuable about and editor and what's not, which will help you develop your own when you need to. Besides, you'll be building levels much earlier, which is helpful when testing your game.
An alternative would be to build an editor interface on top of your game. Might allow for rapid testing if you make the switch between editor and game seamless.
In the end, it depends on your skills. If most of this sounds too complex for you, then start out simpler. Don't take on too many new elements all at once, gradually work your way up.
Quote:
Original post by cdoty
You will need a version of the game that can display the map, of course.
Another approach is to use the same engine for the map editor and the game. This cuts down on the amount of work that has to be done, as changes in the map display routines are only done once. This was a popular way of doing things 'back in the day'.
Quote:
Original post by NimbleSpeed
When trying to make the editor, what should i already have done. by this i mean do i need an already functional version of the game?
Quote:
Original post by NimbleSpeed
So, a good level editor would actully already have the physics/engine programmed into it?
Quote:
Original post by NimbleSpeed
I know that sounds like a dumb question, but im actully trying to make the game from scratch so if there is anything i should probly have done prior to just the map editor could you mention it?
Quote:
Original post by NimbleSpeed
also has anyone ever made an object become transparent (can still see the item but you can see threw it, like a ghost). if so, was it just a function of allegero(or whatever) or do you actully have to program that?
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more