top of page

Specialization

Procedural Propping

Procedural Propping Of Rooms

One of the last courses in the game programming programme at The Game Assembly is the specialization, where you get to choose one subject to dive deeper into for 5 weeks halftime. For my specialization project wanted to explore and test around with procedural generation and see how we might be able to use it in our next game project, so I decided I wanted to create a tool for propping rooms and objects in our own engine. 

Original goals and plans

My goal with this project was, as mentioned, to create a tool that could be used in our own engine, Rumble, to prop rooms for our last game project. I also originally planned on having support for propping basically any object with a flat surface, though this wasn't something I prioritized.

Starting point

Since I chose to use our own engine for this project I knew I wouldn't have proper and stable support for everything that other engines might have. One of the things that held me back for a few days at the beginning of the project was that we didn't have a working prefab system, meaning I couldn't actually load any props for the first few days.

The Rooms and Props

Since Rumble, our engine uses the EnTT entity component system I built the tool with that in mind, using components for prop- and room data. Each entity can only have one instance of each component, meaning I couldn't just put several RoomPart components on the same entity and call it a room. Instead each roomPart (Wall, floor, door, etc) is an entity with its information in a ProppingRoomComponent, and then the room is just a parent entity that contains all the roomParts that make up one proppable room.

Props are pretty much the same as roomParts with the difference that they don't need a parent entity and have a PropComponent instead of a ProppingRoomComponent. Each prop is made by the user in the engine and then saved as a prefab so that it can be loaded by the propper.

There are two different components that have to be placed on a roomPart or prop entity other than the ProppingRoom-/PropComponent, BoxColliderComponent and TransformComponent. The TransformComponent is used for getting rotation and position of the entity so that props placed on the roomPart can be positioned relative to the roomPart. The BoxColliderComponent is mainly used for getting the size of the object and deciding where the propable surface of the roomPart is.

The Components

I made three different components for the tool, one base component with data that would be needed on both props and roomParts, and then one component for props and one component for roomParts.

ProppingBaseComponentCode.jpg
ProppingBaseComponent

The ProppingBaseComponent contains data for the different sides of the boundingbox for the component, as well as a vector to keep track of the rotation of the propp. This component also has an enum for how a side should be handled.

PropComponentSpelledRight.png
PropComponent

The PropComponent holds all the data necessary for an object to be placed on a grid.

PropComponentCode.jpg
FloorComponents_edited.jpg
ProppingRoomComponent

The only data specific for roomParts is what kind of roomPart it is, which it does with an enum.

ProppingRoomComponent_edited.jpg
ChooseRoom.png
PropperInterfaceSpelledRight.png

Interface

When using the tool the user gets to choose what room they want to prop, and then they can enter input for what props should be used in the room. I had originally planned on having both of them be lists, but we didn't have support for listing prefabs in the engine yet when I started and I didn't have time to add it later in the process either.

Final Thoughts

In the end I didn't get as much time as I'd hoped to polish and I'm not quite happy with how it turned out. I learned a lot about procedural generation in the process and I hope I'll have time to work some more on this project later.

If I could do one thing differently now it would be to re-work the project plan as soon as I understood the process and what I'd have to do a bit more. Now I just made my plan as I went since my first plan wasn't really useful and I didn't want to put more time into just planning. This gave me a bad perception of the scope of the project, which resulted in it not getting as polished as it could've gotten.

ProppedTable.png
bottom of page