yellowstonegames / SquidLib

Useful tools for roguelike, role-playing, strategy, and other grid-based games in Java. Feedback is welcome!
Other
454 stars 46 forks source link

ClassicRogueMapGenerator misplacing vertical doors #214

Closed codex128 closed 7 months ago

codex128 commented 7 months ago

ClassicRogueMapGenerator seems to be placing vertical doors on the opposite end of the room from where they should be.

char[][] dungeon = new ClassicRogueMapGenerator(3, 3, 40, 40, 4, 10, 4, 10).generate();
for (int y = 0; y < dungeon[0].length; y++) {
    for (int x = 0; x < dungeon.length; x++) {
        System.out.print(dungeon[x][y]);
    }
    System.out.println();
}
########################################
########################################
##########+######+###############+######
###..........###......######........####
###..........###......######........####
###..........###......######........####
###..........###......+..###........####
###..........###......##...+........####
###..........######.#############.######
###..........######.#############.######
##########.########.#############.######
##########.########.#############.######
##########.########.#############.######
##########.########.#############.######
###+######.#####.......##########.######
##..........#..+.......#######+##.######
##..........#.##.......####.......######
##..........#.##.......####.......######
##..........+.##.......####.......######
###.####+#######.......####.......######
###.....########.......####.......######
#######.########.......####.......######
#######.########.......#######.##+######
#######.###########+##########.#########
#######.######################.#########
#######.######################.#########
#######.######........####.........#####
####....#....+........####.........#####
####....+.####........##.+.........#####
####....######........##.#.........#####
####....######........#..#.........#####
####....######........+.##.........#####
####....######........####.........#####
####....######........####.........#####
#######+##################.........#####
##########################.........#####
###########################+############
########################################
########################################
########################################
tommyettinger commented 7 months ago

Thanks for the report; I'll look into this now.

tommyettinger commented 7 months ago

With DungeonGenerator handling how untouched areas should be displayed (and placing stairs), the output looks like this:

               ###########                        
  ###########  #.........##############  #########
  #.........#  #....<....+.##.........#  #.......#
  #.........####.........#..+.........####.......#
  #.........+..+.........####.........+.##.......#
  #.........##############  #.........#..+.......#
  ####+######               ##################+###
     #.#                                 ##....#  
  ####+###  ##########  #########        #..####  
  #......####........#  #.......#    #####+##     
  #......+..+........####.......######......#     
  #......####........+..#.......+....#......#     
  #......#  #........##.+.......####.#......#     
  ######+#  #####################  #.+......#     
     #...#                         ##########     
   ###+#####            ########                  
   #.......###########  #......####               
   #.......+.##......#  #......+..# #########     
   #.......#..+......#  #......##.# #.......#     
   #.......####......#  #......##.###.......#     
   ######+##  #......#  #########...+.......#     
   #####..#   ########          #####.......#     
   #.....##                ################+#     
  ##+######## ##############.........#    #.#     
  #.........# #.........##.+.........######+##### 
  #.........###.........#..#.........+..##......# 
  #.........+.#.........#.##.........##.##......# 
  #.........#.+.........+.#############..+..>...# 
  #########################           ########### 

Thanks for using SquidLib!