Conceptually, a Knytt Underground 'level' is made up of a number of 'rooms', each one containing several elements: - tiles - objects - sprites - robots - scripts - general settings, which include room type, music and ambiance, availability Each room is uniquely identified by its coordinates (x and y) in the level; note that only the rooms within a certain range of coordinates are visible on the game map (basically any room that would fit in the map screen, so about (-4, -1) -> (51, 30)). Other elements that don't belong to a single room are: - tilesets - 'sections' (like the chapter select section, Chapters 1, 2 and 3 and the extras) - starting states (i.e the room the player starts in, the initial state of all quests and dialogue, initial inventory, etc.) for each section - dialogue - global scripts - general settings Technically, all these elements are spread into several files and folders inside the World folder (may change when 3rd party level support is added to the game). This is the general layout of the folder: - World.bin (contains all rooms with their content) - World.ini (some general settings about the level) - Sprites.dat (contains all the animation frames of the sprites in the game; should be the same for all levels, as currently there's no way to add new sprites) - Music folder (contains music tracks in Ogg Vorbis format, plus a Music.ini file where simple and composed tracks are specified) - Ambiance folder (same as the above for Ambiance tracks, but they cannot be composed) - Tilesets folder - Masks folder (tileset masks) - Objects folder (contains object images in PNG format, plus an Objects.ini file specifying their characteristics) - Achievements folder (contains achievement objects and the Achievements.ini file) - Characters (dialogue character portraits in PNG format, plus their settings in the Characters.ini file) - Global (python code for scripts that are not specific to a single room) - Default Saves folder (contains the starting state for all the sections the level has in INI format) - Dialog folder (INI files for game dialogue) - Items folder (contains 'Items in Inventory' and 'Items in Level' subfolders, plus INI files with inventory settings for each section and PNG files for inventory background - Sounds folder (WAV format files for sounds that can be called from scripts) - Ambiance Markers.ini (CHECK!!!) - Creatures.ini (CHECK!!!) - Markers.ini (CHECK!!!) - Cache.ini (list of the PNG files - Objects, Characters, Tilesets, etc. - to cache while starting the game) Some of the elements of level editing are similar to those in Knytt Stories, so there will be references to the other game when I think it helps understanding things better. Room settings - Room Type: positive int defining the room type (icon on the map): can be Save Room, Item Room, etc. - Red/Green/Blue: specifies if the room is available in the first, second and third Chapter respectively (i.e. is shown on the map) - Room Type Red/Green/Blue Availability: specifies if the room type is available in the Chapter - Note: if you want rooms to be available in other 'Adventures' (Chapters), add keys (e.g. Demo=1, Room Type Demo Availability=1); however, some things might not work correctly (need to make more tests - setting an 'Adventure' other than Red, Green, Blue could make moving through rooms not work) - Room Type Lock: boolean, whether the room type can be altered by scripts (CHECK!!!) Tiles and Tilesets - tilesets are 220x220 PNG files in the Tilesets subfolder; tiles are specified in the World.bin file (i.e. you have to use the editor) - rooms seem to have a fixed number of 3 5x5 tilesets (differently from Knytt Stories, there doesn't have to be a blank tile) - tiles are 44x44 pixels, but the room tile grid has slots of 32x32 size: this means anything outside the center 32x32 square of a tile may get overlapped by the tiles next to it. This makes you need only one tile (as opposed to 9 in Knytt Stories) to make walls, floors, ceilings and edges, although it doesn't work well with borders - for each tileset you have to make a mask, which is a black and white PNG image where you specify which parts of each tile are solid (white) and which aren't; masks have the same name as the Tileset they refer to, but are placed in the Masks subfolder - each room has a Tileset Background setting, which seems to be almost always the same (80, 80, 80) in the main level; I don't know what it does Objects - objects are similar to Custom Objects in Knytt Stories: to make one, you need a PNG image, and you have to add a section in the Objects.ini file in the Objects subfolder, where the name of the section is the name of the object and Image property is the PNG; objects can't have frame-by-frame animations, but they can be animated with rotation, oscillation and other simple techniques - a default layer can be specified for objects (and changed on a per-object-instance basis in the editor); layers go from 0 to 5 (behind sprites), from 6 to 8 (between sprites and tiles), and from 9 to 12 (in front of tiles); if you have objects on the same layer overlapping, I don't know how the order is determined. Since the Layer parameter is optional, there has to be a default value (CHECK!!!) - the additional properties you can specify in the Objects.ini file are - Image Source: the author of the image (optional) - Grid Size: (I think it affects size; used to make an object fit the tile grid, possibly height only) (optional) CHECK!!! - Category: used to classify objects, serves no in-game purpose, I think (optional) - X/Y Hotspot: the point of the object image all transformations and animations consider as the centre; also used for placement (default is the image centre) - Angle: a decimal value representing the rotation of the object, between 0.0 and 360.0 degrees (default: 0) - Angle Instability: CHECK!!! - Scale Min/Max: I think it may work with Grid Size to fit (normal size is 100) (at least one of the two values is required) CHECK!!! - Transparency Min/Max: animation (I think) that alters the object transparency between Min and Max values, on top of its current Alpha (default is no alteration) - Movement Speed Min/Max: speed of the animation (default: ???) - Rotation Speed Min/Max: speed of the rotation (default: ???) - Rotation Speed Invert Chance: CHECK!!! (int? x over 100) - Oscillator A/B Routing: specifies if and how the object animates (two animations max are possible); possible values are Null Routing (no animation), Rotation, Scale and Transparency - Oscillator A/B Amount Min/Max: oscillation amount, depends on Routing (positive decimal); both have to be specified to work; actual amount is selected at random between Min and Max values (do not know if it varies only when you reset the room or not), so use the same value to have always the same amount of oscillation - Oscillator A/B Frequency Min/Max: CHECK!!! depends on Routing (positive decimal); I think it's the number of oscillations in 10 seconds (or 600 frames); just one is enough for this to work (default values?) - Oscillator A/B Offset Min/Max: CHECK!!! starting and ending point of oscillation? depends on Routing (positive int) - Sync Routing: CHECK!!! (Null Routing, Rotation, Scale, Transparency) - Sync Track: CHECK!!! (positive int) - Sync Inertia: CHECK!!! (positive int) - Sync Amount: CHECK!!! (int) - Return While Invisible: CHECK!!! (boolean, might reset animation when Object is made invisible through Scripts) - the object properties you can alter in the editor are - Layer Override: specify a different layer for the object (CHECK: some rooms have 1.5 as layer override) - RGB Coefficient: a value between 0 and 16777215 which serves to alter the colours of the object - Angle: a decimal value representing the rotation of the object, between 0.0 and 360.0 degrees - Movement Angle: a decimal value representing the angle of oscillation of the object, between 0.0 and 360.0 degrees; only used for Oscillators (CHECK!!!) - ... Sprites - the term 'sprite' refers not only to actual Sprites, but all active objects in the game: this includes NPCs, items, various creatures, switches, liquids (water, lava, slime, drops), but also invisible things like checkpoints, triggers, dialogue areas, etc. - sprites are fixed for all levels, but their colours can be altered via the Swap Red/Green/Blue parameters in the editor; sprites with bright red, green and blue colours are made specifically so that you can colour them however you like (up to 3 separate hues per sprite) - sprites can be assigned an identifier that can be used to refer to them in scripts - you can make a sprite in a room be available in a Chapter but not in other Chapters by using the Red/Green/Blue Availability parameter in the editor Robots - robots are kind of like sprites, but are setup differently: you define their aspect and functionality by assigning them Sensors (Main and Sub), Arms and Engines (up to 3) - Sensor: define a robot's ability to detect the player, through several parameters - Type: Radius, Star, Null Sensor, Flip Flop, Fixed Angle (CHECK!!!) - Value A/B/C: depends on Type - Null Sensor: A) if set to 1 for Sub Sensor, always detects (do more tests!!!) - Radius: A) detection distance B) summed to A, it gives the minimum distance at which robot turns off after detection C) unused - Line of Sight: defines if the robot can see through walls or not (boolean) (CHECK!!!) - Arms: means of attacking the player or interacting with him/her - Type: Chaos Laser, Double Plasma, Electric, Ghost Cannon, Laser, Magnet, Pulse, Null Arms - Value A/B/C: depends on Type - Chaos Laser: A) laser rotation speed B) laser dispersion (laser is fired in random directions within given angle) C) starting angle (0° -> right) - Engine: defines the movement capabilities of the robot - Type: 360-Degree, 8-Direction, Hopper, Back and Fourth [sic], Null Engine - Value A/B/C: depends on Type - Hopper: A) vertical speed? B) horizontal speed? C) unused - 360-Degree: A) speed B) used, but for what? C) unused - 8-Direction: A1, B0) chase player; A2, B1) move in 1 direction until obstacle is hit C) unused - Back and Fourth: A) angle (0° -> right) B) speed (negative -> invert) C) 1 -> move when player out of range instead