Nifflas' Support Forum

Released Games => Knytt Underground => Topic started by: Fubaka on January 07, 2013, 21:13:43

Title: Will there be a level editor?
Post by: Fubaka on January 07, 2013, 21:13:43
I heard discussion on the matter back when this game was still in development, but I am wondering if a level editor for Knytt Underground is still underway, and if so, what is the ETA on that?

I ask because I would personally be overjoyed if I could make custom levels for this game, and the way the Knytt Underground folder is lain out seems to suggest that it was built with an editor in mind.
Title: Re: Will there be a level editor?
Post by: LPChip on January 07, 2013, 21:47:25
Yes. There is most likely going to be an editor. ETA is unknown though. Nifflas mentioned he does want to bring out an editor, but the current one is messy and buggy, so it needs to be completely rewritten if it can be released to the public.

Nifflas has done so many development for Knytt Underground in the past years that he's going to take a break before starting on this.
Title: Re: Will there be a level editor?
Post by: SiamJai on January 08, 2013, 02:52:48
Yep. From Nifflas right here (http://www.reddit.com/r/IAmA/comments/161g25/i_created_knytt_nightsky_saira_and_knytt/c7rxun5):

Quote from: Nifflas on Reddit
I really want to make a level editor for Knytt Underground, the one I currently have is quirky and difficult to use since it's only intended for myself, and it's quite some hard work to make a new editor due to how advanced the game's level format is. Though I'm not sure when or if, I'd love if the game had an editor though.
Title: Re: Will there be a level editor?
Post by: Pneumonica on January 09, 2013, 01:28:01
Here's hoping an editor also comes out for PS.  Unfortunately, I find that very unlikely.
Title: Re: Will there be a level editor?
Post by: Widget on January 09, 2013, 01:43:41
Having emulated rpg-maker titles on some consoles, I'm not sure how useful that would actually be. Console-based level-editors/game-makers tend to end up as a very slow, awkward way to reorder existing game content; it sounds like a lot of work for very little gain, although this is only half-educated guesswork.
Title: Re: Will there be a level editor?
Post by: AA on January 09, 2013, 07:35:51
^ Well, you can attach a keyboard and mouse to the PS3, so the only differences would be in file management (that could be handled by the editor itself) and the ways to gather artwork for your level. But yeah, probably too much effort unless they think they can monetize it via the store.
Title: Re: Will there be a level editor?
Post by: LPChip on January 09, 2013, 09:30:52
Its unlikely that there will be a PS version of the editor.
Title: Re: Will there be a level editor?
Post by: EhPlus on January 12, 2013, 04:58:04
A level editor on the PS3 sounds quirky, but if Nifflas can integrate a user-friendly level editor around Knytt Stories ease for the PC, I'd be all over that.  :^^:
Title: Re: Will there be a level editor?
Post by: Widget on January 12, 2013, 06:51:13
A level editor on the PS3 sounds quirky, but if Nifflas can integrate a user-friendly level editor around Knytt Stories ease for the PC, I'd be all over that.  :^^:

I don't think we'll be seeing an editor with the simplicity of Knytt Stories'. Much like with Saira's editor (though maybe to a lesser extent), KU will be more complicated to make levels for because it's so much more graphically complex, let alone all the other ways in which it's more complex than KS.
Title: Re: Will there be a level editor?
Post by: LPChip on January 12, 2013, 12:44:32
For sure. Alone by the fact that it involves python scripting for doing about anything in the game. (from teleporting to opening doors to quest dialogs)
Title: Re: Will there be a level editor?
Post by: Headgrinder on January 12, 2013, 23:15:20
That's a shame to hear.  Although ego's KS+ is almost done, I was thinking that a KU editor would be a lot of fun, even though I still prefer the KS feel an physics.  But if you have to do scripting... well, not sure my patience, limited time, and brain could handle that.  XP
Title: Re: Will there be a level editor?
Post by: LPChip on January 13, 2013, 00:02:21
That's a shame to hear.  Although ego's KS+ is almost done, I was thinking that a KU editor would be a lot of fun, even though I still prefer the KS feel an physics.  But if you have to do scripting... well, not sure my patience, limited time, and brain could handle that.  XP

The scripting is really minimal though. If you dive into it, even if its just copy/pasting existing scripts, you can do a lot already.

Here's an example of what a phyton script can be:

def function_keypress(identifier):
    if (identifier == 'Blurbloble'):
        global_script.simple_choice_npc('Blurbloble')
Title: Re: Will there be a level editor?
Post by: GrayFace on January 13, 2013, 01:22:56
What does that mean? There's no 'Blurbloble' key is Keys Setup :/
Title: Re: Will there be a level editor?
Post by: Dj Gopher on January 13, 2013, 03:06:23
I'm sure we would see user made scripting guides, similar to the user made level .ini guides we've seen for KS.
LPChip: Can't a platform be built to write scripts when you give it basic information? This would allow for all things up to a certain level of complexity to be covered entirely, making the user have to work on scripts himself only when he is trying to do something more complex...
Title: Re: Will there be a level editor?
Post by: Widget on January 13, 2013, 08:28:14
What does that mean? There's no 'Blurbloble' key is Keys Setup :/

Well, it's just an example. It could be any key already bound but that would interfere with existing commands; as an alternative, I assume it'd be possible to define a unique 'Blurbloble' key which would call the (also as-yet-undefined) 'Blurbloble' script if pressed... I think, anyway.

Forgive me if that's all wrong, though. I've never dabbled with coding anything :P
Title: Re: Will there be a level editor?
Post by: AA on January 13, 2013, 12:54:42
Can't a platform be built to write scripts when you give it basic information? This would allow for all things up to a certain level of complexity to be covered entirely, making the user have to work on scripts himself only when he is trying to do something more complex...

It depends on what level of complexity we're talking about. I'm sure scripts for things like the Knytt Stories Warp are simple and also easy to make a graphical interface for, but the Python script would also be very short and easy to understand; it could still be worth it to make the editor build scripts automatically given a few templates, but which ones to choose?

Aside: what happens when a Python script for a room has a syntax error?
Title: Re: Will there be a level editor?
Post by: LPChip on January 13, 2013, 13:57:38
What does that mean? There's no 'Blurbloble' key is Keys Setup :/

Well, it's just an example. It could be any key already bound but that would interfere with existing commands; as an alternative, I assume it'd be possible to define a unique 'Blurbloble' key which would call the (also as-yet-undefined) 'Blurbloble' script if pressed... I think, anyway.

Forgive me if that's all wrong, though. I've never dabbled with coding anything :P

Oh, no thats not how it works. You place an item on the map, and you give it an identifier. The item allows you to activate it, which is where the keypress comes from. When you activate it, it triggers this script and checks which identifier on the map was triggered. You could work with 1, 2, etc... but it will be really difficult to go back on a screen if there are more than one items to check what does what.

Can't a platform be built to write scripts when you give it basic information? This would allow for all things up to a certain level of complexity to be covered entirely, making the user have to work on scripts himself only when he is trying to do something more complex...

It depends on what level of complexity we're talking about. I'm sure scripts for things like the Knytt Stories Warp are simple and also easy to make a graphical interface for, but the Python script would also be very short and easy to understand; it could still be worth it to make the editor build scripts automatically given a few templates, but which ones to choose?

Aside: what happens when a Python script for a room has a syntax error?

I'm sure we could make something that outputs scripts and then you copy/paste it into your room. I don't know what happens when you have a syntax error, but I assume the script just ignores it and doesn't do anything. I haven't actually tried that out.
Title: Re: Will there be a level editor?
Post by: GrayFace on January 13, 2013, 17:38:26
Yes, a GUI to create simple scripts can be attached to the script editor (no copy/pasting, just insertion into the point of caret). The only downside is that this won't help with understanding existing scripts, but maybe parsing the script to display such information would also be an option.
BTW, I'll be making the editor from scratch and I'll start pretty soon I think.
Title: Re: Will there be a level editor?
Post by: Widget on January 13, 2013, 18:41:55
Oh, no thats not how it works. You place an item on the map, and you give it an identifier. The item allows you to activate it, which is where the keypress comes from. When you activate it, it triggers this script and checks which identifier on the map was triggered. You could work with 1, 2, etc... but it will be really difficult to go back on a screen if there are more than one items to check what does what.

Just goes to demonstrate why it took me half-a-week's worth of evenings to incorporate a simple python script someone else had already written into a M&B:WB mod; and it all seems so obvious once it's been explained :oops:
Title: Re: Will there be a level editor?
Post by: Headgrinder on January 14, 2013, 00:57:17
Perhaps we'll just have to wait 5 years after the KU editor is released for someone like egomassive to write a script writing platform for it.  XP
Title: Re: Will there be a level editor?
Post by: SiamJai on January 14, 2013, 03:12:38
Well, for KS we had the KS Manager sooner than that... :)
Title: Re: Will there be a level editor?
Post by: AA on January 15, 2013, 09:05:10
I haven't bought the game yet (not because I don't want to), so I was meaning to ask: is there a way (either in the full game or in all versions) to load a different level other than just changing directory and copying all the subfolders but bin and World?
Title: Re: Will there be a level editor?
Post by: LPChip on January 15, 2013, 13:43:51
I haven't bought the game yet (not because I don't want to), so I was meaning to ask: is there a way (either in the full game or in all versions) to load a different level other than just changing directory and copying all the subfolders but bin and World?

This is not yet decided I think. It has a world folder, but I don't know how it currently works. Its possible that there will be an update for the game once there is support, or maybe it automatically detects a new world and works like that.
Title: Re: Will there be a level editor?
Post by: Nifflas on January 15, 2013, 16:52:55
Right now there isn't. As soon as there is an editor (even if it it's a third party one) I'll add in a level selector though and release an update.
Title: Re: Will there be a level editor?
Post by: AA on January 15, 2013, 17:50:04
Thanks for the reply!

Can I ask one more thing? At a glance it seems KU can only use the (animated) Sprites from the Default World. Is this the case? Can new Sprites be added? Can the Sprites.dat file be replaced (I know it's just PNG files)?
Title: Re: Will there be a level editor?
Post by: LPChip on January 15, 2013, 18:11:51
I think, at the current state its best to first wait until the level editor gets into beta before asking these kinds of questions. I know from experience that these kind of questions make development really hard.
Title: Re: Will there be a level editor?
Post by: AA on January 15, 2013, 19:46:58
Oh, don't get me wrong. I asked this mainly because of how the files are placed in the game folder: Sprites.dat is inside the World folder, which makes one think it's part of a single level, but then the game seems to only be able to use that file for Sprites.
Title: Re: Will there be a level editor?
Post by: Nifflas on January 16, 2013, 00:08:38
IIRC, Sprites.dat is a Zip file. World.bin is an uncompressed Binary Array workspace file. All other files should be wav, ogg, png and ini.
Title: Re: Will there be a level editor?
Post by: AA on January 16, 2013, 07:44:04
Sprites.dat isn't a Zip file: it's a bunch of concatenated PNG images. By the way, World.bin is indeed an uncompressed binary file, but the level data is in INI format (the only really binary data is the size of each section).
Title: Re: Will there be a level editor?
Post by: dave.germain on January 18, 2013, 13:29:35
I'm about half way through this game and couldn't be more impressed. A user-friendly level editor for KU would be such a triumph. It would allow the creation of thousands of other games. So cool.
Title: Re: Will there be a level editor?
Post by: CheezyWEAPON on February 12, 2013, 07:19:22
How does one go parsing sprites.dat and if so.. putting it back? Is it a messy, command-line driven process?

It'd be amazing to put in a real Juni and some npc's. I mean, they all seem to work on tiny lil nub legs and bodies. Is every animal shoved into that file?
Title: Re: Will there be a level editor?
Post by: AA on February 12, 2013, 07:29:19
I've found and slightly modified a Python script to extract all PNGs from Sprites.dat. Putting them all together on Linux would be as simple as using 'cat'.
However, adding new Sprites probably won't work, as the data about where to find each frame seems to be hard-coded in the game.
Title: Re: Will there be a level editor?
Post by: BinarySplit on February 12, 2013, 09:46:06
Attached a Python script for extracting the World.bin.

It's quite a simple format. It's just this pattern repeated until EOF:

Change the extension to .py and either run the file in the same directory as World.bin (it should create an "extracted/" subdir) or import it and run """unpackWorldBin("World.bin", "extracted/")"""

Unfortunately it's not very useful at the moment. I've found it easier to just open World.bin directly in Notepad++ (or any other editor that doesn't mess with the format of binary data) and just ctrl+F to the desired location.
Title: Re: Will there be a level editor?
Post by: AA on February 12, 2013, 11:10:32
Nice job there!

Unfortunately it's not very useful at the moment. I've found it easier to just open World.bin directly in Notepad++ (or any other editor that doesn't mess with the format of binary data) and just ctrl+F to the desired location.

If you want to edit it by hand, you'll still have to update the size of the various sections, so if you make a script to put things back together it may be handy.
Title: Re: Will there be a level editor?
Post by: MallowyGoodness on March 23, 2013, 15:00:54
Here's hoping an editor also comes out for PS.  Unfortunately, I find that very unlikely.
Having emulated rpg-maker titles on some consoles, I'm not sure how useful that would actually be. Console-based level-editors/game-makers tend to end up as a very slow, awkward way to reorder existing game content; it sounds like a lot of work for very little gain, although this is only half-educated guesswork.
^ Well, you can attach a keyboard and mouse to the PS3, so the only differences would be in file management (that could be handled by the editor itself) and the ways to gather artwork for your level. But yeah, probably too much effort unless they think they can monetize it via the store.
Its unlikely that there will be a PS version of the editor.

I was going to put these under a spoiler, but they're kind of compact because of the way the forum handles quotes, is that too long for a quote list or no?

Anyway, I don't really see why it wouldn't be possible to have an editor on the PS3 version of the game. I'm not sure how different the PS3 code is compared to the PC version, so if it would require being recoded from scratch then yeah, I can see how that would be a problem, but otherwise the fact that you have two controls sticks, a directional pad, and shoulder buttons for quick array swapping, control wouldn't be an issue as long as it was well thought through.

The biggest problem would be custom content and sharing. I'm not sure if it's possible since I've never seen a game do it, but since games can write .PNG files there's a small chance they might be able to read them too, which is obviously a way to handle custom tile set support, but also a possible way to import/export levels (A game called Voxatron (or was it Voxeltron?) managed to save 3D voxel-based worlds as photo files with long bar codes to represent all the in game data, and also have a cool thumbnail on every one).

I mean you could also just put up a server for levels, but that sounds really expensive and not worth it.

If you can figure out a good way to do sharing I think a PS3 editor is completely in the realms of possibility doablility.
Title: Re: Will there be a level editor?
Post by: dave.germain on August 05, 2013, 17:59:41
Soooo...I guess there will never be a Level Editor. That's a real shame.

I was introduced to Nifflas' games (and this forum) because of the editing capabilities of KS. I imagine that KS did the same for many other people too. I think its because Nifflas was an indie game developer who created an amazing stepping stone for others who wanted to do the same.

With zero chance of future editors, that unique and amazing thing is gone from Nifflas' work. 
Title: Re: Will there be a level editor?
Post by: Raicuparta on August 05, 2013, 19:18:46
Soooo...I guess there will never be a Level Editor. That's a real shame.

I was introduced to Nifflas' games (and this forum) because of the editing capabilities of KS. I imagine that KS did the same for many other people too. I think its because Nifflas was an indie game developer who created an amazing stepping stone for others who wanted to do the same.

With zero chance of future editors, that unique and amazing thing is gone from Nifflas' work. 
I don't understand, where are you coming from with this?
Title: Re: Will there be a level editor?
Post by: AA on August 05, 2013, 19:51:57
Soooo...I guess there will never be a Level Editor.

Technically speaking there's Nifflas's own Level Editor already available (and my own incomplete editor); what's really missing is explicit support for third party Levels.
Title: Re: Will there be a level editor?
Post by: Headgrinder on August 05, 2013, 22:40:18
I was under the impression that Nifflas was not releasing his editor because it was too difficult to use.  Is there a level editor that is similar in usability to the old KS editor???
Title: Re: Will there be a level editor?
Post by: AA on August 06, 2013, 10:04:49
Nifflas sort of released it (http://nifflas.lpchip.nl/index.php?topic=5883.msg62363#msg62363) in the end. I don't know if anyone's working to make it more usable, but I doubt it's a priority now.

My Level Editor (http://nifflas.lpchip.nl/index.php?topic=5936.0) is made like the KS editor, but it can't be said to be 'usable'. I've stopped woking on it; the Java code is included with the download just in case anyone wanted to use it.
Title: Re: Will there be a level editor?
Post by: Headgrinder on August 06, 2013, 12:58:17
Ahh... I see.  Maybe I got scared away by the "It's not at all intended for anyone but myself" line.  XD
Title: Re: Will there be a level editor?
Post by: GrayFace on August 09, 2013, 14:50:20
I'm still intending to do a user-friendly editor, but there's other stuff I'm working on, including getting my PhD.
Title: Re: Will there be a level editor?
Post by: Headgrinder on August 11, 2013, 17:00:38
Very nice, may I digress for a second and ask what in?
Title: Re: Will there be a level editor?
Post by: GrayFace on August 12, 2013, 14:19:37
In computational math. I'm little more than a month before the final presentation.
As for the editor, probably in Lazarus. I think Great Work would be a good starting point for the editor.
Title: Re: Will there be a level editor?
Post by: Headgrinder on August 13, 2013, 03:08:13
Cool.  So, are you saying the editor would work for the Great Work?  I did notice how similar the designs and engines are.
Title: Re: Will there be a level editor?
Post by: GrayFace on August 13, 2013, 10:33:57
Yes, it's pretty much a subset of what's needed for KU, so I'll start by doing it for The Great Work.
Title: Re: Will there be a level editor?
Post by: Headgrinder on August 14, 2013, 12:52:11
That would make me quite happy I think...