Recalculating House Size and Scale
#PanicRoom Day 074
#100DaysOfGameDev R2D39
#100DaysOfCode R2D39
Defining how the room blocks for the House would be calculated led to an unexpected discovery, made especially obvious by my new Grid Overlays. My Primary and Secondary Hallways were being defined on particular rows and columns, but this was not what was being reflected on the Floor Grid Overlay. What was going on?
Well, the first thing, I decided, was the fact that I was using the Floor Tile Grid to define my House architecture. I originally went with this because I thought it bring a uniform degree of consistency to the laying out the house, but with narrower walls and having to shift things around, it was becoming evident this wasn’t working out as good as I had hoped it would. Still, this wasn’t exactly the root cause of the number shift between my code and what was actually being created.
I had to dig into to my code to see what was going on and started working through the early parts of my HouseBuilder script analyzing it line by line. The initial stages are pretty solid, the overall dimensions are selected based on real-world measurements in feet and rounded off to 5-foot increments. This just makes the numbers easier to read and work with. It was the part after this that became the important part to analyze.
Originally I added 2 extra rows and columns because my thought was to have only Floor Tiles represent the dimensions of the House and I would place the Exterior Walls along the outside of those dimensions in the extra slots. This was now becoming a contributing factor to the mismatch between coded rows and columns and perceived rows and columns. This fact, coupled with the fact that I now feel I should be using the House Grid system to define the architecture, means I need to completely redefine my dimensions and world spacing before going any further.
I started this task by consulting my original design documents on how I settled on my scale for this Panic Room world. The good news was I originally defined what would later become the House Grids with the variables gridSpaceX and gridSpaceY. These dimension are at the core of my design and factor in to everything from floors, walls, doors, and even player size. Later they will also have great bearing on object design when thing start going into the house.
When I set up the original columns and row I was using Floor Grid sizing which was actually gridSpaceX and gridSpaceY each multiplied by 2. This meant is would be really easy to undo and set to House Grid sizing. In doing so, however, I re-evaluated my actual world scale and decided now would be the time to check it and maybe dial it in a little better.
I always intended to set my scale based on the Player character’s because this was something people could readily and easily visually reference. An average male figure is about six feet tall and roughly three feet wide. Using these dimensions I measured the character against the grid squares I was using and determined he would fit within 1 Floor Grid wide by 3 Floor Grids tall. For some reason (I think it had to do with making the math easier at the time, honestly) I used 2fG by 4fG originally. By doubling this to convert it to the House Grid scale I ended up with 2hG wide by 6hG tall, which I could now calculate a real-world size for by using my character dimension. I took a creative liberty here and decided to use 2 feet as the measurement for how wide a 1hG would be rather than the calculated 1.5 feet. Again, easier math.
So now I know my rows will be 1 foot tall and my columns will be 2 feet wide and I can determine a standard 10 foot by 10 foot room would be created by using 5 columns across by 10 rows high. World dimensions. By contrast, my old scale was 4 columns across by 8 rows high, so a little off what I was planning to use now.
I think now I can finally move forward. It seems like every time I want to take a step forward I have to take two steps back, but at least it’s giving me better design, better code, and ultimately a better product. We’ll see.