#Infinite hallway with triggers

1 messages · Page 1 of 1 (latest)

shut scaffold
#

I need to create an endless straight corridor where different segments (rooms) spawn based on triggers. For example, after the player enters a specific zone (like seeing a particular room), certain other rooms appear, creating a kind of a "linear progression", but with the ability to go in both directions (there's no real "forward" or "backward" direction).

UPD. Extended explanation:
The game takes place at night. The player’s visibility is limited to the light around them.

  1. The player starts inside a house.
  2. They can look around and exit through the door.
  3. The player steps outside and finds themselves on a straight road surrounded by tall grass fields.
  4. They can go in either direction. The house scene disappears and cannot be returned to.
  5. The first bus stop appears along the road.
  6. The player can move further or turn back, but the house no longer exists, and the road with the bus stop loops infinitely in both directions (the bus stop should always be on the left side of the road, regardless of which direction the player chooses).
  7. Every bus stop after the first has a path leading into the fields nearby.
  8. Since the path is initially hidden by tall grass, the same bus stop scene can be reused (I think). The path simply becomes visible when it's needed.
  9. The player can enter the path.
  10. A sound event plays in that area.
  11. When the sound ends, new objects appear on the road.
  12. Approaching any of them fades the screen to black, ending the game.
quick pike
#

I'd use a room manager to handle all the logic. Things like if room_discovered: new_rooms_available = true. Then I'd use a signal bus every time a room is entered to give everyone who needs it the relevant data.

https://youtu.be/vbw1ncvSUYg?si=wbpCnxTRNdDDHgBf

shut scaffold
# quick pike I'd use a room manager to handle all the logic. Things like `if room_discovered:...

Thank you for the tips!
I'm still a beginner in Godot and would really appreciate a more detailed example or a step-by-step guide to help me understand how to set up these systems in my project.
I already know what a global signal bus is and have used one in another project before, but I’m stuck on the infinite hallway part and don’t yet know how to implement signals in this context.
I tried looking into this on my own, but I feel overwhelmed by all the information and don’t really understand what I’m supposed to do yet (for example, how to even create something like a Room Manager).

quick pike
#

Well, let's start with what you actually have right now. Do you have a system that generates an infinite hallway? If yes, do you have a system that generates rooms? if yes, do you have a way to alter what rooms are generated?

If you don't have anything yet, that's fine. Just getting a baseline

shut scaffold
elfin tartan
#

The first step is figuring out what that algorithm should be

shut scaffold
# elfin tartan If you want something infinite that can travel forwards and back and remember wh...

My idea is really simple. I think it needs 2, maybe 3 different rooms at max?..
I'm not sure how detailed my description should be, so uhh... Sorry if I write too much 🥺

The game takes place at night. The player’s visibility is limited to the light around them.

  1. The player starts inside a house.
  2. They can look around and exit through the door.
  3. The player steps outside and finds themselves on a straight road surrounded by tall grass fields.
  4. They can go in either direction. The house scene disappears and cannot be returned to.
  5. The first bus stop appears along the road.
  6. The player can move further or turn back, but the house no longer exists, and the road with the bus stop loops infinitely in both directions (the bus stop should always be on the left side of the road, regardless of which direction the player chooses).
  7. Every bus stop after the first has a path leading into the fields nearby.
  8. Since the path is initially hidden by tall grass, the same bus stop scene can be reused (I think). The path simply becomes visible when it's needed.
  9. The player can enter the path.
  10. A sound event plays in that area.
  11. When the sound ends, new objects appear on the road.
  12. Approaching any of them fades the screen to black, ending the game.
elfin tartan
#

A little different to how you initially explained it, but much easier to pull off. You just need to ensure your scenes flow seamlessly into each other regardless of orientation, or have two flipped copies that seamlessly connect

shut scaffold
# elfin tartan A little different to how you initially explained it, but much easier to pull of...

So I just need to make sure the 3D models of the areas connect properly, got it! I understand that part.
But, the technical side of making all the logic work is totally beyond me... I have no clue how to do that.
I just have an abstract idea of how that would function.
I guess I should actively utilize the limited visibility.
Since the view radius is always the same, I should unload or replace the segment that the player leaves with another when they transition to a different segment, right?
And the distance between "points of interest" should be just enough to never be able to see both things at once.

quick pike
# shut scaffold So I just need to make sure the 3D models of the areas connect properly, got it!...

Yeah. The simplest way I can imagine this in 3d is to use the 3dtileset. Say your house, or road is 10 1 meter tiles long in both directions. (might be fewer if you're using lighting to lower visibility). Whenever the player reaches the one of one of the tiles (could be detected with an area) you can add a new tile in the direction the player is going, and remove one from the way they left.

Using a tile map (or even strictly sized assets), you can simply check players location for how far they've traveled to add the event areas. Something like, if they've moved to y - 3 or y + 3, add the bus stop to the end of the current layout. This would put the bus stop at y +- 13 for example. All that logic for generating and events can be handled by a plain Node called PathManager or smt. Then all the tileset or world has to do is update the manager with what the current status is.