Sign in to follow this  
Hot_Tamalle

[.net] Level Editor

Recommended Posts

Hi everyone, I have to make a Level Editor in C#. This editor has to be something like a paint program where instead of paint, users can use bricks,blocks,walls etc to make a maze. This maze will then be saved to a file and later on will be used as a level in a game. The above task is totally out of my area of expertise. I've used C# for databases (ADO.net) but not for graphics. I need some one to point me in the right direction as to how should i get started with this task. i googled this topic but couldn't find anything concrete. So does anyone know of any good sites/tutorials that can help me with this? I look forward to be a favorable reply. Thankyou.

Share this post


Link to post
Share on other sites
Well... I assume your level will be a tiled level in 2D. In that case you can have a simple array of tiles to represent the map. When the user clicks you know what tile he is clicking on based on the X & Y coordinates. From their it is just changing properties and drawing tiles and their changes, etc. That just requires an API, like DirectX, OpenGL or to use GDI+.

Share this post


Link to post
Share on other sites
Despite what you think, using a third-party level editor might actually end up being a better solution. Not only will it cut down development time for you, but also give you the ability to use a dedicated tool that's been proven to work in many different situations.

I've been using Tile Studio to output a script writen in Boo. This script is then compiled at runtime and the map object is created. You could also have it output C# code which is then read in using the .NET's CodeDom.

Although it is a pain to learn how to output code correctly with an external tool, I think it's worth spending the time to learn how to do it. Scet has been publishing some pretty amazing stuff in his journal. You could check it out and see what your thoughts on it are. It seems he just ported his SDL example to C# and MDX as well! [wink]

Share this post


Link to post
Share on other sites
Yes I ( of course ) second the TileStudio suggestion. Don't let my complex .Net binary loader throw you off. TileStudio can output any format you want it too, even just a plain text 2D array. That's what's so great about it.

Share this post


Link to post
Share on other sites
ok but the editor will have multiple objects that the user can choose from(for example bricks,walls,wood pieces etc). How will i differentiate b/w them?

Share this post


Link to post
Share on other sites
I can't use a 3rd party software because this level editor is part of a bigger software project that we ( me and some other people) are making. This is my part so i need to know the inside - out of this thing.


Share this post


Link to post
Share on other sites
Quote:
Original post by Hot_Tamalle
ok but the editor will have multiple objects that the user can choose from(for example bricks,walls,wood pieces etc). How will i differentiate b/w them?


You could alsign numbers to to tiles and then create any dynamic objects you need when load the map. My code is just an example of how to use TileStudio. The editor is designed to be very flexible, but that adds to the programming work needed to load more complex levels.

Quote:
Original post by Hot_Tamalle
I can't use a 3rd party software because this level editor is part of a bigger software project that we ( me and some other people) are making. This is my part so i need to know the inside - out of this thing.


I don't see why you can't use 3rd party software if it'll do the job. If you guys could use TileStudio then wouldn't that allow you to move on to other things and complete the project faster? I'm not sure how "big" this project is supposed to be, but you should try not to reinvent the wheel.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hot_Tamalle
ok but the editor will have multiple objects that the user can choose from(for example bricks,walls,wood pieces etc). How will i differentiate b/w them?


Generally this is done through a Tile class. Such a class should have properties such as collidable, walkable, etc. Connecting the properties to an actual tile is just a matter of loading some data file that defines the properties for a specific bitmap/tile.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this