5/20/2017 - Is that room Traversible?

I'm at a point, where room testing in a roguelike is becoming problematic.
So far what I've been doing is playing the game and adding conditionals to remove room combinations that do not work.
However this is a slow process, and prone to scope issues as the code evolves.

My most recent example is with treasure chests.
I have code that limits the rooms they can spawn in.


    if(this.mixins.indexOf('HasCrushers') === -1){
      if(feature==='chest' && this.height > 400 && this.width < 1300){
        this.queue(number,Chest);

      }else if(feature==='lockedChest' && this.height > 400 && this.width < 1300){
        this.queue(number,LockedChest);

      }else if(feature==='barrel' && this.height > 400 && this.width < 1300){
        this.queue(number,Barrel);

      }else if(feature==='bookcase' && this.height > 400 && this.width < 1300){
        this.queue(number,Bookcase);

      }else  if(feature==='coffin' && this.height > 400 && this.width < 1300){
        this.queue(number,Coffin);

      }else  if(feature==='ironMaiden' && this.height > 400 && this.width < 1300){
        this.queue(number,IronMaiden);

      } else if(feature === 'crate'){
        this.queue(number,Crate);

      } else if(this.puzzleList.indexOf(feature) !== -1){
        this._setupPuzzle(number,feature);

      } else if(this.itemList.indexOf(feature) !== -1 && this.height > 400){
        this.queue(number,window[feature]);
      }
    }

However with recent changes I've made chests interact with the world differently.
players no longer have to jump over them, they can just walk through them.
placing chests based on the height and width of the room is probably no longer a concern.
Also all of these features are based on if the room doesn't have a crusher.

Quickly the scope of testing and creating work arounds becomes daunting.

Use Case / Concept

I generate a room lets say 'A'.
When the player enters room 'A' I generate the next room 'B'.
When the player enters 'B' I generate 'C'.
At the time that 'B' is generating 'C' I can infer that room 'A' was traversible.

What can I infer if playing a level and I have to quit and return to the main screen?
Could I infer that the room was broken?

Say I die in a room, and I had full health.
Can I infer that the room is harder than the other rooms?

That's where I think I'm going with the code.
Based on the outcome of whaht happens in rooms start storing a confidence rating for certain metrics.
When a rating is marked high enough for a particular metric, have the code take action on it.

In the case of a broken room with a high confidence rating - skip it.
If the confidence rating was assigned in a previous version of the codebase than it probably has less weight.

TL/DR

I want to use statistics to inform room generation, and remove broken room combinations.