The Daily Click ::. Forums ::. Klik Coding Help ::. How to make a level editor?
 

Post Reply  Post Oekaki 
 

Posted By Message

J.C



Registered
  22/03/2013 05:18:14
Points
  118
4th January, 2016 at 04/01/2016 03:20:06 -

I am very curious as to how to do this, can anyone on this forum tell me how to make one? It is for a project of mine where I want to create a single room frame with randomly generated levels (at least 10).

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
5th January, 2016 at 05/01/2016 02:32:41 -

For a basic level editor you need this stuff:
code the mouse wheel to scroll between different objects. use 'create' active object event on mouse click.
To do a grid, do this:
Set Active object Grid selector X position to (xmouse/16)*16
Set Active object Grid selector Y position to (ymouse/16)*16

place an ini object and code a file selector.
write a fast loop to save all objects (using a qualifier) into an ini.
write a fast loop to load all objects (using a qualifier) from an ini.

And there you go. Unfortunately, if you want random level generation it's experts only.
However, there was a recent post about random maze generation you may like to read.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
5th January, 2016 at 05/01/2016 05:57:30 -

Airflow gave the basic rundown on how to make a level editor for a 16x16 tile based game.

Basically you need these things for any type of editor:
-The editor itself (a way to "edit")
-A way to save/store the work done in the editor
-A way to load it up again

As Airflow said the ini object can be used, but pretty much any extension that can save data to the disk can be used. I've used the editbox in the past to save level date formatted as a string of characters. Another popular method is using an array object.

For loading and/or saving you will want to use a loop. In fusion a loop is basically an event that runs multiple times when called. That way you can save and load a level "instantly," or at least in a way that appears like it to the user. Since a loop executes completely before rendering the changes to the screen the user will simply see the level appear all at once rather than each piece loading in at a time.

If you need more detailed help than this there are a couple of tutorials/examples online you could look at. If you need help finding them feel free to ask again here.

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
5th January, 2016 at 05/01/2016 22:15:12 -


Originally Posted by -UrbanMonk-
Airflow gave the basic rundown on how to make a level editor for a 16x16 tile based game.

Basically you need these things for any type of editor:
-The editor itself (a way to "edit")
-A way to save/store the work done in the editor
-A way to load it up again

As Airflow said the ini object can be used, but pretty much any extension that can save data to the disk can be used. I've used the editbox in the past to save level date formatted as a string of characters. Another popular method is using an array object.

For loading and/or saving you will want to use a loop. In fusion a loop is basically an event that runs multiple times when called. That way you can save and load a level "instantly," or at least in a way that appears like it to the user. Since a loop executes completely before rendering the changes to the screen the user will simply see the level appear all at once rather than each piece loading in at a time.

If you need more detailed help than this there are a couple of tutorials/examples online you could look at. If you need help finding them feel free to ask again here.




Yes, I would love to see some examples, as that would be most useful in helping me figure out how to code all of this together.

Oh, some random level generation with a level editor is for experts? Then I guess I will have to scratch off the "randomized level generation thing" and just make pre-made layouts.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
6th January, 2016 at 06/01/2016 01:59:23 -


Oh, some random level generation with a level editor is for experts? Then I guess I will have to scratch off the "randomized level generation thing" and just make pre-made layouts.



basically yeah, but premade layouts are higher quality anyway. There's a computational dissonance between playable game content and generate content. Generated content cannot identify players capabilities, and in turn relies on the developer to configure it, leaving your high quality game with a void only filled with premade layouts anyway.

In my project wave I've provided tool assist level creation tools. This helps create levels without taking away level creator control. You can do this for a level editor by having things like 'click and drag to fill a rectangle with tiles'. A lot of level editors for indie games ignore simple but powerful functions like this. I speak of Mario X, Knytt stories, rpg maker, and various level editing tools. I like to think along the lines if a non-coder can use it then it's good, but you also want to reduce time expenditure. There's nothing stopping you from getting out notepad and typing your level data with the keyboard. Nothing wrong with it at all, that's how Super Mario Bros 3 on the nes was made, it's just time consuming.

TL;DR all good games focus on a level editor. I recommend making a level editor with a variety of simple but effective tools. You should think of random generation as a form of level editing.

Edited by Airflow

 
n/a

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2723
6th January, 2016 at 06/01/2016 15:25:27 -

I would start with a simple kind of level editor:
- small screen estate
(to get to know the idea, before working with scrolling)
- dedicated object library, level space to edit and menu bar
(to keep calculation of positions and objects simple)
- some way of saving
* text strings with characters
* ini file with fastloop
* ini file with a group that emulates a fastloop
(that way the fastloop extension isn't needed)
That should get you started.

For random level generation, there are all kinds of checks and balances
that need to be implemented in order to achieve a playable level.
I am pondering on one for DTV Boxes:
http://create-games.com/download.asp?id=8978
and also when I've created some spare time.

Cheers and happy clicking!


 
Image jenswa.neocities.org

Graeme2408



Registered
  03/03/2008
Points
  370
7th January, 2016 at 07/01/2016 01:39:20 -

This: http://community.clickteam.com/threads/65931-Simple-level-editor-with-saving-and-loading

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
7th January, 2016 at 07/01/2016 16:02:33 -


Originally Posted by Graeme2408
This: http://community.clickteam.com/threads/65931-Simple-level-editor-with-saving-and-loading

Thanks, but it requires Window Control and File, extensions that can't be found anymore...

 
n/a

Graeme2408



Registered
  03/03/2008
Points
  370
9th January, 2016 at 09/01/2016 19:21:15 -

Windows control file here: http://community.clickteam.com/threads/85019-Window-Control-extension-for-MMF2

INI++ here: http://dark-wire.com/store/extlist.php

File object is built in.


Edited by Graeme2408

 
n/a

LordHannu

Crazy?

Registered
  22/04/2007
Points
  7910

VIP MemberStarTeddy BearRibbonGame of the Week Winner2021 Halloween Competition Winner2022 Hi-Score Mash-up Competition (Bronze)2023 Halloween Competition (Bronze)2023 Halloween Competition Entrant
15th January, 2016 at 15/01/2016 12:00:12 -

Hi! J.C im think i understand what your after.
This dude does Procedural cave generation https://www.youtube.com/watch?v=v7yyZZjF1z4
You generate your map, but it has advancer codes to understand.

Ive made a map editor based on array, very fun.
Also made so it loads whats in the frame and erase all objects outside of frame so i doesnt have thousands of actives at once on a stage.

retro style on it. 255colors. Made this 3 days ago.
Image
This is how mine looks like at the moment.

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
16th January, 2016 at 16/01/2016 00:10:13 -


Originally Posted by LordHannu
Hi! J.C im think i understand what your after.
This dude does Procedural cave generation https://www.youtube.com/watch?v=v7yyZZjF1z4
You generate your map, but it has advancer codes to understand.

Ive made a map editor based on array, very fun.
Also made so it loads whats in the frame and erase all objects outside of frame so i doesnt have thousands of actives at once on a stage.

retro style on it. 255colors. Made this 3 days ago.
Image
This is how mine looks like at the moment.



Yes! That is just what I am aiming for!

Only problem is, I have no idea how to do that in MMF2. If you could provide a sample mfa file I can look at, it would be most helpful.

 
n/a

LordHannu

Crazy?

Registered
  22/04/2007
Points
  7910

VIP MemberStarTeddy BearRibbonGame of the Week Winner2021 Halloween Competition Winner2022 Hi-Score Mash-up Competition (Bronze)2023 Halloween Competition (Bronze)2023 Halloween Competition Entrant
17th January, 2016 at 17/01/2016 18:14:12 -

Basic editor.
http://www.splattersoft.com/CGames/LevelEditor.mfa

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
19th January, 2016 at 19/01/2016 06:04:20 -


Originally Posted by LordHannu
Basic editor.
http://www.splattersoft.com/CGames/LevelEditor.mfa

Great! Thanks, LordHannu.

Now, how would I go about loading the edited level into a frame? What about randomizing levels as well with your system?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click