Been a long time watcher, first time writing, blah blah blah...
Anyway, I can do like a bit of tweaking and I don't mind a little copy pasta in coding, but I have found myself unable to find much on the engine.generator.map.* classes.
Setting the zone's generator's class to Roomer, Forest, Maze, Cavern, Empty, or Static seems to work right off the bat (though I have barely a clue as of yet on how to use them).
This question is concentrating on the classes that I can't find much on:
- engine.generator.map.Building
- engine.generator.map.GOL
- engine.generator.map.Heightmap
- engine.generator.map.Octopus
- engine.generator.map.Rooms
- engine.generator.map.RoomsLoader
- engine.generator.map.TileSet
- engine.generator.map.Town
How do I use them?
Are they supposed to be used, or are they rightfully ignored?
Also, how would I write a generator of my own?
I don't mean the the actual map generating code, but everything else after doing that:
What would the algorithm return?
Where do I put it?
Where is it supposed to return to?
For a simple user-defined generator, how do I make a map from a uniform random number generator?
Code: Select all
-- The simplest random map generator possible
local RNG = require("engine.rng") --I assume you need to do this to use the rng module
--- Randomly chooses each tile.
-- Each type of tile has an equal chance to appear at every point on the grid.
-- @param arguments What does the function get passed to it?
-- @return What does it return?
function utterly_random_generator(arguments)
--insert code here
end
Code: Select all
return {
name = "Old ruins",
level_range = {1, 1},
max_level = 10,
decay = {300, 800},
width = 50, height = 50,
persistent = "zone",
generator = {
map = {
class = "engine.generator.map.Roomer",
nb_rooms = 10,
rooms = {"simple", "pilar"},
lite_room_chance = 100,
['.'] = "FLOOR",
['#'] = "WALL",
up = "UP",
down = "DOWN",
door = "DOOR",
},
actor = {
class = "engine.generator.actor.Random",
nb_npc = {20, 30},
-- guardian = "SHADE_OF_ANGMAR", -- The guardian is set in the static map
},
},
levels =
{
},
}
(Man, this is long...)