Skip to main content
gamedev.net
🔒 Locked

Map editor

Started by MARS_999 Oct 23, 2002 at 11:28 PM 9 replies 700+ views
Original Post
MARS_999
MARS_999
I am think about coding a map editor for my RTS game I would like to make. I was wondering if anyone here has done it already and has any pointers or resources I could read up on the subject before I dive into it. Thanks "You have Freedom, sir" "Were do I have freedom" "Only in your head, we control the rest of your body and life for now" "My FREEDOM isn''t for sale"
iNsAn1tY
iNsAn1tY
Well, I''m writing a map maker for my FPS engine (it''s called DarkVertex; you can find it by following the link in my sig), and I found it useful to define exactly what I was doing first. I sat down and thought about what kind of engine I was writing. I decided it was a Half-Life/Quake3 type engine. So I got a version of Hammer editor and q3radiant and figured out how they both did what they did. Then I made a list of useful features they both had that my editor would need. Finally, I sat down to write my editor.

It''s much better to define yourself some set boundaries (and to write them down so you don''t forget them) than it is to blunder in and try to make an editor (or engine, for that matter) that''s got so many "useful" features that it''s impossible to code. I started out with simple stuff, like setting up the user interface, and creating a box object using the mouse. Then I coded a tool that allowed me to move the box, then one that rotated it, and so on, and so forth. It''s all in the planning...


Movie Quote of the Week:

"Mr. Madison, what you have just said is one of the most insanely
idiotic things I have ever heard. At no point in your rambling,
incoherent response were you even close to anything that could
be considered a rational thought. Everyone in this room is now
dumber for having listened to it. I award you no points, and may
God have mercy on your soul."
- The Principal, Billy Madison.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
leblebi
leblebi
I wrote a level editor very similar to WorldCraft. As iNsAn1tY already said, first thing you should do is sit down and download some editors. Hammer, Radiant and Quark for example. Start using them. Especially read the user''s manual of Radiant, learn to use it or at least have an idea what it is capable of. Then decide which operations you need. For example carving/hollowing, undo/redo, etc. Then decide what kind of user interface you want. A simple one like worldcraft or a complex one like radiant.

What I did is I simply immitated WorldCraft in its user interface and tried to add the functionality of radiant. Once you have a design redy for you ( in my case WorldCraft''s ) user interface becomes piece of cake.

Good luck, and dont and up in a mess like Quark (IMHO)

Oztan
MARS_999
MARS_999
Ok, so are you people using OpenGL for your map editor or direct X? I am gonig to be using OpenGL. I am thinking of a 2D top down view and you would cut and paste the tiles where you want to have them. Once the map was done how are you saving the data? I was thinking of an 2D array? and one with gray scale for height mapping?


  
int map[10][10] = {0};
//this array would hold a 10x10 map

//and store the values of the textures e.g. 0,1,2,3

//then I would write this array to a binary file or .txt file

//and then it could be loaded into my tile engine to display the

//map

int height_map[10][10] = {0};
//this array would hold the gray scale values for each pixel

//in the texture to determine height?



is what I am thinking on doing here correct? I think the idea is right. I know their is a lot more code, but just showing my general idea. Thanks



"You have Freedom, sir"
"Were do I have freedom"
"Only in your head, we control the rest of your body and life for now"
"My FREEDOM isn''t for sale"
iNsAn1tY
iNsAn1tY
Yeah, I use OpenGL. The system you specify below will probably work very well. I only just noticed you''re making an RTS game. I only skim-read it, and thought it said RPG. My mistake. What you could do with getting is something like the Red Alert Map Editor. It came with Red Alert (not sure about RA2), and it also used a tile-based system to create it''s maps. It had a top-down 2D view, with all the stuff you could make in little menus at the side. I''m not sure if any other RTS titles have similar map editors, but I''m sure you could lay your hands on one if you looked hard enough.

I''m saving my maps as intermediate binary files at the moment, as I haven''t written the Compile function which will create a BSP tree and do the PVS, etc.

Using a tile-based editor is a good idea. You can create maps really easily, and like you said, they compile into very small files. It''s also very easy to flag which tiles cannot be passed over by units. Good luck with it...


Movie Quote of the Week:

"Mr. Madison, what you have just said is one of the most insanely
idiotic things I have ever heard. At no point in your rambling,
incoherent response were you even close to anything that could
be considered a rational thought. Everyone in this room is now
dumber for having listened to it. I award you no points, and may
God have mercy on your soul."
- The Principal, Billy Madison.
Try http://uk.geocities.com/mentalmantle. Seriously. It''s brilliant.
And I just completely redesigned it so it looks even better.
DarkVertex Beta 0.8 available soon!
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
FDGaming
FDGaming
I''m currently writing an area editor for a MMORPG. It uses bezier patches for the terrain, but I think that you should just get the height data for the terrain done first. 2D height arrays work best, make sure that you don''t save too much data, or else you''ll end up with a GB of map data. :S

I prefer to use MFC with OpenGL for my tools, because of the dialog box stuff.

Here''s a great tutorial on setting up an OpenGL view with MFC, I''ve used the OpenGL MFC class in it, and it''s pretty great.

http://www.codeguru.com/opengl/texture_mapping.shtml

-Fredric
-FDGaming(CEO, Lead Programmer)
MARS_999
MARS_999
Thanks all, I will keep on working with what I have started then. Thanks again.

"You have Freedom, sir"
"Were do I have freedom"
"Only in your head, we control the rest of your body and life for now"
"My FREEDOM isn''t for sale"
Thunder_Hawk
Thunder_Hawk
Don''t forget StarEdit, the editor that comes with Starcraft...I don''t suggest you put all that stuff in there (that would take forever), but it should give you some good ideas. It happens to use Win32 (I think it would be easier to use Win32 or MFC for this purpose, but that''s just my opinion).

_____________________________

And the Phoenix shall rise from the ashes...

--Thunder_Hawk -- ¦þ
______________________________
______________________________________________________________________________________The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ"So. Any n00bs need some pointers? I have a std::vector<n00b*> right here..." - ZahlmanMySite | Forum FAQ | File Forma
MARS_999
MARS_999
Yeah, I am planning on using Win32 API and use SDL and OpenGL to run the game engine. Thanks for the info its good to see I am thinking on the same wavelength as everyone else!!

"You have Freedom, sir"
"Were do I have freedom"
"Only in your head, we control the rest of your body and life for now"
"My FREEDOM isn''t for sale"
Basiror
Basiror
maybe you want to know that i have written a little compiler for radiant and worldcarft .map files

right now i am working on texture generation which should be done soon
it converts the mesh to ogl coordinate system as well
let me know if you are interested i gonna set up a page soon to keep the public updated
http://www.8ung.at/basiror/theironcross.html
Digitalfragment
Digitalfragment
How do you read the blasted map files?
Ive tried and tried, but i cant work out how to read the brush data. How do you determin all of the vertices of the faces, when you are only given 3 of them?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.