1
\$\begingroup\$

I am trying to algorithmically create a game like the one in the picture below

enter image description here

I am trying to Create random levels from an algorithm.

Ideally, the algorithm will take into account the desired difficulty size and the board size ( N x N ) and produce a random map based on those 2 things.

I personally don't know how to determine difficulty in this game nor how to mathematically model it.

\$\endgroup\$
  • \$\begingroup\$ The picture alone does not tell us what criteria the algorithm needs to fulfill. You'll need to edit your question to describe in detail what you need from the output of the algorithm, or what cases must be avoided (eg. if this is a puzzle game, then you probably want the levels to be solvable, which means you're need to define what constitutes a solvable level) \$\endgroup\$ – DMGregory Apr 5 at 2:13
  • \$\begingroup\$ You'll also need to tell us, specifically, about your game, and what kind of levels you want to be created. \$\endgroup\$ – Alex F Apr 5 at 2:25
2
\$\begingroup\$

Generating a level is usually as simple as starting from a solved position and doing random moves backwards to get a randomized level.

Determining the difficulty is a lot harder, since everyone has a different background and will find the same level a lot easier or harder.

One thing I would try however is to train a neural network to spit out the difficulty, since it's much easier to get those to behave similar to humans as regular algorithms and they aren't very hard on computation. You will have to spend a couple of hours in front of it to get it to an acceptable level though, you may want to consider starting the game with an untrained one and "outsource" the task to users by using the solve time and move count to determine how hard the puzzle actually was.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.