Day 42 — Home Items on Surfaces & Rethinking Move Semantics

Context

Today I focused on enabling home items to be placed on top of other home items, such as vases on tables. This is a key step toward making interiors feel layered, expressive, and closer to expectations set by cozy life-sim games.


Items on Surfaces (Now Working)

I successfully enabled placement of certain items on other items:

  • Decorative items (like vases) can be placed on furniture (like tables)
  • Surface-based placement works reliably in normal use

At this point, home items on surfaces are functionally working and usable. There are still a few minor edge cases—such as rugs interacting oddly with ground placement—but overall the feature is in a good state and ready to build on.

The Problem: Moving Parent Items

The main remaining issue appears when interacting with the parent item:

  • Selecting and moving the table does not always correctly handle attached child items
  • This exposed flaws in how placement and movement were previously implemented

Historically, moving an item worked by:

  • Destroying the entity
  • Re-adding it while moving
  • Destroying it again
  • Re-adding it permanently

This approach was sufficient for simple placement but breaks down once items can have children.

Planned Refactor

The path forward is clear: placement and movement need to stop relying on destroying entities.

Instead:

  • Items should persist while being repositioned
  • Child items should remain attached and move with their parent

This will require a larger refactor, but it’s the correct foundation for layered interiors.


Summary

What I accomplished:

  • Enabled home items to be placed on top of other home items.
  • Shipped surface placement in a usable state.
  • Identified and isolated remaining issues with parent–child movement.

What I learned:

  • Layered placement introduces true hierarchy concerns.
  • Destroy-and-recreate movement does not scale.
  • Minor visual bugs are acceptable once core interaction works.