Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cxong/gomapgen
/ functions
Functions
105 in github.com/cxong/gomapgen
⨍
Functions
105
◇
Types & classes
18
↓ 45 callers
Method
setTile
(x, y int, tile rune)
gmgmap/map.go:106
↓ 35 callers
Method
getTile
(x, y int)
gmgmap/map.go:99
↓ 27 callers
Method
Layer
Layer - get a map layer by name If it doesn't exist, add the layer
gmgmap/map.go:80
↓ 13 callers
Method
isClear
Check if rectangular area is clear, i.e. only composed of nothing tiles
gmgmap/map.go:261
↓ 12 callers
Function
hasSameTile
(m Map, x, y int, tile rune)
gmgmap/tmx.go:431
↓ 10 callers
Function
NewMap
NewMap - create a new Map for a certain size
gmgmap/map.go:62
↓ 9 callers
Method
IsLeaf
()
gmgmap/util.go:157
↓ 9 callers
Method
isIn
(x, y int)
gmgmap/map.go:121
↓ 9 callers
Method
rectangle
Draw a rectangle - optional filled
gmgmap/map.go:135
↓ 9 callers
Method
setTile
(t *villageTile, x, y int)
gmgmap/village.go:265
↓ 8 callers
Function
IsWall
IsWall - whether a tile is a wall type
gmgmap/map.go:289
↓ 7 callers
Method
dAlong
()
gmgmap/bspinterior.go:14
↓ 7 callers
Method
get
(x, y int)
gmgmap/wfcshop.go:197
↓ 6 callers
Method
fill
Fill the map with a single tile type
gmgmap/map.go:126
↓ 6 callers
Function
hasTile
(l Layer, x, y int)
gmgmap/bsp.go:261
↓ 6 callers
Function
imax
(i1, i2 int)
gmgmap/util.go:72
↓ 6 callers
Function
imin
(i1, i2 int)
gmgmap/util.go:65
↓ 6 callers
Method
isConnected
()
gmgmap/rogue.go:254
↓ 6 callers
Method
rectangleFilled
(r rect, tile rune)
gmgmap/map.go:145
↓ 4 callers
Method
collapsedValue
()
gmgmap/wfcshop.go:177
↓ 4 callers
Function
randomWalk
(rr *rand.Rand, x, y, w, h int)
gmgmap/util.go:37
↓ 3 callers
Method
Connect
(i, j int)
gmgmap/bspinterior.go:38
↓ 3 callers
Method
IsAdjacent
(r2 rect, overlapSize int)
gmgmap/util.go:17
↓ 3 callers
Method
Print
Print - print map in ascii, with a border
gmgmap/map.go:191
↓ 3 callers
Method
SplitHorizontal
Split rooms horizontally (left + right children)
gmgmap/util.go:126
↓ 3 callers
Method
SplitVertical
Split rooms horizontally (top + bottom children)
gmgmap/util.go:142
↓ 3 callers
Function
addCorridor
Add a corridor with two turns This can connect any two points; the S-shaped turn occurs at the middle
gmgmap/map.go:300
↓ 3 callers
Function
addStraightCorridor
Add a corridor, to a ground and structure layer The corridor will be drawn in two directions, from a central point outwards The ground tile will be dr
gmgmap/bsp.go:174
↓ 3 callers
Function
applyCollapsedValue
(x, y int, t rune, g, s, f *Layer)
gmgmap/wfcshop.go:151
↓ 3 callers
Function
bspRoomRoot
(width, height int)
gmgmap/util.go:105
↓ 3 callers
Method
dAcross
()
gmgmap/bspinterior.go:21
↓ 3 callers
Method
isCollapsed
()
gmgmap/wfcshop.go:186
↓ 3 callers
Method
rectangleUnfilled
(r rect, tile rune)
gmgmap/map.go:149
↓ 3 callers
Method
setTileInAreaIfEmpty
(rr *rand.Rand, r rect, tile rune)
gmgmap/map.go:110
↓ 3 callers
Method
tile
(x, y int)
gmgmap/map.go:413
↓ 3 callers
Method
tile
(x, y int)
gmgmap/village.go:258
↓ 3 callers
Function
tryConnect
(connected []connectInfo, x, y, x1, y1, index, index2 int)
gmgmap/rogue.go:260
↓ 2 callers
Function
Abs
Abs - absolute value, integer
gmgmap/util.go:162
↓ 2 callers
Method
IsConnected
(i, j int)
gmgmap/bspinterior.go:43
↓ 2 callers
Function
IsDoor
IsDoor - whether a tile is a door type
gmgmap/map.go:294
↓ 2 callers
Method
Split
(rr *rand.Rand, i, minRoomSize, maxRoomSize int)
gmgmap/util.go:109
↓ 2 callers
Method
allConnected
()
gmgmap/rogue.go:257
↓ 2 callers
Function
capStreet
(g, s *Layer, streets []bspArea, st bspArea, end, dAcross, dAlong vec2, corridorWidth, corridorLevelDiffBlock
gmgmap/bspinterior.go:387
↓ 2 callers
Method
countTiles
Count the number of tiles around a tile that match a certain tile Boundary tiles count
gmgmap/map.go:274
↓ 2 callers
Function
drawInDirection
(g, s *Layer, startX, startY, dx, dy int, tile, wall rune)
gmgmap/bsp.go:181
↓ 2 callers
Function
findDeepestRoomFrom
(areas []bspArea, child int)
gmgmap/bspinterior.go:419
↓ 2 callers
Function
getXRange
(l Layer, r rect)
gmgmap/bsp.go:140
↓ 2 callers
Function
getYRange
(l Layer, r rect)
gmgmap/bsp.go:154
↓ 2 callers
Function
hasNeighbouringTile
(l Layer, x, y, dx, dy int)
gmgmap/bsp.go:236
↓ 2 callers
Function
iclamp
(v, min, max int)
gmgmap/util.go:79
↓ 2 callers
Function
irand
(rr *rand.Rand, min, max int)
gmgmap/util.go:90
↓ 2 callers
Function
placeInsideRoom
(s *Layer, r rect, t rune)
gmgmap/bspinterior.go:444
↓ 2 callers
Function
placePaths
(g, s *Layer, world villageWorld, usage0, usage1, usage2, usage3 rune)
gmgmap/village.go:167
↓ 2 callers
Method
set
(x, y int, sp Superposition)
gmgmap/wfcshop.go:201
↓ 1 callers
Function
NewBSP
NewBSP - generate a new dungeon, using BSP method
gmgmap/bsp.go:6
↓ 1 callers
Function
NewBSPInterior
NewBSPInterior - Create new BSP interior map Implementation of https://gamedev.stackexchange.com/questions/47917/procedural-house-with-rooms-generator
gmgmap/bspinterior.go:49
↓ 1 callers
Function
NewCellularAutomata
NewCellularAutomata - create a stone-on-floor map using cellular automata For a number of repetitions: If the number of stones within one step (includ
gmgmap/cellular_automata.go:15
↓ 1 callers
Function
NewInterior
NewInterior - create a building interior layout map. The layout has a "lobby", multiple rooms that all connect to the lobby. Idea taken from http://ww
gmgmap/interior.go:18
↓ 1 callers
Function
NewRandomWalk
NewRandomWalk - create a tree-on-floor map using random walk algorithm
gmgmap/random_walk.go:6
↓ 1 callers
Function
NewRogue
NewRogue - generate a new Rogue-like map, with rooms connected with tunnels
gmgmap/rogue.go:13
↓ 1 callers
Function
NewShop
NewShop - create a single shop, surrounded by road tiles. A shop contains the following elements: - Road around grass, with floor interior - Walls - C
gmgmap/shop.go:28
↓ 1 callers
Function
NewVillage
NewVillage - create a village, made up of multiple buildings
gmgmap/village.go:22
↓ 1 callers
Function
NewWFCShop
WFCShop - create a single shop, surrounded by road tiles. The interior is filled using Wave Function Collapse, with these rules: - Road on the edge -
gmgmap/wfcshop.go:42
↓ 1 callers
Method
Overlaps
(r2 rect)
gmgmap/util.go:28
↓ 1 callers
Method
ToTMX
ToTMX - export map as TMX (Tiled XML map)
gmgmap/tmx.go:85
↓ 1 callers
Function
addBuilding
(g, s, f *Layer, r rect, tileRoom, tileWall rune, hasSign bool)
gmgmap/village.go:197
↓ 1 callers
Method
addNPC
(rr *rand.Rand, c *Layer)
gmgmap/village.go:16
↓ 1 callers
Method
addPath
Use A* to find and return a path between two points A* will avoid any tiles where there's something in the structure (s) layer
gmgmap/village.go:286
↓ 1 callers
Function
addPaths
(rr *rand.Rand, m *Map, exportFunc func(*Map), g, s *Layer, buildings []building)
gmgmap/village.go:98
↓ 1 callers
Function
assignBuildingImportance
(rr *rand.Rand, buildings []building)
gmgmap/village.go:77
↓ 1 callers
Function
canDrawInDirection
(g Layer, startX, startY, dx, dy int)
gmgmap/bsp.go:215
↓ 1 callers
Method
countCollapsed
Count the number of collapsed values around a tile that match a certain tile Boundary tiles don't count
gmgmap/wfcshop.go:207
↓ 1 callers
Method
entropy
()
gmgmap/wfcshop.go:166
↓ 1 callers
Function
euclideanDistance
(x1, y1, x2, y2 int)
gmgmap/util.go:173
↓ 1 callers
Method
floodFill
Perform a flood fill starting from a location Floods up, down, left and right
gmgmap/map.go:155
↓ 1 callers
Function
genBuildings
(rr *rand.Rand, width, height, buildingPadding int)
gmgmap/village.go:44
↓ 1 callers
Function
get16Tile
(m Map, x, y int, tile rune, templateTiles *[16]string)
gmgmap/tmx.go:316
↓ 1 callers
Function
get16Tile2
(m Map, x, y int, tile rune, templateTiles *[16]string)
gmgmap/tmx.go:373
↓ 1 callers
Method
getUsage
(x, y int)
gmgmap/village.go:280
↓ 1 callers
Method
incUsage
(x, y int)
gmgmap/village.go:276
↓ 1 callers
Function
manhattanDistance
(x1, y1, x2, y2 int)
gmgmap/util.go:169
↓ 1 callers
Function
newAdjacencyMatrix
(x int)
gmgmap/bspinterior.go:30
↓ 1 callers
Function
newLayer
(name string, width, height int)
gmgmap/map.go:69
↓ 1 callers
Function
newSuperpositions
(m *Map)
gmgmap/wfcshop.go:222
↓ 1 callers
Function
newVillageWorld
(w, h int, s *Layer)
gmgmap/village.go:248
↓ 1 callers
Method
numConnections
Don't count edges as connections
gmgmap/rogue.go:238
↓ 1 callers
Function
placeBuildings
(m *Map, exportFunc func(*Map), g, s, f *Layer, buildings []building)
gmgmap/village.go:84
↓ 1 callers
Function
placeNPCs
(rr *rand.Rand, m *Map, exportFunc func(*Map), c *Layer, buildings []building)
gmgmap/village.go:187
↓ 1 callers
Function
populateTemplate
(rr *rand.Rand, m Map, tmp *TMXTemplate)
gmgmap/tmx.go:171
↓ 1 callers
Method
removeLayer
(name string)
gmgmap/map.go:90
↓ 1 callers
Function
rep
(l *Layer, r1, r2 int)
gmgmap/cellular_automata.go:84
↓ 1 callers
Method
setTile
(t *Tile, x, y int)
gmgmap/map.go:420
↓ 1 callers
Function
unplacePaths
(s *Layer, usage0 rune)
gmgmap/village.go:154
Method
PathEstimatedCost
PathEstimatedCost - heuristic cost of path for astar, using manhattan distance
gmgmap/map.go:405
Method
PathEstimatedCost
(to astar.Pather)
gmgmap/village.go:241
Method
PathNeighborCost
PathNeighborCost - cost of traveling to neighbour for astar
gmgmap/map.go:400
Method
PathNeighborCost
(to astar.Pather)
gmgmap/village.go:235
Method
PathNeighbors
PathNeighbors - Get neighbours for astar pathfinding
gmgmap/map.go:384
Method
PathNeighbors
()
gmgmap/village.go:220
Method
PrintCSV
PrintCSV - print raw rune values as CSV
gmgmap/map.go:237
next →
1–100 of 105, ranked by callers