MapGenerator #34

Merged
tonitch merged 5 commits from MapGenerator into master 2023-05-01 18:38:53 +02:00
Owner

This generate maps following a simple structure

First we choose map size depending on the difficulty

we grind the edge with a random pattern so the map is not just a square

we pick a random open piece and try to make a piece out of it between a size of 1 to 3

and we do this in a loop until all open spaces are filled

this is not the best but it's efficient

known problem:

  • We can have sometime a lot of small pieces
  • We can have weird shape, for instance pieces that are only connected by corner

I think this is technically not a problem in the end. but this could be changed

Before reviewing this pr please watch the other two I made before, it'll be easier to review then.
#33 and #32

This generate maps following a simple structure First we choose map size depending on the difficulty we grind the edge with a random pattern so the map is not just a square we pick a random open piece and try to make a piece out of it between a size of 1 to 3 and we do this in a loop until all open spaces are filled this is not the best but it's efficient known problem: - We can have sometime a lot of small pieces - We can have weird shape, for instance pieces that are only connected by corner I think this is technically not a problem in the end. but this could be changed Before reviewing this pr please watch the other two I made before, it'll be easier to review then. #33 and #32
tonitch added the
Important
label 2023-04-27 11:25:55 +02:00
tonitch added 4 commits 2023-04-27 11:25:58 +02:00
Todo: check if there is isolated cell and delete them too
Currently only boolean but we can add more if we need
Vector to string
Generating Pieces in the map
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
16ab4b5387
tonitch requested review from School_Project 2023-04-27 11:26:12 +02:00
tonitch added the due date 2023-05-01 2023-04-27 11:26:32 +02:00
tonitch added a new dependency 2023-04-27 11:26:39 +02:00
tonitch added a new dependency 2023-04-27 11:26:47 +02:00
Mat_02 reviewed 2023-05-01 17:52:32 +02:00
@ -0,0 +36,4 @@
}
for (int i = 0; i < map_shape.length; i++) {
for (int j = 0; j < map_shape[0].length; j++) {
if(i > depth - 1 && i < map_shape.length - depth && j > depth - 1 && j < map_shape[0].length - depth){
Member

boucle qui fait le tour des extrémités de la matrice

boucle qui fait le tour des extrémités de la matrice
tonitch marked this conversation as resolved
Mat_02 approved these changes 2023-05-01 17:53:21 +02:00
tonitch added 1 commit 2023-05-01 17:54:28 +02:00
Merge branch 'master' into MapGenerator
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
f5d80c194f
tonitch merged commit c6df656381 into master 2023-05-01 18:38:53 +02:00
tonitch deleted branch MapGenerator 2023-05-01 18:38:53 +02:00
tonitch referenced this issue from a commit 2023-05-01 18:38:53 +02:00
Sign in to join this conversation.
No description provided.