![]() If the difference in weight is high, then the algorithm will prefer going through existing rooms and corridors, making the paths more tortuous, and with fewer choices to reach a certain destination. If the difference in weight is small, then digging new corridors will be reasonably cheap, and the algorithm will make many corridors in between rooms, with many possibilities to go from a place to another. For this, run a pathfinder to dig corridors (let's say, A*) in between each pair of rooms, giving a random chosen weight to existing spaces (rooms or other corridors) compared to space not yet carved (the walls). Then, you need to make sure that all rooms are connected to each other. An adaptive algorithm could even define some zones that are made of large hallways, and others of very small rooms. Random parameters will define the size of rooms and their numbers. ![]() I managed to get reasonably good looking levels by using the following algorithm, based on a square grid:įirst, create a set of rooms. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |