I'm starting with a seed value of two bytes and use the first byte to set a variable then add the two bytes, replace the first byte with the second and store the sum in the second byte's space as follows:
Code: Select all
This will give me a repeatable sequence of values to set the attributes of the rooms, paths, monsters etc
Each level has 9 spaces for rooms and I'd like there to be a 75% chance of a room being present so one of the attributes is 'exists'. What is a good way of deciding how to implement this? At first I was simply going to use values over 64 means the room exists and below means it does not but was worried that two low (0 and 1) could create a lot of non-existant rooms.
If I were to AND the seed with 00000011 would this give me 0 25% of the time? I think it would but I've had the kids running round screaming all day and my brain seems to have stopped functioning properly.