map editor help

Forum for the creative side of the game development process: art, music, storyline, gameplay, concepts, etc. Any sort of relevant discussion is welcome here.

Moderator: PC Supremacists

User avatar
derbon
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 54
Joined: Tue Jun 09, 2009 7:25 pm
Current Project: Big Nasty Enemies
Favorite Gaming Platforms: NES SMS snes PC N64 PS2 Vectrex The Arcade Machine
Programming Language of Choice: C++, Perl
Location: why shud i tell u u mite steal my tv
Contact:

map editor help

Post by derbon »

guten tag, im trying to make a map editor and i don't know any concepts

can you post some concepts to help me understand
i think the best paint program would be microsoft paint + paint.NET+graphics gale + Paint shop Pro 7 + photoshop CS3, it would be called Paint Gale Pro Shop.NET,

http://youtube.com/gonduda
User avatar
Sanshin77
Chaos Rift Regular
Chaos Rift Regular
Posts: 160
Joined: Tue Mar 10, 2009 9:36 am
Current Project: C++/SDL engine, zaActionWizardMagic game
Favorite Gaming Platforms: Xbox 360, Playstation 2, Nintendo DS, mac and PC
Programming Language of Choice: C++

Re: map editor help

Post by Sanshin77 »

Try looking around(open source projects ftw), and be a little more specific when making posts.

Im assuming you're creating a 2d map editor for some sort of tile-based game. Try to find out what a tile is and what it would look like in your code. You'd probably want to have multiple layers for better looking levels and a lot of people like having a separate collision "layer". You'll want to use the keyboard and the mouse and translating the mouse coordinates into tile positions is a must. Using some kind of GUI library will be a timesaver, If you're not aiming at completing this very simply and quickly, since more advanced map editors kinda "need" a GUI.

Hope this helped a bit, if there's something else you're unsure of, feel free to be a bit more specific :P
Check out videos of my C++ games as well as my "Amateur Game Dev" series over at
My YouTube Channel: http://www.youtube.com/user/Zanchill
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: map editor help

Post by wearymemory »

derbon wrote:guten tag, im trying to make a map editor and i don't know any concepts

can you post some concepts to help me understand
You click on the window and it draws stuff.
User avatar
WSPSNIPER
Chaos Rift Regular
Chaos Rift Regular
Posts: 145
Joined: Sun Jan 03, 2010 6:19 pm
Current Project: top down shooter
Favorite Gaming Platforms: ps3
Programming Language of Choice: c++

Re: map editor help

Post by WSPSNIPER »

usually the map is loaded from a .txt file and uses numbers to represent the tile

i just made one ( its crap but works ) i used a vector for a TileList which kept the tiles attributes stored and i used a format for loading form the SDLtutorial website where you save it as number:number ( 1:2 ) and the first number is the image and the second number is the type you would usually use 2 for loops to read through them

after loading you save it by going through the same kindof loop but writing the tileID and tileType to the file

when you place a tile get the position of the mouse and find the tile it is colliding with and set that tiles attributes according the the tile you have picked

This is how the loading looks and the saving looks similar but it is not the actual code it is most of it just giving a refrence

Hope i have helped Oh and the placing tiles and changing them was the hardest for me

Code: Select all

for( int Y = 0; Y < MapH; Y++ )
{
    for( int X = 0; X < MapW; X++ )
    {
       cTile tile;
       fscanf( file, "%d:%d ", tile.TileID, tile.TypeID );
       TileList.push_back(tile);
     }
    fscanf( file, "\n");
}        
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: map editor help

Post by GroundUpEngine »

WSPSNIPER wrote:usually the map is loaded from a .txt file and uses numbers to represent the tile
This.
Master Jake
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 69
Joined: Sat Dec 12, 2009 8:43 pm
Programming Language of Choice: C/C++
Location: United States
Contact:

Re: map editor help

Post by Master Jake »

Sanshin77 wrote:separate collision "layer"
An old game I used to play didn't just have a "collision" layer, but 2 attribute layers. The attributes were things like (Wall, Warp, No Monster Spawn, Item Spawn, Directional Tile, etc, etc etc.)

The tiles were just to look pretty, but the attributes effected what exactly happened on those tiles. There were 2 layers for attributes because sometimes 1 attribute for a tile just isn't enough. There were plenty of other attributes including a Script attribute which, when placed on a tile, ran a script when a player stepped on that tile.

The script title was based on the location of the script tile (mapMAP_X_Y) e.g. (map2_5_4)

Inside each attribute was additional information. For instance, the warp attribute had a Map, X, and Y for the location of the warp when someone stepped on it.

To this day, the attribute idea is my favorite for dealing with 2D games.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: map editor help

Post by eatcomics »

@MasterJake I was going to do that same thing for one of my games :D but I started another project... I need to finish some stuff...
Image
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: map editor help

Post by acerookie1 »

ok i understand loading and saving the format of a map editor even GUI for one, but i dont understand editing the map in the program
Image
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: map editor help

Post by ismetteren »

acerookie1 wrote:ok i understand loading and saving the format of a map editor even GUI for one, but i dont understand editing the map in the program
I think you should be able to figure that out if you think about it. After all that is what programming is about.

But what you want is a GUI libary with an GUI object that can register mouse clicks and allows you to draw on it. You will also need a way of choosing wich tile you want to draw(use your imagination a drop down list? each number button on the keyboard is mapped to a different tile? there are probably many ways to do it way better than that, but its a start). Now you can translate the mouse click coordinates into a position, maybe you want tiles to be located everywhere, maybe you want them to snap to a gitter. Combining that position, with the tile image gives you some nice data you can put into a tile object and then into an array(vector, list, another datastructure, an array might not be a good idea since it cant expand). You will then draw that array onto the click- and draw-able surface.

If you use java you can probably use a JPane for that click/draw able element and im sure there is an equvelant in C#. I guess that every other GUI libary out there has one too.
Image ImageImage Image
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: map editor help

Post by MrDeathNote »

Lusikka mage has a really helpfull document, i had a quick look at it when i was writing my first map editor. You can can check out her doc here http://www.moosader.com/tutorials.html. I'll also use this as a chance to plug my youtube vid showing my C#/GDI+ map editor which still isn't finished but some day.......

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wRz43LChQVU&hl ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wRz43LChQVU&hl=en_GB&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/youtube]
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: map editor help

Post by acerookie1 »

ismetteren wrote:
acerookie1 wrote:ok i understand loading and saving the format of a map editor even GUI for one, but i dont understand editing the map in the program
I think you should be able to figure that out if you think about it. After all that is what programming is about.

But what you want is a GUI libary with an GUI object that can register mouse clicks and allows you to draw on it. You will also need a way of choosing wich tile you want to draw(use your imagination a drop down list? each number button on the keyboard is mapped to a different tile? there are probably many ways to do it way better than that, but its a start). Now you can translate the mouse click coordinates into a position, maybe you want tiles to be located everywhere, maybe you want them to snap to a gitter. Combining that position, with the tile image gives you some nice data you can put into a tile object and then into an array(vector, list, another datastructure, an array might not be a good idea since it cant expand). You will then draw that array onto the click- and draw-able surface.

If you use java you can probably use a JPane for that click/draw able element and im sure there is an equvelant in C#. I guess that every other GUI libary out there has one too.
no i'm using the win32 api. and i know how to do the drop down list, menus , right click menus. just editing is the problem. maybe i should write a console version to see if i can anaylze the porblem.
Image
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: map editor help

Post by acerookie1 »

MrDeathNote wrote:Lusikka mage has a really helpfull document, i had a quick look at it when i was writing my first map editor. You can can check out her doc here http://www.moosader.com/tutorials.html. I'll also use this as a chance to plug my youtube vid showing my C#/GDI+ map editor which still isn't finished but some day.......

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wRz43LChQVU&hl ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wRz43LChQVU&hl=en_GB&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/youtube]

yeah thtas actually what im following. still lookin at the source to figure that out.
Image
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: map editor help

Post by ismetteren »

Can i ask what you mean by editing? because if it isent placing tiles on a map, i dont know what it is.
Image ImageImage Image
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: map editor help

Post by acerookie1 »

ismetteren wrote:Can i ask what you mean by editing? because if it isent placing tiles on a map, i dont know what it is.
i mean placing tiles on a map.
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: map editor help

Post by eatcomics »

He has nothing to render images with... Since he's using the winapi he just can make windows and such, he needs another api for images... try SDL
Image
Post Reply