Cleaning Games: How I Turned One Bedroom Into Four Rooms
I thought adding a kitchen to Saaf would be an art task. It turned into a test of whether I had actually built a game system or only built one bedroom.
The first bedroom already had shelves, drawers, a wardrobe, a desk and objects with several reasonable homes. A kitchen needed a fridge, freezer, pantry, sink, stove, cutlery drawer, bin and surfaces where the same object could be sensible, risky or simply wrong. Copying the bedroom code and renaming the furniture would have worked once. It would have made every later room harder to maintain.
So I pulled the game apart into five layers: room rules, placement scores, artwork, responsive layout data and frozen levels. That structure now supports a bedroom, kitchen, bathroom and living room inside the same browser game.

The room is data, not a special case
Each Saaf room begins as a list of zones. The kitchen has places such as the fridge shelf, freezer, pantry, wall cabinet, counter, stove, sink, drawer, table and bin. The bathroom has a vanity, medicine cabinet, shower shelf, linen storage, hamper and towel rail. The living room has seating, tables, shelves, baskets and wall space.
A zone describes how objects can use it. It can be a resting surface or a hanging space. It has capacity, clearance, reach and properties such as enclosed storage or an exposed edge. The engine does not need a kitchen-specific instruction for every drag. It asks whether the object fits the zone and where the nearest open slot is.
That boundary is what made four rooms possible. The interaction code stays the same while the room definition changes the available vocabulary.
Every object needs reasons, not one hidden answer
The core of these cleaning games is a placement map. Every object rates every relevant zone from 3 to 0. Three means a natural home. Two means sensible. One means understandable but weak. Zero means wrong.
A toothbrush belongs beside the basin, but a mirror cabinet can also work. A hair dryer belongs in a drawer or under the sink because it should stay away from water. Dirty clothes belong in the hamper. A used tissue belongs in the bin. In the kitchen, milk belongs in the fridge while a pan belongs near the stove or inside a cabinet.
The important part is that this is authored room knowledge. The engine only knows how to score it. I can change a questionable decision in one placement table without changing dragging, inspection, saving or leaderboards.
Wide and tall screens use the same solved room
Phone portrait is the primary layout, but Saaf also needs to work on a wide desktop screen. I did not want two versions of every level.
Every saved object uses canonical coordinates inside its zone. A layout file then gives that zone a scale and offset for the wide or tall backdrop. The game converts the same local position into screen coordinates at render time.
The solver and scorer never see the layout. A room solved on a phone remains solved after the device rotates. Capacity, placement quality and the best possible score stay identical. Automated tests replay each frozen level through the real drop path in both layouts to catch a shelf or drawer that only works on one screen.

Four short stages make a large room readable
A complete room can contain more than twenty objects and many possible zones. Dropping all of that onto the floor at once would turn a calm tidying game into visual noise.
Each room therefore opens in four stages. The kitchen starts with food storage, then adds cooking, washing and the whole room. The bathroom moves from the sink to bath and shower, then toilet and linen, then the final room. The living room follows the same pattern with seating, media, books and the complete space.
When a player calls the inspector, the room is saved exactly as they left it. The next stage keeps those placements and adds a new cluster of objects. Earlier objects remain movable. This gives the campaign continuity without forcing the player to repeat finished work.
The generator has to prove that every mess is solvable
A random pile is easy to create. A fair pile is harder. A level can fail before play begins if the available zones cannot hold every object, if one tall item has no clearance or if the stored best score is not actually reachable.
Saaf generates candidate arrangements, solves the placement problem and freezes the accepted levels into data files. Tests try to beat the stored optimum, replay carry-over between stages and verify that every new item has a good home. The daily puzzle uses the same rules but chooses a frozen whole-room arrangement from the date, so everyone gets the same challenge.
This is the unglamorous part that makes the game feel relaxed. The player can make a surprising choice because the system has already checked that the room itself is not impossible.
The inspector protects the calm loop
I kept feedback delayed even after adding more rooms. While the player tidies, Saaf does not label a spot as correct or wrong. The inspector waits until every object is put away, then reviews each decision with a face and a short explanation.
That delay matters in a house cleaning game. Constant red and green signals would make the player chase the scoring table instead of reading the room. The inspector turns the same data into feedback only after the player has formed an opinion.
It also keeps the new rooms consistent. A bathroom medicine bottle and a living-room photo frame use different rules, but both pass through the same review sequence.
What broke while I added the rooms
The first failures were mostly assumptions hidden inside the bedroom. Some code expected every object to rest on a surface, but towels and artwork need hanging zones. Some wide-screen coordinates looked correct while the portrait version pushed a shelf off the usable area. Some carried objects lost a point because the next stage introduced a better arrangement.
I fixed these by moving the assumptions into data and strengthening the tests. Mount type became explicit. Every art pack gained both wide and tall transforms. Carry-over tests allowed the new stage to challenge an earlier choice, but only within a small bound.
That is the useful part of modularity. It does not prevent mistakes. It makes each mistake point to the layer that owns it.
What four rooms taught me about modular game design
Reusable code is only one piece. The real win is reusable meaning. Saaf can understand storage, reach, safety, display, enclosure and capacity without knowing whether the current backdrop is a bedroom or a kitchen.
That gave me room to make each space specific. The bathroom cares about water, towels and medicine. The kitchen cares about cold storage, cooking and waste. The living room cares about comfort, media, books and display. The shared engine does less, so the room data can say more.
Tidy all four rooms in your browser
You can play Saaf free in your browser. Start with one small part of the room, keep your decisions between stages and call the inspector when every object has a place.
For scoring advice, read my seven-step guide to earning three stars. For the earlier design story, read why I removed the timer.