Transition to Unity 5. World structures revamp, UI Progress.
Unity 5 is in beta. We have access and have ported the entire project over (it was pretty simple). One of the most exciting parts of working with Unity 5 is the editor itself. Prior to 5, we were having to work in a 32bit editor. This proved extremely frustrating as the world in Roam started getting large. Editor crashing, data loss, scene corruption to name a few. Unity 5's 64bit editor allows for larger scene capability and I have not experienced a crash yet.
This is a pretty technical post so for those who are not interested in the specifics and just want an update of progress, I have put together a TLDR version. If you are curious the amount of work that goes into creating a game I have gone into some depth below the TLDR area. Even the smallest things that may seem very trivial is still a lot of work to achieve the desired goal.
I am planning a video here in the next couple of days to outline these updates by putting to use some of the tools I have created. I hope to give you all a nice environment update.As well as a walk through the world to various locations.
UI Updated - Still not 100% finished, but it is starting to shape up.
Buildings - Structures have been revamped and are working perfectly. Still a bit of art work left.
Loot containers - These are containers filled with loot obviously. Some containers can be broken down for raw materials. I included different states to the lootable containers as to not confuse the player. Opened containers will have all their cabinet doors/ drawers/ etc opened up. Loot containers that havent been opened will be closed.
Item Database - This has been reworked to fit the loot container setup. External tools were created to help this process.
Environments - The process for creating each tile has been improved upon. This means faster more efficient iterations of artwork. I heard your suggestions, varying hills, "cliffs", and general height variation is implemented.
*End of TLDR*
As I go through each system to prepare Roam for the alpha, I sometimes run across systems that could be improved for both the players experience as well as the development process.
Early on, one of the very first updates for Roam, I talked about how structures were going to be built in the game using a simple system of modular pieces. This approach is great in theory, but it is very difficult and time consuming to put all of these chunks together manually into a somewhat believable structure. If each building is going to have an interior that is accessible (something I pushed for since the start of this project) I needed a way to quickly iterate through structure components, an easy way to manage and edit existing structures, and for each structure to have complete control over all elements that made up the structure. These structures are made up of hundreds of parts.
The game must know when the player is inside them, what walls to turn on and off as to not obscure the players vision, what floor the player is on so it can turn off any 3d objects above the player as to not obscure the players vision, how many loot spawn and loot containers reside inside the structure, and many many more factors. I sat down for a week or so and came up with this efficient "building editor".
For anyone using unity, if you are unfamiliar with editor scripts, I suggest you attempt to learn! They are extremely powerful when done right. I created custom editor scripts for this process.
Before I start into this, I am not an architect and I am definitely not and interior designer. Because of these obvious facts, I tried to understand the fundamentals of what makes a structure a structure.
- Buildings have a roof.
- Buildings can have multiple floors.
- Buildings have rooms.
- Buildings have walls
I have broken the structures into 3 parts. Beam, Room, Structure.
This Beam editor script outlines the various buttons used to create a rooms walls.
Beams control the wall it corresponds to. Since I created a set amount of room sizes I know what the length of my wall segments need to be.
I want to have a much variation in structures as possible, so I created a few walls. I will probably need to create even more later.
By cycling through the beam settings "segments" I am able to quickly iterate through all of these wall variations to find the desired piece. Each piece also holds unique information. If that piece is a doorway, it must know how the player is able to open that door. Same for windows.
First a general floor plan is made. Depending on the type of building I am planning on making, I roughly put together a floor plan. This is where my lack of architectural knowledge will probably stand out to some of you architecturally gifted folk. That is ok though. I am not aiming to recreate an extremely realistic, down to the grain of sand, experience. It fits my expectations if the structure feels grounded in reality.
After setting up the walls via each beam I end up with something like the image above. From experience working with the system, I like to work floor by floor. Each room controls the assets it holds.
This means I will select a room and spawn various assets to populate the room with props. This is important for a few reasons. #1, it doesnt make sense to have 3d assets being displayed when they are not needed. If the player is not inside the house, those assets should turn off. #2 other than performance, this will make saving/loading a bit easier.
Ive populated a couple rooms. The system is capable of more props, but to save time I only placed a few. Each room that the props are in are in control of those props. From here I might decide to add a 2nd floor.
I've placed this floor above the kitchen not because it makes sense, but so I can demonstrate how the system hides/reveals objects in a bit. Obviously there is a lot more that can be done to this structure in terms of props, but lets pretend I am done with the interior. Each room also controls its roof element and those are placed in a very similar fashion to beams. Right now there are a limited number of roof elements. I will need to create more variation as well as incorporating commercial/industrial styles. For now I have a basic residential slanted roof.
And now the final step. The roof has been added. All the rooms are combined into a single asset and the structure is given a name for reference by each tile. From here the structure also has the ability to disable all of its own renderers depending on where the player is as to not impact performance in play mode.
The building asset will control all factors of the building including roof and room visibility, prop visibility, managing what to display depending on where the player is. Since the system was built from the idea of a single beam in mind, the building has control down to individual beams.
The house will also have control over enabling and disabling walls that interfere with the players ability to see their character.
And floor based visibility.
And that about wraps it up. There is some more work to be done to the system, but overall it is working great. It allows very quick effecient structure creation. As I mentioned above, there will be a video update in a couple days that will give you all a chance to see it in action!