/tg/ Station 13 - Modules - Types

modular_aphelion/modules/dirt/code/random.dm

/datum/dirt_randomA stream of random draws seeded by text, the same on every server and in the reference generator, so a mask drawn here matches the reference's pixel for pixel. The nth draw, counting from 0, is md5("[seed]:[n]") cut to its first six hex digits: a 24-bit integer, which a DM number holds exactly.
/proc/dirt_perm_tableReturns the table the noise hashes lattice points through: 0 to 255, shuffled by the "dirt:perm" stream.
/proc/dirt_noise_hashReturns a lattice point's noise value, from 0 to 1 in steps of 1/255.
/proc/dirt_value_noiseReturns smooth value noise from 0 to 1: the four lattice points round a sample, blended with a smoothstep. Each point is dirt_noise_hash()'s, its chain's seed steps taken once and each column's step once, for the four.
/proc/dirt_spread_noiseReturns two octaves of value noise, stretched back out to cover 0 to 1 (summed noise bunches round 0.5).