The New “Central” (Level Selection)

With the addition of new models and updates to the old ones, we began to redesign and polish the level selection scene (named “Central”) for the game. The area now looks a lot more structured and resembles the look of being in a hospital environment, unlike before where the scene was just a circular area with doors. We wanted to add more liveliness to the structure, so we added irregularities such as the depth in the wall area leading to the elevator and placing the clerk area and the hallway in a way that adds more asymmetry to the scene. The fundamental purpose of having a central hub is to tie all of the pieces of the gameplay together into one area and to intertwine the stories so they are all connected. This makes the gameplay feel a lot smoother and logical, and we believe by revamping this scene we can enhance those desired effects.

The Old “Central” (Level Selection)

The new “Central” has all of the previous functionality like the first-person controller and the level change collision triggers implemented and working. Most of the level selections will be located within the hallway area, with the exception of the elevator, which we plan would lead to the charter room. Currently, the only routed levels are the ICU Scenario Scene (where we plan to have Scenarios 1 & 2) and Mr. Peterson’s Room (a sample scene that tests the core functionality of the point & click mechanics and interactive narrative choices).

Actor Editor and Sprites

Another thing we really wanted to focus on and polish was the way we handled the main gameplay components in the game. Last week, we mentioned how we’ve moved to a prefab system for the various actors in the scene. This week, we implemented an editor to make modifying them very simple.

Since actors often have several images that could be used during the dialogue, it’s important that we can ensure that we associate the correct sprite with the correct field. If we messed up, it may not be immediately noticeable, depending on how they’re used in that scenario, so being able to catch it early was a necessity.

Luckily, the EditorGUI.ObjectField made this pretty simple. If you expand the height of the field, it automatically shows an image of the object. We were easily able to create a SpriteField in my OOEditor system, that handles the drawing and the dimensions of the ObjectField, ensuring it shows the preview image and that the Sprite’s aspect ratio doesn’t get messed up.

Actor Prefab Management

The actual loading, creation, and deletion of the actor prefabs took a bit of work to set up. Unity doesn’t seem to have a clear guide for doing this that we could find, so there was a lot of learning involved.

The editor was supposed to be able to load all actor prefabs, regardless of whether they were in the scene, but the first method we were using fell short of this. We originally used Resources.FindObjectsOfTypeAll, but later realized that it would only find objects that were loaded, and typically only the objects in the scene were loaded. Resources.LoadAll ended up being the solution we needed, allowing us to cast the now loaded actors as the correct type so they could be used.

We created a template actor for use when creating new actors. The code can tell which is the template by its unique identifier of 0. The code clones the template into a new user-specified file, and then adds it to the editor.

For deleting the actor, you can’t just use Object.DestroyImmediately, as we had expected. Instead, we had to use AssetDatabase.GetAssetPath to find its path, and we could then call AssetDatabase.DeleteAsset to remove the unwanted actor.

Looking Forward

We gained a lot of ground this week in terms of back-end development and piecing together the art assets to create a more aesthetically pleasing environment. With the work on the actor editor, we are now able to progress and implement the “ICU Clinic” scenario for Phase I and create its level design structure that matches the look and feel of the updated “Central” scene.

You can read more about the BurntOut game at its website and follow along with our development on the blogs