Skip to content

Persist assigned scene after map edit #36

@poohcom1

Description

@poohcom1

As mentioned in the README, currently any modifications to rooms in the Map Editor will remove assigned scenes. I think having some basic scene persistence will be a good QOL improvement, especially for devs who edits their room often.

Since there's a lot of ambiguity of how to maintain assigned scene when editing cells, I have an outline for how the assign scene can be determined after a map edit. The gist of it is to try to maintain assigned scene even when there is ambiguity based on a few factors, to make it as seamless as possible.

Cells Removed

  • If any room remains intact, keep the assigned scene.
  • If any room is split into multiple parts, have a consistent logic to determine how to keep the assigned scene (like always favor the assigned scene of the top-left-most cells).

Cells Moved

  • Always maintain cell assigned scene after the move.
  • If cells are moved on top of another room, prioritize the selected room prior to the move. (I forgot if the behavior here merges room or create border, will check and update later)

Cells Added

  • If any room is expanded, keep the assigned scene.
  • Prioritize assigned scene id of the room closest to the starting point of the draw action. For example, if you start drawing a line from Room A to Room B into a single large room, the logic will assume that the combined new room is Room A.

An alternative, simpler to implement system could also be to only maintain assigned scene when there is no ambiguity, and clear the scene otherwise. I haven't looked into the Map Editor code yet, so that could be a factor on how difficult this is to implement.

Let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions