How I make maps

  • 5 Replies
  • 321 Views
*

Offline Lit Knob

  • 122
  • 22
  • Spoiler:(click to show/hide)
    • View Profile
How I make maps
« on: April 21, 2022, 05:37:00 »
This is how I make hand-stitched maps of KS levels.
I used PicPick and Photoshop (there are free alternatives to all the PS tools I used, though).

My (new) current workflow is the following (but I still can't recommend it, even though it's way better than the original. Only do this if you are a patient fan of jigsaw puzzles with some free time, a resolution of 1920x1080, and at least 8GB of RAM...):

1. Get PicPick portable.
Keep in mind, when changing settings, you have to click OK even before switching to another section. Otherwise, the changes in the previous section will reset (because PicPick is dumb...).
Set Default Program Mode to Only Show Notifications.
Set Output Type to Image File.
Set File Name to Date/Time.
Set the Repeat Last Capture hotkey to a single key (F4, for example).
Press Shift+Ctrl+PrintScreen, then right-click and set resolution to 1800720, then click OK and press enter.
This will ensure you'll only need to press F4 (or whatever you chose as Repeat key) to take a cropped screenshot.

2. 100% the level in question (you should never spoil anything to yourself).
Make sure you have been in every screen that's accessible by design.

3. Prepare the savefile by doing the following (In case you want a backup, copy-paste it and change the number in its filename):
Strip yourself of all power-ups but the eye (if the level has ghosts) by setting Powers to 0, like this:
Code: [Select]
[Powers]
Power0=0
Power1=0
Power2=0
Power3=0
Power4=1
Power5=0
Power6=0
Power7=0
Power8=0
Power9=0
Power10=0
Power11=0
Power12=0
Then (in the [Extras] section) set Character to invisible by writing anything instead of juni, like this:
Code: [Select]
Character=0
4. Run Knytt Stories Plus 1080.exe and click Zoom twice (if the window's resolution is 600240), then enter fullscreen.
Once you are back in the level, enable cheats (if you know, you know), and use the super secret KS+ map cheat to teleport to screens you have already been to (hold space, press M, and left-click on a map tile to do that). The only side effect is you have to wait for the invincibility glow to fade, but it only lasts 2 seconds.
Go to the top left screen of the level.

5. The capturing session can finally begin.
Hold space and right-click to teleport wherever you want in the current screen. Remember you are still able to "regrab" power-ups, so be really careful while using this cheat, and stay on the screen borders as much as possible. You must not pick them up again by any means.

Place InvisiJuni in a saFe spot (not a save spot) to make sure enemies/hazards can't kill her. You can even put her inside a wall if needed, but she will start "swimming" upwards, so be careful. Release space and wait for the glow to completely disappear. However, If the screen is an empty sky/sea, there's no way to wait for the light to fade. In that case, place her on the top left corner. Also, make sure nothing is overlapping the glow, and it's fully covering a single pattern.
Take a screenshot (with the Repeat hotkey, of course).
Hold space, press M, and left-click on the map tile below the current one (If the current one is the end of the row (so there's no screen below it), left-click on the top tile of the next row on the right). Repeat this whole paragraph until you are done.

You can also take screenshots of the in-game map to make a minimap for reference, especially if the level is huge, so stitching the map would be easier.
Close PicPick.

6. Resize the screenshots with Nearest Neighbor to exactly 600x240. Automate this action and batch export.

7. Now you can start the puzzle session:
Create a dark gray background with a resolution of 9000x3600.
Open 13 to 20 of the screens at a time, in alphabetical or date modified order. Copy-paste and stitch them one at a time on the gray background by moving them with Snap to Layer enabled (snap the first screen to the center of the canvas. This is really important).
If the screens don't fit the canvas, increase its resolution using Canvas Size by adding 600 (if you increase the width) or 240 (if you increase the height), and choosing the right direction.

8. (May be skipped) Once you finish sticking all the screens, it's time to purge all those Invincibility orbs clogging up the sky.
Set the Grid to 24x24 and enable Snap to Grid to erase them by copy-pasting identical tiles. You don't need the Grid if the orb is on a perfect gradient or a solid color (in the latter case, the pencil tool is more than enough).

9. (May be skipped) Locate the eye power-up in the level editor, then take a regular screenshot (not a PicPick one). Paste it in a new image and crop the eye.
Copy-paste it in the map.

10. Merge the layers and save as PNG.
*Heavy breathing*

11. Upload it to a third-party site.
Post the link and a description on the Knytt Stories board of the Nifforum and put "(Spoilers)" at the end of the title.
Your life is now complete, and you can die peacefully.

Me, after looking at your map:
Good job :) *Gives a star*

Spoiler: Old workflow (click to show/hide)
« Last Edit: June 10, 2022, 02:41:15 by Lit Knob »

Re: How I make maps
« Reply #1 on: May 23, 2022, 11:52:12 »
Step one can be simplified if you test level in Level Editor. I also figured out how Level Editor launchs KS in test mode. Given level name and screen pos, we can launch KS test mode with some script to automate the process, but I don't know how to get valid screen pos from level files.

Test levels without Level Editor:

1. Create a savefile named TestLevel.temp, you can copy from a existing save file. Put it in saves folder.

2. [Optional, KS+ required]Rename a blank text file as transparent.png and put it in custom objects folder of the level you want to test.

3. [Optional, KS+ required]Open TestLevel.temp, find Character=juni (or whatever if this level uses custom character), delete it and add Character=transparent.

4. Launch KS from command line, with option -Mode=Test (case sensitive), KS will load test save file.

*

Offline Lit Knob

  • 122
  • 22
  • Spoiler:(click to show/hide)
    • View Profile
Re: How I make maps
« Reply #2 on: May 23, 2022, 22:07:08 »
Hmm. That sounds promising, except for the fact there's no fullscreen/cinema mode in test mode (its window is not centered), so you would have to change Autoscreen’s region offset settings.
Unfortunately, I don't know either (how to make that script).
If anybody finds out how to do that, please let me know.

Regarding the invisible Juni trick, you can simply write something random to do that, like Character=0, for example. You don't need to make a file.

Anyway, I didn't actually make the A Strange Dream and Hostile Landscape ones with this hideous method (hence why I said it was really easy to make the latter, despite being a very hard level), because I started using a much better workflow at least 3 weeks ago. As you can see, I forgot to update the post... My bad.

I will merge my actual current workflow and the invisibility trick since that would partially get rid of step 5.
Thanks for the suggestion. I'm dumb  :)
« Last Edit: May 23, 2022, 22:10:09 by Lit Knob »

*

Offline Lit Knob

  • 122
  • 22
  • Spoiler:(click to show/hide)
    • View Profile
Re: How I make maps
« Reply #3 on: May 24, 2022, 09:01:25 »
Updated the workflow.

Re: How I make maps
« Reply #4 on: May 25, 2022, 12:11:30 »
I write a demo to automatically get a screenshot of the start screen. Python 3 and some packages are required to run this code.
Code: [Select]
from PIL import ImageGrab
import win32gui
import shutil
import os
from time import sleep

def config():
    global knytt_folder
    global knytt_executable
    global knytt_window_title
    global world_name
    global sleep_time

    knytt_folder = "E:\\Nifflas\\Knytt Stories" #your installation path here
    knytt_executable = "Knytt Stories Plus.exe"
    knytt_window_title = "Knytt Stories Plus 1.3.8"
    world_name = "plural - Hypnagogia"
    sleep_time = 2 #KS need some time to load the level, 2s maybe enough

def get_paths():
    global path_to_exe
    global path_to_default_save
    global path_to_test_save
    path_to_exe = "".join([knytt_folder, "\\", knytt_executable])
    path_to_default_save = "".join([knytt_folder, "\\", "Worlds", "\\", world_name, "\\DefaultSavegame.ini"])
    path_to_test_save = "".join([knytt_folder, "\\Saves", "\\TestLevel.temp"])

def make_save_file():
    shutil.copyfile(path_to_default_save, path_to_test_save)
    test_file_object = open(path_to_test_save, 'a')
    test_file_object.write("".join([
'''
[World]
World Folder=''', world_name,
'''
[Extras]
Character=0
''']))

def launch_KS():
    os.system("".join(["start \"\" ", "\"", path_to_exe, "\"", " -Mode=Test"]))

def main():
    config()
    get_paths()
    make_save_file()
    launch_KS()
    sleep(sleep_time)
    hwnd = win32gui.FindWindow(None, knytt_window_title)
    if (hwnd == 0):
        pass # KS not running, skip screenshot
    else:
        win32gui.SetForegroundWindow(hwnd)
        dimensions = win32gui.GetWindowRect(hwnd)
        image = ImageGrab.grab(dimensions)
        image.show()

if __name__ == "__main__":
    main()

*

Offline Lit Knob

  • 122
  • 22
  • Spoiler:(click to show/hide)
    • View Profile
Re: How I make maps
« Reply #5 on: May 25, 2022, 20:51:49 »
Ok, me and Python don't... "get along" (and I'm also "programming impaired" in general). I can't try the script.
So I'll assume you tried it and it worked.

The next step is to make it go to the top left corner of the level and all the way to the bottom right one (they are probably voids though). But how do you make it skip voids?

You should always have the eye to avoid missing ghosts, and even then you need to manually put the eye sprite in its location regardless (I'd be surprised if that step could be automated).
What happens if a screen is an empty sky? Is the script fast enough to capture it?
Also, wouldn't Juni hit an enemy or water at some point? The death smoke would be captured too.

There's also a chance some enemies like the water eye would not be captured.

Oh, I don't know if this is of any help, but I found Gliperal's mapper (I don't know what language he used to script it).
It stitches the screenshots itself at the end.
It's very limited though:
It can only capture about 230 screens at a time if I'm not mistaken. It saves to BMP renamed as PNG... (ugh).
It also doesn't render any object. Only layers 0 to 3. But Gliperal said it shouldn't do that.

Here's a link:
https://drive.google.com/file/d/1Ql8L3aHdRTfLjqfCsVugbjZiPr4U1EQ-/view?usp=sharing
« Last Edit: May 25, 2022, 23:25:19 by Lit Knob »