Skip to content

🧹 Replace game_restart with room_goto(rm_menu) #81

@mathew-odwyer

Description

@mathew-odwyer

Checklist

  • I have not removed the 🧹 emoji from the title.
  • I have confirmed that this task is not already tracked under another tech debt or refactor issue.
  • This does not represent a user-facing feature request or bug report, but an internal improvement.
  • For maintainers: I have updated the projects and milestones if needed.

Description

Currently the system in place to go back to the main menu when the users JWT has not been refreshed has a few issues, notably:

  1. [game_restart(https://manual.gamemaker.io/lts/en/GameMaker_Language/GML_Reference/General_Game_Control/game_restart.htm) does not reset global variables
  2. Game assets such as objects within the asset browser that have been modified at runtime will not be reset (such as sprites origin or image index)
  3. Dynamic resources will not be cleaned up.

Impact

We should implement a proper system to go back to the main menu:

  1. Ensure that any instances that should be destroyed when leaving rm_world are destroyed (such as players, any singleton objects that will need to be re-created, etc)
  2. Ensure that dynamic resources are cleaned up (include things such as EventAggregator.Unsubscribe, JsonRpcClientProtocol, etc.
  3. Test thoroughly and check with debugger that instances and variables are reset correctly and everything still behaves correctly end-to-end.

Proposed Approach

No response

Risks or Challenges

No response

Additional Context

No response

Related Issues

No response

Metadata

Metadata

Assignees

Labels

clientThis issue relates to the client.tech debtThis issue relates to extra work being required.

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions