Skip to content

Conversation

@Volte6
Copy link
Member

@Volte6 Volte6 commented May 5, 2025

Description

This adds support for Ephemeral rooms.

Ephemeral rooms are instances of rooms that are unique and get their own RoomId's. They cannot be saved to disk, and are cleaned up when all players leave the group of instanced/ephemeral rooms.

This is accomplished by allocating a range of RoomId's that are used only by ephemeral ID's. Room's being copied get their RoomId replaced with a newly generated one.

Changes

  • Eliminated Tutorial Room copies so there is now only one of each tutorial room.
  • Starting the tutorial now creates an ephemeral copy and puts the player in it.
  • Fixed up tutorial scripts to add a little more delay in tutorial instructions.
  • Updated config.yaml so that TutorialStartRooms is now a complete list of all tutorial rooms, starting with the "tutorial start" room.
  • rooms/ephemeral.go handles ephemeral room specifics.
  • Added some script cleanup to scripting, various event handlers, etc. all for managing the pieces of this.
  • Cleaned up some code and moved to its own event handlers, such as the Guide spawning checks.

@Jasrags Jasrags requested a review from Copilot May 5, 2025 00:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements ephemeral room support by removing legacy tutorial room copies and updating the room configuration. Key changes include the removal of multiple tutorial room scripts, the introduction of delay parameters for tutorial commands, and an updated configuration file (config.yaml) with a new TutorialStartRooms array for ephemerally instantiated rooms.

Reviewed Changes

Copilot reviewed 98 out of 106 changed files in this pull request and generated 2 comments.

File Description
_datafiles/world/default/rooms/tutorial/*.js Removal or update of legacy tutorial scripts with delay updates
_datafiles/config.yaml Updated TutorialStartRooms configuration to support ephemeral rooms
Files not reviewed (8)
  • Makefile: Language not supported
  • _datafiles/world/default/rooms/tutorial/910.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/911.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/912.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/913.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/920.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/921.yaml: Language not supported
  • _datafiles/world/default/rooms/tutorial/922.yaml: Language not supported
Comments suppressed due to low confidence (1)

_datafiles/world/default/rooms/tutorial/913.js:30

  • Correct the typo in the message from 'I\ll' to 'I'll' to improve clarity.
teacherMob.Command('say I\ll summon a portal to send you to the heart of Frostfang city, where your adventure begins.', extraDelay+2.0);

@Jasrags
Copy link
Contributor

Jasrags commented May 5, 2025

Outside of a few comments it looks good, large change and I did not get to test it. Could use some unit tests as well.

// Also sends music changes out
//

const guideMobId = 38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this move to a config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll be a module soon, and then we can customize that.

connections.Remove(connId)

testRoomId := rooms.GetOriginalRoom(user.Character.RoomId)
if testRoomId >= 900 && testRoomId <= 999 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this move to a config?

}

if room == nil {
user.SendText(`Something went wrong for RoomId: ` + strconv.Itoa(liveRoom.RoomId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be a log message?

@Volte6 Volte6 merged commit 84037aa into master May 6, 2025
2 checks passed
@Volte6 Volte6 deleted the ephemeral-rooms branch May 6, 2025 21:21
@Volte6 Volte6 mentioned this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants