Archived

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

Creating Level Editors

This topic is 5596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve managed to finish up a small game, my first one, and started moving on to another project, a Diablo parody called Hack Slashers. I''m currently attempting to write a simple 2d level editor (c++, Win32 API, GDI) so I don''t have to hard-code in all the levels, but the problem is I have no idea how to go about doing it. right now it creates a window with a menu, and you can "load" tilesets and create new maps. But I have no idea where to put all this information. Do I create a child window which has the tileset in it? Where do I put the Map? How do I draw onto those seperate windows? Now the real question is: Does anyboy know of a tutorial on how to write tools like this for simple games? I don''t just want source-code, or some already made editor that I have to code plugins for, I''m doing this as a learning experience. Any advice helps. Thanks!

Share this post


Link to post
Share on other sites
My only recommendation: share rendering code between your editor and your engine if at all possible. It''s always best to see things how they''ll appear earlier than later.

As for how to lay things out on screen, usually in a 2D editor, there is one large pane for the level editing, and a secondary, smaller pane for tiles. Click on the tile to activate that tile, then click in the window to "draw" (ala Paint) the tile into the world. As long as you keep dragging the mouse pointer, you keep "drawing." Release the mouse, and you''re done.

I''d also have it so that you can either place objects or tiles, but never both at the same time.

RomSteady - Able to leap off tall buildings in a single bound

Share this post


Link to post
Share on other sites
quote:
Original post by nonnus29
There are so many awesome free level editors out there, Mappy, TileStudio, why would anyone want to make their own?


There are so many free games out there, why would anyone want to make their own?


University is a fountain of knowledge, and students go there to drink.

Share this post


Link to post
Share on other sites
I've got a question along these lines as well. I'm currently attempting to start a level editor for a small engine of mine, and I've realized, I don't have a clue what to do. Just how does a person actually render multiple, sizable OpenGL/Direct3D viewports in a window, within a normal app window?

I've been looking around for a good part of the day and I've not actually found anything on it. There's nothing in my Petzold book on it really, and that predates modern graphics programming.

I'm attempting to use the same graphics engine to drive both the normal game, and the editor viewports. I just don't know how to write the flippin app window =)

[edited by - Phoe on August 19, 2002 7:22:56 AM]

Share this post


Link to post
Share on other sites
I would build the editor directly into the game engine.

Your engine will need to display maps, allow the user to click (and determin where in the game world they clicked). It will need to to have some sort of gui.

Why not use these things to make a special editor mode that can either be started from a key press/menu option, or by passing some parameter to the program on the command line?

You dont want to end up maintaing two seperate programs. You fix a bug in one, and have to remember to fix it in the other.

Alan

Share this post


Link to post
Share on other sites
If you keep the engine in a dll you don''t have to worry about 2 code bases. And I specifically need to learn how to make the window anyways, tools programming is somewhat required in the industry, and they don''t really teach it at my school. I also don''t want to write the scads of GUI code an internal editor would require.

Thanks for the URL

Share this post


Link to post
Share on other sites
You can also mix DirectX with MFC, if you have that, or code your window by hand. You can set up a major editor in hours with MFC.

You would also need to learn how to use DirectX in windowed mode. It''s not too bad. You basically just don''t set the display mode, and need to load in your graphics by figuring out the current display''s pixel formats. There are tutorials here for both of those tasks. Oh yeah, you also need to capture windows messages for handling your mouse positions, and using GetClientRect or whatnot.

Once you get those things out of the way, most of your existing engine should still work.

Jiia

Share this post


Link to post
Share on other sites
Thanks for all the replies, I''m well on the path of making one now should be basically done in about a week, but just with simple features like loading tilesets, layers, easy point-click-paint interface, saving and loading maps. It''s actually almost done now, but I hate having globals so I''m re-designing it so its a little more eye-friendly for me.

Share this post


Link to post
Share on other sites
What about 3D level editors ? Is it worth making one ?

I''m thinking of one where I could define
- npc path
- camera path
- positions for particle system emitter
- naming some of the positions on the 3D map

I thought of modelling using one of the available modelling packages, and then integrate them through the level editor where I put in the features mentioned above. Then headaches will arrive when compiling the level.

lahuze


- there is no difference between reality and fantasy -

Share this post


Link to post
Share on other sites