-
Notifications
You must be signed in to change notification settings - Fork 2
/
apiary.apib
97 lines (63 loc) · 7.69 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
FORMAT: 1A
HOST: https://rogue-api.herokuapp.com/api
# Roguelike web api (rot-web-api)
A simple API that generates dungeon maps.
You an see a live site using this API at http://rogue-api.herokuapp.com
## Generators [/api{#rogue}{#digger}{#iceymaze}{#ellermaze}{cellular}{uniform}{arena}{?width}{?height}]
+ Attributes
+ method
+ params
### Rogue [GET /rogue{?width}{?height}{?roomWidth}{?roomHeight}]
Dungeon generator which uses the "orginal" Rogue dungeon generation algorithm. See http://kuoi.com/~kamikaze/GameDesign/art07_rogue_dungeon.php
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ roomWidth: `10` (<integer> | optional) - Room min and max width, normally set auto-magically if left blank
+ roomHeight: `10` (<integer> | optional) - Room min and max height, normally set auto-magically if left blank
+ Attributes
+ map: `array` () - 2d array [x][y]
+ Response 200 (application/json)
{"map":[[1,1,1,1,1,1,1,1,1,1],[1,1,0,0,1,1,1,1,1,1],[1,1,0,0,1,1,1,0,0,1],[1,1,0,0,0,0,0,0,0,0,0,0],[1,1,0,0,1,1,1,0,0,1],[1,1,1,0,1,1,1,1,0,1],[1,1,0,0,1,1,1,1,0,0,0],[1,1,0,1,1,1,1,1,1,1,0,0,0,0],[1,0,0,1,1,1,1,1,1,1,null,null,null,0],[1,0,0,0,0,0,1,0,0,1],[1,1,1,1,1,0,0,0,0,0,0,0],[1,1,1,1,1,1,1,0,1,1],[1,1,1,1,1,1,1,0,1,0],[1,0,0,1,1,1,1,0,1,0,0,0,0],[1,0,0,0,0,0,0,0,0,1,null,null,0],[1,1,1,1,1,1,1,1,1,1]],"_width":"16","_height":"10","_options":{"cellWidth":3,"cellHeight":3,"width":"10","height":"16","roomWidth":[2,4],"roomHeight":[2,2]},"rooms":[[{"x":1,"y":2,"width":4,"height":2,"connections":[[1,0]],"cellx":0,"celly":0},{"x":2,"y":7,"width":3,"height":2,"connections":[[0,0]],"cellx":0,"celly":1},{"x":2,"y":12,"width":3,"height":-3,"connections":[[0,1]],"cellx":0,"celly":2}],[{"x":8,"y":1,"width":2,"height":2,"connections":[[1,1]],"cellx":1,"celly":0},{"x":9,"y":7,"width":2,"height":2,"connections":[[1,2]],"cellx":1,"celly":1},{"x":9,"y":12,"width":3,"height":-3,"connections":[[0,2]],"cellx":1,"celly":2}],[{"x":13,"y":1,"width":2,"height":2,"connections":[[2,1]],"cellx":2,"celly":0},{"x":14,"y":7,"width":1,"height":2,"connections":[[1,1]],"cellx":2,"celly":1},{"x":15,"y":12,"width":0,"height":-3,"connections":[[1,2]],"cellx":2,"celly":2}]],"connectedCells":[[1,1],[0,2],[1,0],[0,0],[0,1],[1,2]]}
### Digger [GET /digger{?width}{?height}]
Random dungeon generator using human-like digging patterns. Heavily based on Mike Anderson's ideas from the "Tyrant" algo, mentioned at http://www.roguebasin.roguelikedevelopment.org/index.php?title=Dungeon-Building_Algorithm
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ Response 200 (application/json)
{"map":[[1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,1,1,1,1],[1,1,1,1,1,0,1,1,1,1],[1,1,1,1,1,0,1,1,1,1],[1,1,0,0,0,0,1,1,1,1],[1,1,0,0,0,0,1,1,1,1],[1,1,0,0,0,0,1,1,1,1],[1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1]],"_width":"10","_height":"10","_rooms":[{"_x1":4,"_y1":2,"_x2":6,"_y2":5,"_doors":{"3,5":1}}],"_corridors":[{"_startX":3,"_startY":5,"_endX":1,"_endY":5,"_endsWithAWall":true},{"_startX":1,"_startY":4,"_endX":1,"_endY":1,"_endsWithAWall":true}],"_options":{"roomWidth":[3,9],"roomHeight":[3,5],"corridorLength":[3,10],"dugPercentage":0.2,"timeLimit":1000,"width":"10","height":"10"},"_features":{"Room":4,"Corridor":4},"_featureAttempts":20,"_walls":{},"_map":null,"_dug":19}
### IceyMaze [GET /iceymaze{?width}{?height}]
See http://www.roguebasin.roguelikedevelopment.org/index.php?title=Simple_maze for explanation
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ Response 200 (application/json)
{"map":[[1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,0,1,1],[1,0,0,0,0,0,0,0,1,1],[1,0,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,0,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1]],"_width":"10","_height":"10","_regularity":{"width":"10","height":"10"},"_map":null}
### EllerMaze [GET /ellermaze{?width}{?height}]
Maze generator, Eller's algorithm See http://homepages.cwi.nl/~tromp/maze.html for explanation
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ Response 200 (application/json)
{"map":[[1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,0,1,1],[1,0,0,0,0,0,0,0,1,1],[1,0,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,0,1,1],[1,0,0,0,0,0,0,0,1,1],[1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1]],"_width":"10","_height":"10","_regularity":{"width":"10","height":"10"},"_map":null}
### Cellular Automaton [GET /cellular{?width}{?height}{?topology}]
Cellular automaton map generator
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ topology: `6` (<integer> | optional) - Topology 4 or 6 or 8
+ Response 200 (application/json)
{"map":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}
### Uniform [GET /uniform{?width}{?height}]
Dungeon generator which tries to fill the space evenly. Generates independent rooms and tries to connect them.
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ Response 200 (application/json)
{"map":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,0,0,0,1,1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,1,1,1,1,1,1,1,1],[1,0,0,0,1,1,0,1,0,0,0,1,1,1,1],[1,1,1,1,1,1,0,0,0,0,0,1,1,1,1],[1,1,1,1,1,1,1,1,0,0,0,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]],"_width":"10","_height":"15","_rooms":[{"_x1":3,"_y1":1,"_x2":5,"_y2":3,"_doors":{"4,4":1}},{"_x1":5,"_y1":8,"_x2":7,"_y2":10,"_doors":{"6,7":1}}],"_corridors":[{"_startX":4,"_startY":4,"_endX":4,"_endY":6,"_endsWithAWall":true},{"_startX":4,"_startY":6,"_endX":6,"_endY":6,"_endsWithAWall":true},{"_startX":6,"_startY":6,"_endX":6,"_endY":7,"_endsWithAWall":true}],"_options":{"roomWidth":[3,9],"roomHeight":[3,5],"roomDugPercentage":0.1,"timeLimit":1000,"width":"15","height":"10"},"_roomAttempts":20,"_corridorAttempts":20,"_connected":[{"_x1":5,"_y1":8,"_x2":7,"_y2":10,"_doors":{"6,7":1}},{"_x1":3,"_y1":1,"_x2":5,"_y2":3,"_doors":{"4,4":1}}],"_unconnected":[],"_map":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,0,0,0,1,1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,1,1,1,1,1,1,1,1],[1,0,0,0,1,1,0,1,0,0,0,1,1,1,1],[1,1,1,1,1,1,0,0,0,0,0,1,1,1,1],[1,1,1,1,1,1,1,1,0,0,0,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]],"_dug":44}
### Arena [GET /arena{?width}{?height}]
Simple empty rectangular room
+ Parameters
+ width: `80` (<integer> | optional) - width in cells, default is 80
+ height: `25` (<integer> | optional) - height in cells, default is 25
+ Response 200 (application/json)
{"map":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}