Guild icon
DDraceNetwork
DDraceNetwork / mapping
Here you can talk about mapping, ask mapping related questions or request new ratings for released maps
Between 2021-09-27 00:00:00Z and 2021-09-28 00:00:00Z
Avatar
Avatar
Jeremy
Hey, anyone know if there is a perlin noise random map generator for DDNet maps
Avatar
Avatar
ReD
and than I lay this over an empty map. and I assign different blocks for different values of this gray, for example I say if the value is between 1 and 0.7 it's a unhookable tile, if it's between 0.6 and 0.7 it's a hookable tile etc
How do you relate the noise and entities? is there a set of rules you defined or how did you do this? (edited)
17:20
Or as you said, different hues on the grayscale, what did you use to do that?
Avatar
Avatar
Jeremy
How do you relate the noise and entities? is there a set of rules you defined or how did you do this? (edited)
for (int y = 0; y < layer.height; ++y) { for (int x = 0; x < layer.width; ++x) { auto value = perlin_noise.get(x, y, perlin_noise.frequency); if (value > 0.68) { layer.set_game_tile_at(x, y, entity_index_type::UNHOOK); } else if (value > 0.61) { layer.set_game_tile_at(x, y, entity_index_type::HOOKABLE); } else if (value > 0.52) { layer.set_game_tile_at(x, y, entity_index_type::FREEZE); } else { layer.set_game_tile_at(x, y, entity_index_type::NONE); } } }
Avatar
iirc the perlin noise params aren't defined there, so is this code reading an image?
17:44
What noise randomizer did you use for this
17:44
Like, for the image output (edited)
Avatar
it's a perlin noise perlin_noise.get(x, y) gives you the value from 0-1 in this perlin noise before this code, i randomized the perlin noise
17:47
Perlin Noise in C. GitHub Gist: instantly share code, notes, and snippets.
Avatar
Okay, thanks!
✌️ 2
Exported 12 message(s)