Before Building a Level - BenBerke/Tilky-Engine GitHub Wiki
This page briefly explains the basic concepts you need to understand before building a level. It does not cover advanced features such as true room-over-room geometry, sloped floors, or sloped ceilings. It also does not cover features unrelated to level geometry, such as Lua scripting or entities.
Sectors
A sector is a 2D polygon defined by a list of vertices, a floor height, and a ceiling height. The polygon determines the sector's shape when viewed from above, while the floor and ceiling heights determine its vertical space.
For example, a square sector with a floor height of 0 and a ceiling height of 4 becomes a simple square room. The sector itself defines the room's floor and ceiling, while its outer edges determine where its walls are placed.
Each sector can have its own floor and ceiling textures, colours, and heights. Placing sectors with different heights next to each other allows you to create features such as raised platforms, steps, pits, and rooms with different ceiling heights.
This concept may sound abstract at first, but it will become much easier to understand once you create a sector and see it for yourself in the editor and in-game.
Walls
A wall is a vertical surface defined by two points: a start point and an end point. These points form a line when viewed from above. The wall is then rendered vertically between the floor and ceiling heights of its associated sector.
Walls normally form the boundary of a sector. When several connected walls create a closed shape, the enclosed area can be treated as a sector.
A wall can separate a sector from empty space or sit between two neighbouring sectors. A wall facing empty space appears as a solid wall. When it is shared by two sectors, the engine can leave the overlapping space open, allowing the player to see and move between them. Differences in the sectors' floor or ceiling heights may still create visible upper or lower wall sections.
Walls can also have their own textures and colours. The direction of a wall matters because it determines which side is considered its front and which side is considered its back.