When we begin work on a new level there is always this nice feeling in the air. You have the design documents, know what you are making, but overall the excitement is from now being able to see it yet and as you start to place all of the pieces of the level down and fill out rooms it begins to become a place and not just a collection of polygons.
A proper game engine will allow you to orchestrate hundreds of simple systems all at once. What does simple mean? Well in essence the KISS principle is something that can save your sanity. It is an acronym for "Keep it simple, stupid". It was supposedly created by the US Navy in the 1960's. It was also a buzzword in the 70's but here we are again using the buzzword for the sake of game development! What better purpose could there be...
Above is an example of a door controller system which is used in the game. It requires the use of all the other systems built such as the grid network to talk to the other machines. In this example all doors are also machines that can be controlled by the grid network by passing messages around.
Configuring a door in the game is not something that requires code, a level designer would open their level and place down an entity which will not render in the game when it is running but only in the editors. It is called a door controller and takes a list of doors it has control over. This allows us to change the value on the door controller to manipulate many doors at the same time.
Some locations in levels have setups like this where there are many doors that lead into a given area, with a keycard reader or a switch in the middle to allow interaction from the player and when that happens it will trigger all of the doors to open at the same time.
One of the more interesting things about abstracting the control of doors this way is that it can be used for other things and is by no means limited to doors only. Here are some examples of what we could use this simple system for:
- Moving platform such as an elevator to make the player move between two vectors.
- Plane moving down slowly to simulate a room draining or flooding with fluid.
- Engine with pistons that pump up and down to simulate mechanical motion.
- Control rods being inserted into a reactor to cool it down right before a meltdown.
All of these features could be supported without having to add any additional code or systems into the game that might introduce some sort of instability in the code base. The absolute worst thing you could do is copy and paste code from one part of your project into the other this will only hurt you in the long run as any bugs discovered will require what is known as shotgun edits to continue editing your code and this is where major bugs slip through the cracks.
Sure you could design tests for all of these things, but a code base that is suffering from these symptoms typically will not even have tests that can be run making auto-discovery of these problems impossible without manually looking for them and or worse players finding them in your finished product. Thankfully Space Trucker does not suffer this fate.
Below we have a shot of a room that is from an alpha build of the game where not all locations have been populated with items to make them feel like a place. This particular place is a lobby before entering into a deeper laboratory. The wooden construction horse that is there is used to signal to map designers, and QA testers that a given room is not yet completed but someone has been through there.
So you are going to load up the map editor and work on some of these levels and see how many rooms you can fill out. One of the first things to look into is a basic lighting pass. There are pre-defined scene files that can be imported into the map editor that allow for lights that don't exist to be brought in from a common collection of them. The next step would be glass for the windows.
Rooms that look into another room will have opaque glass for privacy purposes (and object occlusion), however a room that has windows or outlooks into a common area within the same part of the map will use transparent glass which can be broken and shot at with weapons.
Handrails will get placed down in areas where you would figure they would be in real life. You start to get a sense for a place at this point like "Oh, people could fall off this ledge here there should be a railing." When you do this it will look correct after you place them and you keep doing this over and over for each type of object you place down in the editor.
By this point we have configured lights, glass, doors, buttons to control the doors, and now we really got a room going on. To complete our feng shui we begin putting computer workstations into pre-made slots that the level generator created for that very purpose. The game makes use of a static lighting system so there can be literally thousands of light sources in a given level and it will still run at 60FPS @ 4k resolutions.
Next post we are going to talk about things that don't make it and enter the cutting floor, where tons of crazy ideas go in and only the strongest survive!