Creating a Level/Map Editor

Started by
10 comments, last by jtecin 24 years, 5 months ago
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

<b>/NJ</b>
Advertisement
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?
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.
-----------Érdely!
try learning Win32 API programming here:
http://www.relisoft.com/
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

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?
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.
Write more poetry.http://www.Me-Zine.org
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.

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

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.

This topic is closed to new replies.

Advertisement