The above fix I proposed would not work on this line. Based on how binomial distributions work, the mean (expected value) number of entities of each type that attempt to spawn in a second would equal spawnFrequency regardless of the framerate. The standard deviation would change, but the only way I know how to prevent that is to loop the spawn code "milliseconds" times rather than perform multiplication, but that would be horribly inefficient. Tell me what you think.