# .font: font.text_2
2020-07-13 00:34 DarkStoorM  
# .font: font.text_1
Algorithm: Mulberry32  
  
Seed: 64  
  
Random fill:   
- Boulder: 33  
- Dirt: 44  
- Magic wall: 45  
- Space: 79  
- Titanium Wall: 81  
- Diamond: 86  
- Firefly: 87  
- Butterfly: 88

# .font: font.text_2
2020-07-13 12:29 nesdori  
# .font: font.text_1
it's quite amazing how simple mulberry32 prng is and it still has a cycle length of all possible states (2 to the power of 32). it also does well in test suites. 64-bit thrust prng where mulberry32 is based is even more simpler but test results are not as good and there are restrictions for seeds.

# .font: font.text_2
2020-07-13 13:32 DarkStoorM  
# .font: font.text_1
Hm... I think I've made a mistake. I was looking for generating a number with Mulberry32 from a specific range, and the solution I found was to divide the result by 0x100000000, then multiply by max_number+1 and take the floor(). I did not verify if that's even the correct way to utilize this function, but it seems to generate the 0-255 numbers correctly. The next number uses the generated number as a seed for the next generation.  
  
I don't like the "looks like it works, so it probably works" way and I'm afraid I did something wrong.  
  
This was the solution for JavaScript and I'm also afraid that when I will try to implement it in my C# project, the results will be off :D oh well, it's always some experience!

# .font: font.text_2
2020-07-13 15:28 nesdori  
# .font: font.text_1
 darkstoorm , sounds complicated :) you should seed the rng just once, not with the results anymore. then the rng works like it's intended and random values are more random. and because you would like to get value between 0-255 which is exactly 8 bits you don't have to do complicated calculations, just do: value & 0xff :)

# .font: font.text_2
2020-07-13 15:59 DarkStoorM  
# .font: font.text_1
ahhhh! I realized I actually did it wrong. In fact, every algorithm I used is wrong, because I used the result number as a seed... I should not do that. Thank you  nesdori ! Also: value & 0xFF works great  
  
I rechecked the function and I missed one important thing:  
  
uint32_t z = (x += 0x6D2B79F5UL); // x = state  
  
I missed the part where X is different with each call... I though I have to re-seed it with the result, which was wrong! :D I was looking at the C64 PRNG and I thought the result is the seed.  
Now, all the generated caves are using the wrong data, but I think it was a good experience! At least the C64 works as intended.  
  
Once I get back I will fix the algorithms and compare the numbers distribution.  
  
I was praying to get the same results, but the data was different... well, that's what I get :D