Sunday 31 May 2009

Fixing bugs part 2



When fixing a bug that didn't draw walls when partially on cavern area (that dark mask on picture) a new bug appeared. As you can see corridors (green mask) don't really behave that well when trying to find a way in a round room. The reason is diagonal "corner" mask (white) which corridor routine avoids when it tries to find a straight wall (colored ones). This bug could be fixed with pathfinding I guess.

It's not unusual that fixing something creates new bugs, because of the complex relationship between different parts of the dungeon generator.

2 comments:

  1. I don't think that corridors coming in from diagonal walls look that bad :) I'd drop the restrictions entirely...

    ReplyDelete
  2. The corridor destroys the room's wall (and leaves a big hole on wall) so it's not that good. That diagonal wall is pretty bad news for the current corridor routine, but I guess it can be handled with pathfinding or other way. I think a "dumb" corridor routine that first travels to somewhere and then checks collision could be replaced with a routine that makes pre-calculations and determines an optimal path for the corridor, but it's difficult to create more advanced routines.

    ReplyDelete