Random Entities from Find()

Our aim today is to select a random entity from a collection, so that each entity has an equal chance of being selected. A very simple aim, to which we’re adding the twist that we don’t know how many entities there are in the collection ahead of time. In Quake coding this is actually a very common situation: we don’t have the luxury of arrays that we can query the size of. Continue reading