• Create Account

## Creating a Level/Map Editor

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

11 replies to this topic

### #1jtecin  Members

Posted 07 November 1999 - 02:07 PM

Okay, the next step in my game is to make the map editor. I was wondering what people think I should use to make this? I was going to use DirectX, but I don't need the speed and it would make it more complicated than it needs to be. MFC would also make it too complicated. I want to use traditional style windows programming, straight API calls, but I don't know how to do things such as load and display bitmaps. Does anybody know a site or something that goes over this? Thanks.

### #2Niels  Members

Posted 31 October 1999 - 10:50 PM

My recommendation would be to create two DLL's (possibly in C++), one for data manipulation (I.e. a "librarian") and one for visualization (using DirectX in a window), and then glue it together using e.g. VB.

I wrote the editor for my game using the normal windows API and DirectDraw (no MFC), but the UI is not as friendly as it could have been, and I found myself spending way too much time doing simple things that would've been a given in VB...

/Niels

### #3ZomeonE  Members

Posted 31 October 1999 - 11:28 PM

Good idea, but i don't know how to make dll's and use them in vb. Is there any article on the net about dll's and vb?

### #4Daemon  Members

Posted 01 November 1999 - 01:34 AM

To make DLLs look in the help online of VC++.
To use DLLs in VB there are two ways:
1) if the DLL is an ActiveX Automation Server, just go in the references and add the .tlb, the objects will be available to you with no prob.
2) if the DLL is just a plain, ol' happy DLL, use:
code:
[Public | Private] Declare Sub  Lib "" [Alias ""] [([arglist])]

Where is the name of the function you want to use, is the actual name of the DLL, and is the actual name of the function as is in the DLL. You use the when the would clash with a VB keyword, or another function.
code:
Declare Sub First Lib "MyLib" (X As Long)

Now, I suggest you get the help online of VB and read it, along with a book on VB.

### #5Anonymous Poster_Anonymous Poster_*  Guests

Posted 01 November 1999 - 01:46 AM

try learning Win32 API programming here:
http://www.relisoft.com/

### #6Splat  Members

Posted 01 November 1999 - 11:02 AM

As for your "visualization" DLL, as someone so nicely put it, I would _seriously_ recommend using the same code that drives the graphics in your game, only in windowed mode. This way, you get a WYSIWYG map editor that ALSO will expose errors in your graphics engine and provide a nice platform to get started.

VB would be a nice way to make the map editor IF you already had the graphics engine in modular form. However, most game programmers hard-code / mush everything in their game together and thus separating the grpahics engine from the rest of the game might prove difficult.

If you want to take the time, all a map editor really is is your game with movable / insertable pieces and no "game" logic. So basically, build a game that is the map editor. Or use VB. Or use MFC - yuck ;(

- Splat

### #7Anonymous Poster_Anonymous Poster_*  Guests

Posted 01 November 1999 - 06:11 PM

So, are you saying we should have the game
ready(interfaces, logic,...) and use it to
combine with MFC or VB for "friendlier"
UI on our map editor?

### #8INVERSED  Members

Posted 01 November 1999 - 07:39 PM

That's essentially what we plan to do, take our engine code, and place it into an MFC driven app w/ ddraw, just to give it a nice interface.

### #9Matt  Members

Posted 01 November 1999 - 08:11 PM

You can create very easy to use editors without MFC or VB, and the resulting editors are significantly smaller and faster.

As mentioned, you should make the editor pretty much wysiwyg, and as easy to use as possible, unless of course you plan on using it.

Recently when I gave my editor to someone who is going to design levels, they just couldn't "get it", So I went back and spent a day or two to make it very visual and give instant feedback.

Every feature you add, or hour you spend making your editor easier to use and more powerful, means the resulting levels or maps will be that much better.

### #10Anonymous Poster_Anonymous Poster_*  Guests

Posted 02 November 1999 - 05:10 AM

I too grappled with this problem. Initially i choosed to write a simple GUI, very similar to the gui described in the series of articles on gamedev :
http://www.gamedev.net/reference/programming/features/gui/ http://www.gamedev.net/reference/programming/features/gui2/ http://www.gamedev.net/reference/programming/features/gui3/ http://www.gamedev.net/reference/programming/features/gui4/

But then, after doing more research into the win32 api, not MFC which also uses the win32 api, I thought it would be useful to intergrate the functionality of the api with my gui. That's what i did, now i have the functionaly of prebuilt windows components and dialogues, and the WYSIWYG compabilitiy with my existing engine through the legacy gui code. IF i had to do it over, i would proably still choose this route as having WYSIWYG (What you see is what you get.) funtionality is critical to effective level designing, i feel. Good Luck!

-ddn

### #11jtecin  Members

Posted 06 November 1999 - 07:49 PM

Okay, I finished my map editor for the most part(woohoo!). I already had a graphics engine written so I just used DirectX. The only problem I have now is saving. I have it so it will write to the file and load properly, but I want the *user* to be able to choose what file to save it to. I was going to use a dialog box, but here is my problem:
I can use MFC to create a dialog box during a regular windows application, but how do I get info and stuff from a dialog box in this case? I used my game skeleton to make the map editor, so it is constantly flipping the surfaces.

### #12Splat  Members

Posted 07 November 1999 - 02:07 PM

If it's not too much trouble, just DlipToGDISurface when you display the dialog box and set a (global) flag to switch off page flipping until the dialog box is done. This is how most DirectX games handle Windows dialog boxes.

- Splat

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.