Best approach to map making for 2d rpgs?
What is the best way to make maps for 2d rpgs... I have a map class and a tile class but as for making the maps I am unsure how to program it. I am wanting an easy click user interface...
I have a tile selection box that loads tilesets and allows users to select specific tiles and I want the user to be able to create a new "map" with defined sizes and then select the tile and just click in the cell the want to modify...Thanks!
Ok there is something magical 'bout the bathroom. I got an idea...I was thinking render the map to a context and then when the user clicks get the x and y position of the mouse. From that you can get which tile it is in an array of tiles and you can change the bitmap or whatever is needed...Works for me...! Only thing is...can you create a DirectDraw device in something other than a form...? I am using C# and DirectX9 (DirectDraw).
^_^! ~ Krisc
^_^! ~ Krisc
Quote:Original post by Krisc
Ok there is something magical 'bout the bathroom. I got an idea...I was thinking render the map to a context and then when the user clicks get the x and y position of the mouse. From that you can get which tile it is in an array of tiles and you can change the bitmap or whatever is needed
yes, this is pretty much exactly how it is done. good luck. (sorry, dont know anything about C#)
I doubt that there is a "best" way. You might want to see if there are other map editors out there and make your game to coincide with how the map is constructed in that editor. Or you might find some open source map editors and modify their code to suite your game.
For my game I've got a guy building our map editor in C++ and QT3. It's still heavly under development, but basically it looks in the tile images directory and loads all those tiles into the right side of the window, then in the main part of the window draws a grid where you can drag and drop, click and drop, etc. Then when we save the map, the editor converts the tile gride into the data structures that our game uses.
We're starting out small with it and not adding all the bells and whistles yet, but rather just building it a piece at a time.
For my game I've got a guy building our map editor in C++ and QT3. It's still heavly under development, but basically it looks in the tile images directory and loads all those tiles into the right side of the window, then in the main part of the window draws a grid where you can drag and drop, click and drop, etc. Then when we save the map, the editor converts the tile gride into the data structures that our game uses.
We're starting out small with it and not adding all the bells and whistles yet, but rather just building it a piece at a time.
Using that method, I would store an index of each tile. Then you are only saving one number instead of two. Then when your program loads the tile, calculate the X and Y values.
X = Tile_Index % TileSet_Width
Y = Tile_Index / TileSet_Width
resulting in the following tile number pattern:
1,2,3,4
5,6,7,8
TileSet_Width = 4
Results in almost half the map size, exluding delimiters.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement