diff --git a/a.out b/a.out index e2d1d5a..0a6f626 100755 Binary files a/a.out and b/a.out differ diff --git a/display.cmi b/display.cmi index 027e575..c3df8c6 100644 Binary files a/display.cmi and b/display.cmi differ diff --git a/display.cmx b/display.cmx index e7c7b25..e88d1cf 100644 Binary files a/display.cmx and b/display.cmx differ diff --git a/display.ml b/display.ml index 41c0474..9dc4b84 100644 --- a/display.ml +++ b/display.ml @@ -37,9 +37,14 @@ let coin_magnet_dist = 1. ;; (* -------------------------------------------------------------------------------------------------------- *) -let structure_1_frequency = 2500 ;; (* avg number of chunk generation required before encountering a structure of type 1 *) +let structure_1_frequency = 2500 ;; +(* 0 ~ 1000 *) +let oreMissChance = 50 ;; + +(* avg number of chunk generation required before encountering a structure of type 2 *) +(* NOTE : structure 2 attempts to spawn after structure 1, so the odds will be ever so slightly less than this number *) let structure_2_frequency = 2500 ;; (* -------------------------------------------------------------------------------------------------------- *) @@ -1242,7 +1247,8 @@ let generate_structure_1 hash mem ch_x ch_y ch_z = for i = 0 to chunk_size -1 do for j = 0 to chunk_size -1 do for k = 0 to chunk_size -1 do - dyn_append filled {flag = "10" ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = 250; green = 250; blue = 64}; + if (Random.int 1000 >= oreMissChance) then + dyn_append filled {flag = "10" ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = 250; green = 250; blue = 64}; done done done; @@ -1353,8 +1359,10 @@ let generate_structure_2 hash mem ch_x ch_y ch_z = for i = 0 to chunk_size -1 do for j = 0 to chunk_size -1 do for k = 0 to chunk_size -1 do - let (cOre, cColors) = generate_random_ore () in - dyn_append filled {flag = cOre ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = cColors.(0); green = cColors.(1); blue = cColors.(2)}; + if (Random.int 1000 >= oreMissChance) then begin + let (cOre, cColors) = generate_random_ore () in + dyn_append filled {flag = cOre ; cube = create_cube (chx*chunk_size+i) (chy*chunk_size+j) (chz*chunk_size+k) 1; red = cColors.(0); green = cColors.(1); blue = cColors.(2)}; + end done done done; diff --git a/display.o b/display.o index 7088449..7c302ab 100644 Binary files a/display.o and b/display.o differ