Ideas to how to generate lakes on a map
Posted: Wed May 17, 2023 7:40 am
I use rotLove (needed to run example I posted, sorry) for generating maps. Works okay. But I want to generate maps more like Brogue (using rotLove's Brogue map gen) but it doesn't work well and just gives me either square rooms or one whole cave.
But this is how a Brogue level looks
Now I'm wondering how to get those "lakes" (water lakes, chasms and lava lakes) to generate too like Brogue in a way that no room is blocked and there's a path to every where, like brogue.
From this interview (and also the gdc talk that's out there + the wiki) it says that it generates a blob(?) then moves it around until there's always a path to all places and nowhere is blocked. Won't that take some processing time? (But levels load fast in Brogue) And how would I check if there's a path always I feel like it wasn't explained to it's fullest.
Anyway, I still attempted. I first tried just using Cellular Automata (it didn't work ) ... to rough, hence why Brogue used "blobs" so I went to the code of rotLove and saw how they made cave levels and generate a mini Brogue cave around half the size of the original level (I had to edit the rot code to give me a Brogue cave always when I needed). But 1) The blobs aren't always connected and 2) They don't look as natural, and that's even before I've tried to "move it around"
Please does anyone know/try to implement this feature?
Code: Select all
--[[ Brogue ]]
ROT= require 'src.rot'
function love. load ()
f =ROT.Display( 80, 30)
brg=ROT.Map.Brogue(f:getWidth(), f:getHeight())
brg:create(calbak, true )
end
function love.draw() f:draw() end
function calbak(x, y, val) f:write(val== 3 and '*' or val== 2 and '+' or val== 1 and '#' or '.' , x, y) end
local update= false
function love.update()
if update then
update= false
brg:create(calbak)
end
end
function love.keypressed(key) update= true end
Now I'm wondering how to get those "lakes" (water lakes, chasms and lava lakes) to generate too like Brogue in a way that no room is blocked and there's a path to every where, like brogue.
From this interview (and also the gdc talk that's out there + the wiki) it says that it generates a blob(?) then moves it around until there's always a path to all places and nowhere is blocked. Won't that take some processing time? (But levels load fast in Brogue) And how would I check if there's a path always I feel like it wasn't explained to it's fullest.
Anyway, I still attempted. I first tried just using Cellular Automata (it didn't work ) ... to rough, hence why Brogue used "blobs" so I went to the code of rotLove and saw how they made cave levels and generate a mini Brogue cave around half the size of the original level (I had to edit the rot code to give me a Brogue cave always when I needed). But 1) The blobs aren't always connected and 2) They don't look as natural, and that's even before I've tried to "move it around"
Please does anyone know/try to implement this feature?