#2D Procedural map generation
38 messages · Page 1 of 1 (latest)
So are you interested in the process of how to get where to place the tile or how to place the tiles themselves?
both
currently I am using a random walk algorithm but thats just a placeholder
It also doesn't work as well as i'd like
Ok, firstly I won't go into too much on placing tiles. If you want to make your own implementation that is something you can do but something like bevy_ecs_tilemap will probably make it much easier. The documentation is pretty good.
oh ok thank you
as for actually getting where to place the tiles the "best" way depends on your goal and type of game
Is it like a dungeon crawler? Top down open world game etc
dungeon crawler
Yeah for dungeon crawlers there are a lot of different methods. I haven't done too much but I am aware of some popular techniques. You mentioned random walk algorithm. Another thing some people will do is make a set of pre made rooms then randomly choose a direction in each room and place another room in that direction. I've heard of people using cellular automata(basically a set of points in a grid that have a set of rules to determine where to place stuff). Is it something you want to implement yourself? If not I would maybe look at crates.io and see if there are any that do what you want. Otherwise a lot of it is just doing research on what method produces the result for your game. Probably the most simple but sometimes not great results depending on game is just choosing a random direction and placing premade rooms.
pre made rooms?
hmmm
how would I do this with bevy?
also I would love to hear about cellular automata
Before I go further I took a look at crates.io to see if there are any libraries there appears one that seems to have a few premade mapgen options: https://crates.io/crates/mapgen if thats something ur interested in rather then fully implementing yourself
and here they have a browser demo: https://klangner.github.io/mapgen.rs/
That is for more open roguelike games but could still be an option
hmmm ok
A lot of it just really depends on your goals, game, and time willing to dedicate to it
If you are doing a more room based dungeon crawler and don't want to write the mapgen completely by yourself personally I would at least try out the crate(Although i am not giving any guarantees about the crate I have never used it but found it in trying to research options for you) Or if you were interested in doing yourself look at implementations done by other people and start by trying a few learning projects to implement them
hmmm
i think ill try the mapgen crate first, and if it doesn't suit my liking, ill try doing it myself
yeah I love BSP rooms from mapgen
its exactly what I wanted
👍
wait
What's up
I didn't look at the crate but I would assume it has a function to get a tile from the map whether its a wall or not. If you look at the docs it should tell you
Then using the map data it generates you can render tiles based off of what it says
is walkable appears to have what you would need