Kekouan

Door Installation Professionals

2024-01-25

I created some new materials for both the door frame and the door segment materials.

Screenshot of Blender with multiple door frames and segments displayed

I wasn't sure of the best way to add the doors into my level. I could add them individually to the level as part of the level geometry so the level was complete, or I could add nodes that would be spawned/replaced with doors.

I opted to go with door spawning:

Door object in my level

Just need to apply some scaling to get it to fit the entire corridor.

Door object in my level, stretched

The object I was using to represent the door in my level was a 1x1x1 cube, but the door I have created is not 1x1x1 in dimensions. So I adjusted the placeholder object so it would scale properly:

Door object in my level, with new scaling

Not exactly what I was hoping for, but fixable.

Door object in my level, with new scaling, fixed

The other problem I was attempting to solve was how to store Door metadata. I am still treating Blender as a level editor, so why not make it the place where these things are defined.

Blender door properties

This allows me to configure everything in Blender, and then it will be read by my game to configure things like the door frame material, if it's locked, requires a key, or how many segments it has.

Doors with various number of segments (1-4)

A door with "3 segments" is just a 2 segment door that opens horizontally, whereas the one with 2 segment is the one that opens vertically. I worked on readjusting the segment materials and updated my game so that it would randomly select a door frame material and a segment material.

Door in level with random segment material

I also attempted to indicate that if a door requires a specific key, by adding a colour to the material:

Door that requires the Gold key

It doesn't look great, but I figured I would solve it later. The other issue I wanted to address was how you opened the door, previously you had to collide with the door for it to open. I added an additional area before/after the door that allows the door to open before you intersect with it.

Door with a purple transparent area indicating the trigger

Just entering the purple zone will open the door.

Having doors that open properly and have random material selection allowed me to create a hallway of doors:

Blender screenshot of many doors in a line

Which looks like this:

Video of the many doors opening

My own version of the Get Smart intro.