Instead of creating a single map that gets used over and over again for Slender: the Eight Pages, I thought it might be cooler to generate a map in game. This way, while the mechanics and the basic layout of the terrain remain the same, the map won't be entirely the same from one play through to the next. While I'm not sure if that randomness will work for a remake of Slender: The Arrival, that's something to deal with when the time comes.
I'm trying to create a routine that spawns in trees, cars, oil tankers, and sheds. There is a spawn probability set for each object to spawn:
Code:
This is meant to work in tangent with a random number generator to create terrain. However, the one thing I can't figure in is how to limit the number of objects without having the map thin out toward the end bc the algorithm knows it can't spawn as much. Anyone any ideas?
Code:
^That controls how many objects are generated.
I'm trying to create a routine that spawns in trees, cars, oil tankers, and sheds. There is a spawn probability set for each object to spawn:
Code:
#define spawnProb_Tree 13 ; value of 6≤x<13
#define spawnProb_Car 6 ; value of 3≤x<6 will spawn
#define spawnProb_OilTank 3 ; value of 1≤x<3 will spawn
#define spawnProb_Shed 1 ; value of x<1 will spawn
any number above 13 will mean an unoccupied tile
This is meant to work in tangent with a random number generator to create terrain. However, the one thing I can't figure in is how to limit the number of objects without having the map thin out toward the end bc the algorithm knows it can't spawn as much. Anyone any ideas?
Code:
#define numObjects 50 ; change this to put more objects in map
^That controls how many objects are generated.