V
V
Valery Albertovich Zhmyshenko2020-08-27 03:35:43
Game development
Valery Albertovich Zhmyshenko, 2020-08-27 03:35:43

How to do procedural generation for a 2d roguelike on löve2d?

I use the love2d engine and the tinyKeep procedural generation algorithm , I was able to generate arbitrary rectangles in an arbitrary radius from the center, but how can I make them spread all over the map (like this, only of course without animation)?5f46ffd303670460351909.gif

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dollar, 2020-08-27
@dollar

Move them in all directions until they stop overlapping each other.
In order not to iterate over all with all, I would make the heat map as a two-dimensional array, each cell of which would store the number of rectangles above it. But not the fact that it will be so optimal in terms of speed. Like an idea.

0
0Bannon, 2020-08-29
@0Bannon

Here is an interesting video
https://www.gdcvault.com/play/1021877/Constructing...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question