Nifflas' Support Forum

Released Games => The Great Work => Topic started by: Nifflas on January 28, 2013, 20:14:28

Title: Level editing
Post by: Nifflas on January 28, 2013, 20:14:28
The Great Work is a bit unusual in the way that I didn't make a developer editor for it. All the level designing was done in Notepad, and except creating graphics and music (those are .png and .ogg files), Notepad is all you need to design your own levels.

If it happens that somebody creates a third party level, I'll add support for loading additional levels into the game.
Title: Re: Level editing
Post by: Qqwy on January 28, 2013, 21:18:12
I have been looking a little into the folder and file structure. It seems to me very simple and flexible. I am SO going to develop a level.

A small question. Is there any way to add new background graphics for in the game?

Congrats on the release today  :D!

~Qqwy
Title: Re: Level editing
Post by: Nifflas on January 28, 2013, 21:59:43
Hi! It's unfortunately a bit tricky. You can edit Sprites.dat (Mathias may be able to help with instructions to how to do that) but when I release an update which has a the level selector menu, the filenames will unfortunately change.

On the other hand, when the version with a level selector is released, the Sprites.dat should stay the same from that point.

It's a bit of work to add the feature in, which is why I want to see if there's an interest in creating nice levels for the game first.
Title: Re: Level editing
Post by: Qqwy on January 29, 2013, 15:37:16
I have walked through the level files and experimented a lot, and I think I now have a more or less complete list of the room file and tiles structure. They might be of some use for anyone wanting to create their own level:

The only thing I haven't been able to figure out yet is the way the color values work. I expected they would be RRRGGGBBB values between 0 and 255 each, but it turns out that the number of digits in the color values can change.
Nifflas, maybe you can give us a hint?  :^^:


This brings me to an important observation: The graphics that belong to the different containers seem to be hard-coded. I am not entirely sure, but the same seems also to be true for the names of the different containers. This might be an obstacle for quite a few people that want to create their own level, because I think that part of the originality comes from the people you can interact with.
Title: Re: Level editing
Post by: LPChip on January 29, 2013, 17:29:09
I bet the color is a Long/int value instead of an RGB value.

To calculate it, you'll have to do this: http://www.shodor.org/stella2java/rgbint.html (http://www.shodor.org/stella2java/rgbint.html)

if my memory serves me right from my VB programming its something like (blue * 64) + (green * 64 * 64) + (red * 64 * 64 * 64).

But that link will calculate it for you. :)
Title: Re: Level editing
Post by: egomassive on January 29, 2013, 18:40:41
This is the formula:

R + (G * 256) + (B * 256 * 256)

I tried it out in the game to make sure. The website LPChip pointed to calculates it with red and blue switched. The third party tools for KS will calculate it for you when you change skin or clothing color, then you have to look in the World.ini to see the number value. It's probably most convenient to use a calculator.
Title: Re: Level editing
Post by: AA on January 29, 2013, 19:18:00
Knytt Stories, Knytt Underground and The Great Work all use 24-bit int BGR colour notation (which is obtained with egomassive's formula).

Impressive work, Qqwy, by the way!
Title: Re: Level editing
Post by: LPChip on January 29, 2013, 19:41:32
Ah, I was on the right track...

So basically, you can use the website I used, but instead you have to fill the blue value at the red value and visa versa.
Title: Re: Level editing
Post by: egomassive on January 29, 2013, 20:51:47
So basically, you can use the website I used, but instead you have to fill the blue value at the red value and visa versa.
Yes, that's probably the easiest way to do it. I wish I'd thought of it.

Impressive work, Qqwy, by the way!
I agree. *star for Qqwy*