Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create multiple routes to the same room? #8

Open
pintergreg opened this issue May 21, 2017 · 1 comment
Open

Is it possible to create multiple routes to the same room? #8

pintergreg opened this issue May 21, 2017 · 1 comment

Comments

@pintergreg
Copy link

I'd like to make a more advanced dungeon and I wonder how it is possible to create multiple routes to a room.

As a directory structure I would create something like this:

.
└── room1
    └── room2
        ├── room3
        │   └── room4
        │       └── room5
        │           ├── room2 -> ../../..
        │           └── room6
        └── room5 -> room3/room4/room5

where room1/room2/room5 is a symbolic link to room1/room2/room3/room4/room5 and room1/room2/room3/room4/room5/room2 is a symlink to room1/room2.

I tried to define this dungeon with the following yaml:

dir:Root:
  description: "A poorly lit hallway proceeds you to the north."
  adjacent:
    - room1
  contains:
    - README
dir:room1:
  description: "you're in room 1"
  adjacent:
    - room2
dir:room2:
  description: "you're in room 2"
  adjacent:
    - room3
    - room5
dir:room3:
  description: "you're in room 3"
  adjacent:
    - room4
dir:room4:
  description: "you're in room 4"
  adjacent:
    - room5
dir:room5:
  description: "you're in room 5"
  adjacent:
    - room2
    - room4
    - room6
dir:room6:
  description: "you're in room 6!"
  adjacent:
    - room5

I know this creates a loop, but makes it possible to write not so linear games. I seems that a room structure like this results an infinite loop in the code as my CPU load jumped to 100% when I tried to mount this test level.

@ChrisRx
Copy link
Owner

ChrisRx commented Jun 21, 2017

I will try and reproduce and get this fixed. It should be able to do that but I suspect that the logic I wrote to build the tree of directories is not terminating correctly on previously visited rooms in this case. I know it's been a while already so if you have already tracked down the bug, feel free to submit the fix, otherwise I will try and jump on this very soon.

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

No branches or pull requests

2 participants