Making level editors?

This forum is currently in read-only mode.
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • Wasn't sure where the best place to put this was, but Help and Support seemed like the best bet.

    Ok, well I've seen more than a few people mention how they've made level editors for their games, rather than just creating the levels directly in construct. I was curious if someone who's done this could explain how? Like, I'm guessing this is so they can use tiles in a quicker fashion right? But how do you set it up to save it out correctly and in a readable format, or do you just save one huge image file (which sounds really unlikely and I hope the latter is not the case!).

    Can your level editors do other things too? If so, what?

    Have you made other tools in the same way for use in creating your game? If so, what were they?

    I'm just curious really as it would be something I wouldn't mind having a go at doing, but creating a working editor from an editor warps my brain a bit right now and I'm not sure how one would work. But they do sound useful, since every game is different and no matter how awesome construct is, having a custom editor for a game you happen to be working on at the time sounds really helpful.

  • Let me give you a very simple example for some sort of grid-based game.

    So you would make your editor in a way that when you clicked somewhere on the playfield, it would create a tile at the current grid position.

    Mouse1 clicked -> create tile at floor(MouseX/32)*32, floor(MouseY/32)*32... if your grid resolution was 32 that is. Then you'd have an Array with the correct dimensions: LayoutWidth/32 = Array.SizeX and LayoutHeight/32 = Array.SizeY. And on click or with a loop on saving you could set the value of the array to info that is relating to the object at that position (object name or animation name/frame of the tile for example). To save your level you can simply use the save to file action of the array.

    Now in the game you run a For each element loop of the array and create the according objects at Array.CurrentX*32 and Array.CurrentY*32 positions. And then you'd have your game engine on top of that. Voila...

    That's for a very simple example. You should also look into Hash tables and INI files, which are usually used to store data outside of the game exe itself too. For more complicated editors an array wouldn't be feasible after all.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've made a full timeline based animation editor/recorder for a complex character rig.

  • Let me give you a very simple example for some sort of grid-based game.

    So you would make your editor in a way that when you clicked somewhere on the playfield, it would create a tile at the current grid position.

    Mouse1 clicked -> create tile at floor(MouseX/32)*32, floor(MouseY/32)*32... if your grid resolution was 32 that is. Then you'd have an Array with the correct dimensions: LayoutWidth/32 = Array.SizeX and LayoutHeight/32 = Array.SizeY. And on click or with a loop on saving you could set the value of the array to info that is relating to the object at that position (object name or animation name/frame of the tile for example). To save your level you can simply use the save to file action of the array.

    Now in the game you run a For each element loop of the array and create the according objects at Array.CurrentX*32 and Array.CurrentY*32 positions. And then you'd have your game engine on top of that. Voila...

    That's for a very simple example. You should also look into Hash tables and INI files, which are usually used to store data outside of the game exe itself too. For more complicated editors an array wouldn't be feasible after all.

    Ahhh! Damn that sounds so useful! So much simpler than I thought too. I suppose with some effort you could even include a custom editor as part of the game too couldn't you? If all the complex bits remained internal, then the editor just let you place things. It's within the realms of possibility isn't it. Dammit this program is cool, lol.

  • Ahhh! Damn that sounds so useful! So much simpler than I thought too. I suppose with some effort you could even include a custom editor as part of the game too couldn't you? If all the complex bits remained internal, then the editor just let you place things. It's within the realms of possibility isn't it. Dammit this program is cool, lol.

    Of course it's very possible. If everything turns out as intended my next small game will include the level editor.

    I've made a full timeline based animation editor/recorder for a complex character rig.

    Sounds like a very cool thing actually.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)