Skip to content

Show area name when moving between areas - #2818

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

renato-sy wants to merge 26 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 thread scenes/globals/game_state/global_state.gd Outdated
Comment thread scenes/ui_elements/area_name/first_unlock.tscn
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
Comment thread scenes/world_map/song_sanctuary_path.tscn Outdated
Comment thread scenes/dev/dev_archipelago.tscn Outdated
Comment thread scenes/ui_elements/area_name/components/area_name.gd Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
Comment thread scenes/world_map/frays_end.tscn Outdated
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

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 have a question: what would the problem be here? And in other cases similar to this one?

@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

@renato-sy
renato-sy requested a review from a team as a code owner September 24, 2026 02:23
@renato-sy
renato-sy requested a review from manuq September 24, 2026 23:08

@manuq manuq left a comment

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.

@renato-sy thanks for continuing working on this. I have reverted the unintended changes in project.godot for you.

I see Editable Children being used:

image image

This is not ideal because with it, every TextNameArea has to use a polygon shape. Above we can see how those areas can be rectangle shapes, which are more performant. Also "TextNameArea" name is confusing because it is currently inheriting Node2D, not Area2D. Please change it so:

  • TextNameArea actually inherits Area2D
  • Every instance can add their own collision shapes without enabling Editable Children.
  • Use rectangle shapes when possible.

For Fray's End, instead of using multiple TextNameArea, add a single one with multiple collision shapes. See how ExitBlocker does it. You can also use InteractArea as reference.

@renato-sy

Copy link
Copy Markdown
Author

Okay, once it becomes an area and the shapes are placed inside, it works the same way; I've already performed the update.

@manuq manuq left a comment

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 is almost there! I see that you are using

Using a collision makes sense for the case of the player crossing the bridge, but I'm not so sure about using it for the player spawning. I can see a little square added around each SpawnPoint:

Image

That is prone to errors. For example, the one used after skipping the tutorial is missing the spawn point for one pixel:

Image

So in this video we can see that skipping the tutorial doesn't trigger the zone name. Also it looks like linenville_path.tscn has an empty name:

Grabacion.de.pantalla.desde.2026-09-29.10-18-58.mp4

SpawnPoints have a player_teleported() signal:

Emitted after the player position has been changed.
Level scenes can use this signal to behave differently depending on which SpawnPoint was used (or if no SpawnPoint at all was used).

I think you should use that one instead.

Comment thread scenes/globals/game_state/global_state.gd
Comment thread scenes/ui_elements/area_name/components/area_name.gd
Comment thread scenes/ui_elements/area_name/components/area_name.gd
Comment thread scenes/ui_elements/area_name/text_name_area.tscn
Comment thread scenes/ui_elements/area_name/text_name_area.tscn
# SPDX-License-Identifier: MPL-2.0
extends Node2D

@export var zone_name_text: 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.

You are using "zone" here and "area" in other places. I think "zone" should be used consistently everywhere, because "area" could be confused with the Area2D concept of Godot. Confusingly, this implementation uses an Area2D to unlock an area/zone of the game world. So, I think "zone" is better!

required_quests = Array[ExtResource("38_2vyp4")]([ExtResource("30_hq8vv")])
metadata/_custom_type_script = "uid://uaaaiviytliw"

[node name="TextNameArea" parent="." unique_id=1184526213 instance=ExtResource("40_2kltm")]

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.

There is no zone_name_text set in this one. Check the attached video.

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.

Ideally the name should be animated with an AnimationPlayer. But that can happen after merging this PR.

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.

Same as the other animation. Ideally the name should be animated with an AnimationPlayer. But that can happen after merging this PR.

@renato-sy

Copy link
Copy Markdown
Author

Hi, I was looking at the spawn point script.

func _ready() -> void:
	if Engine.is_editor_hint():
		return

	if GameState.scene.spawn_point == get_tree().current_scene.get_path_to(self):
		move_player_to_self_position()


func move_player_to_self_position(smooth_camera: bool = false) -> void:
	var player := get_tree().get_first_node_in_group("player") as Node2D

	if is_instance_valid(player):
		player.teleport_to(self.global_position, smooth_camera, look_at_side_on_spawn)

	player_teleported.emit()

and in the conditional if GameState.scene.spawn_point == get_tree().current_scene.get_path_to(self): that triggers the animation It doesn't always work—what do you recommend I do? I’d say it should activate in the _ready method, using a state (animation vs. no animation) so that when the scene loads and an animation is required, it plays—while always switching the current scene so that they don't end up in a place that isn't

@manuq

manuq commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

in the conditional if (...) that triggers the animation It doesn't always work

Sorry, what do you mean that it doesn't always work? I'm not following.

@renato-sy

Copy link
Copy Markdown
Author

When I enter Song Sanctuary Path, it doesn't trigger in Frays End West either.

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