I wanted to make a procedural dungeon experimenting a new approach, it works nice for random-meaningless content (in example a procedural background to a level), however when I want it to be not-so-random I incur in some conceptual problem: basically I end up with a grid of numeric sector IDs in 2D.
Grid example:
27 | 56 | 74
---+------+----
35 | 31 | 115
---+------+----
14 | 52 | 12
The main problem is how to fix adjacency so that content is generated in a deterministic way:
- Content of sector "31" should be generated as a function of adjacent sectors (this works)
- However when I generate content for sector "35", I end up with a different link between sector "35" and "31".
So basically according from which direction I cross a sector I see a different passage each time (while the content of the sector is always the same).
As you see in the following image:
The passage between 35-31 is different according to which sector is used to start content generation, which is not what I want. I want the same passage arise.
To answer comments:
sector[id].content = generateContent( sector[id].neighboursIds());