Archived

This topic is now archived and is closed to further replies.

jtecin

Creating a Level/Map Editor

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites