Skip to content

Show area name when moving between areas - #2818

Open
renato-sy wants to merge 19 commits into
endlessm:mainfrom
renato-sy:main
Open

renato-sy wants to merge 19 commits into
endlessm:mainfrom
renato-sy:main

Conversation

@renato-sy

Copy link
Copy Markdown

Add an area name banner that appears when the player enters a new area. The banner is shown for a few seconds when moving between areas such as Fray's End and Song Sanctuary.
Resolves #2340

@renato-sy
renato-sy requested a review from a team as a code owner September 2, 2026 00:41
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/renato-sy/main/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq

manuq commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@renato-sy I see you continue pushing changes, so please let us know when you are ready to receive a review. Thanks!

@renato-sy

Copy link
Copy Markdown
Author

Okay, I think that's it; the pulls I was doing were just little things Git required to perform the merge.

@manuq

manuq commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@renato-sy sorry for the delay. I wil have to review this on Monday. For the moment, please consider that there are other entry points to Fray's End:

  • From the east.
  • From the north (from Song Sanctuaries)
  • From the west (from Fray's End West, after completing the Void quest)
  • And another from the south (from Dev Archipelago, see image below)
image

I think entering from any of those should display the area name.

In fact all those have areas to block the exit, so maybe the entry areas should be next to them.

image

@renato-sy

Copy link
Copy Markdown
Author
Screenshot 2026-09-05 at 6 50 37 PM

Hey there! I've already mapped out the routes for Frays End, Frays End West, and Song Sanctuary, but I'm not sure where we could put the entrance to the area in Linenville—I don't see any villages or anything like that.

And I'm not sure if it's appropriate to also include the area alert when leaving a quest.

@wjt

wjt commented Sep 7, 2026

Copy link
Copy Markdown
Member

Linenville doesn't exist yet as an area you can walk to on the map - the upwards route in that screenshots is blocked even once you complete the void quest and push back that patch of void.

I personally wouldn't include the area name when leaving (i.e. abandoning?) a quest. At the end of a normal quest, when you're teleported back to the middle of Fray's End, I don't think the banner is needed. But I would include it when you first reach Fray's End at the end of the tutorial, i.e. at the spawn point circled at the bottom-left here:

image

@renato-sy

Copy link
Copy Markdown
Author

Okay, so Linenville isn't there. On the other hand—I don't know what you think about this—regarding the names that appear when entering an area, I placed it on the bridge, as if you were just arriving.

Screenshot 2026-09-07 at 1 11 42 PM

Just like in Song Sanctuary, I placed it on the bridge to indicate that the green section belongs to Routes or Fray's End, while the red part is a different area.

Screenshot 2026-09-07 at 1 16 53 PM However, if you'd like, I could set it up so that a notification showing the zone's name appears at the spawn points when the first move is made. And if so, would the animation be only once (the animation is instantiated and then destroyed; we would have to go to another area and re-enter the area to see the name) or many times (like it is now but in the spawn points)

reentry
Screenshot 2026-09-07 at 1 24 14 PM

first entry
Screenshot 2026-09-07 at 1 25 47 PM

@wjt

wjt commented Sep 8, 2026

Copy link
Copy Markdown
Member

Yes, the different-coloured grass on the two sides of the bridge is meant to mark the boundary to the Song Sanctuary, so I agree that the trigger should be crossing that bridge from bottom to top!

@renato-sy

Copy link
Copy Markdown
Author

Okay, so are we all set, or do I need to make any changes?

@wjt

wjt commented Sep 8, 2026

Copy link
Copy Markdown
Member

Sorry, I have not tested or reviewed the code changes yet!

@wjt wjt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I confess that I haven't read the implementation in detail but I don't think the behaviour is correct. Walking around Fray's End I can trigger the banner repeatedly even though I've never left Fray's End!

Screencast.From.2026-09-09.13-22-21.mp4

I would approach it something like this:

  • In the game state, store the current area name, and a set of areas we have seen before
  • Place area name triggers (Area2D with name property) in roughly the places you have done
  • When a trigger detects the player:
    • If the current area name in the game state matches the trigger's name, do nothing
    • Else:
      • Set the current area name in the game state to the trigger's name
      • If the current area has not been seen before:
        • Show the "big" notification
        • Add it to the set of seen areas
      • Else, show the "small" notification.

With this approach, I don't think you need the "directions" property on the triggers.

Comment thread project.godot
Comment thread scenes/ui_elements/hud/components/hud.gd Outdated
Comment thread scenes/globals/game_state/global_state.gd Outdated
Comment thread scenes/ui_elements/area_name/components/area_name.gd
Comment thread scenes/ui_elements/hud/components/hud.gd Outdated
@renato-sy

Copy link
Copy Markdown
Author

I’ve fixed the issue you mentioned and switched the comments to English; you can check if the project.godot file has been reverted.

Comment thread scenes/ui_elements/area_name/components/area_name.gd Outdated
Comment thread scenes/ui_elements/area_name/components/area_name.gd Outdated
Comment thread scenes/globals/game_state/global_state.gd Outdated
Comment thread scenes/globals/game_state/global_state.gd Outdated
Comment on lines +13 to +14
## Emitted when an area's unlock status changes.
signal area_changed(area_name: String, is_unlocked: bool)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This signal's second parameter is never false so personally I would change this to:

Suggested change
## Emitted when an area's unlock status changes.
signal area_changed(area_name: String, is_unlocked: bool)
## Emitted when an area is unlocked (i.e. first encountered)
signal area_unlocked(area_name: String)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This signal is not actually used anywhere...

I think a better design would be:

  • Change this signal to signal area_changed(area_name: String, first_visit: bool)
  • Have the HUD scene connect to this signal and, when it is emitted, show the appropriate balloon - this keeps the UI responsibility in one place
  • Then make the triggers be an Area2D (which can have multiple shapes in different parts of the scene if desired - or a huge polygon that covers the relevant area) which only adjust the state (and don't contain a new CanvasLayer)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

So, would I move both of them to the HUD (first_unlock and re_entry)? The first one self-destructs, so I don't think there would be a problem—or I don't know, what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't think that question was necessary, haha, since when I copied and pasted the instance, it instantiates right into the HUD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like how this looks with the heavy drop shadow. Personally I think we could use the same presentation as the dialogue balloons.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay, I've applied the "Balloons" one. Take a look—how does the color look? Should I change it?

Comment thread scenes/ui_elements/area_name/components/area_name.gd Outdated
@renato-sy
renato-sy requested a review from wjt September 15, 2026 03:18
@renato-sy

Copy link
Copy Markdown
Author

I can review what you mentioned.

@renato-sy

Copy link
Copy Markdown
Author

Hi, I can do the review.

@KarmDK

KarmDK commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Hi, I've been looking into this, and I've noticed the following:

  • When entering Frays End via any entrance other than the southern one on the left, the small notification doesn't appear.
  • Neither the large nor the small notification appears for the Dev Archipelago.

@renato-sy

Copy link
Copy Markdown
Author

Okay, I'll check right now to see what's going on.

Comment thread project.godot

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes in project.godot are unrelated, please revert the file.

Comment on lines +1300 to +1301
zone_name = "Song
Sanctuary"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please avoid separating the text with newlines for the presentation. The label wrapping should take care of it. Keep in mind that these zone names could be translated to other languages in the future. I learned this the hard way and had to fix all signposts #2843

Suggested change
zone_name = "Song
Sanctuary"
zone_name = "Song Sanctuary"

Comment on lines +924 to +925
zone_name = "Dev
Archipelago"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
zone_name = "Dev
Archipelago"
zone_name = "Dev Archipelago"

# SPDX-License-Identifier: MPL-2.0
extends Node2D

@export_multiline var zone_name: String

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As stated above, this shouldn't be multiline. Also, we may want to translate the zone names in the future, and the easiest way to do it is by making this match the "*_text" pattern. I have learned this week about it when working on #2945 (I had to rename a property from action to action_text. I also proposed this to be documented in godotengine/godot-docs#12394

Suggested change
@export_multiline var zone_name: String
@export var zone_name_text: String


[node name="LineVillePath" parent="." unique_id=1184526213 instance=ExtResource("59_6fau3")]
direcciones_salida = 87
zone_name = "Frays end"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The name of this zone, as shown in several dialogues is "Fray's End".

Suggested change
zone_name = "Frays end"
zone_name = "Fray's end"

debug_color = Color(0.9610079, 0, 0.5155429, 0.41960785)

[node name="LineVillePath" parent="." unique_id=1184526213 instance=ExtResource("59_6fau3")]
direcciones_salida = 87

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems to be a leftover.

Suggested change
direcciones_salida = 87

polygon = PackedVector2Array(2937, 765, 2943, 961, 2700, 1108, 2684, 648)

[node name="StartPath" parent="." unique_id=1388956016 instance=ExtResource("59_6fau3")]
direcciones_salida = 49

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
direcciones_salida = 49

polygon = PackedVector2Array(953, 1344, 1033, 1345, 1033, 1374, 951, 1374)

[node name="SongSanctuaryPath" parent="." unique_id=234964131 instance=ExtResource("59_6fau3")]
direcciones_salida = 194

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
direcciones_salida = 194

polygon = PackedVector2Array(2175, 280, 2834, 283, 2682, -9, 2363, -16, 2166, 164)

[node name="DevArchipelagoPath" parent="." unique_id=1511301874 instance=ExtResource("59_6fau3")]
direcciones_salida = 49

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
direcciones_salida = 49

polygon = PackedVector2Array(2810, 1772, 2574, 1766, 2573, 1717, 2810, 1716)

[node name="WestEndPath" parent="." unique_id=681218199 instance=ExtResource("59_6fau3")]
direcciones_salida = 168

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
direcciones_salida = 168

@manuq

manuq commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

@renato-sy this is promising! Check this video. If I start the game from scratch, skip the tutorial, then go north I see "Frays End" when exiting. I think that's wrong, it should happen when entering.

zones.webm

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.

Show area name when moving between areas

5 participants