The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

Hi all

I'm making a program that implements procedural content generation (PCG) to create maps in a 2d game.

I use the graph data structure as the basis. then the graph will be transformed into a map like in this example:

graph example
map example

with graph specifications as follows:

-vertex can have more than 4 edges

-allowed the formation of cycles in the graph

any suggestions what method I can use to convert the graph to a 2d map in a grid with space-tight results?

Godot version 3.4.2
in Engine by (14 points)

1 Answer

0 votes

i don't know if you want to have only 1 specific result for any input graph or input the same graph can result in a slight different every run
but i think you should generate the map at the same time when you generate each node in the graph so you can check for space available while generating the map

by (20 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.