Castle Jump
Markov Process-Based Platform Generation
Gaussian Distribution
The initial design uses a Gaussian distribution to determine platform placement, with the mean set at the previous platform position. The varianceincreases via a predefined schedule to ramp difficulty. We sample with the Box–Muller transform and then shift/scale to and .
where . Extremes can place platforms out of view.
Clipped Gaussian Distribution
Clipping out-of-range samples to boundaries causes mass to accumulate at edges, especially when the prior platform is near a viewport boundary.
Rejection Sampling
Discard invalid samples until a valid one appears. Straightforward but no longer constant-time as rejection probability grows.
Truncated Gaussian Distribution
Sample via the inverse CDF. Since the Gaussian CDF is intractable, write it with the error function and use efficient approximations.
where .
Error Function Approximations
- Maclaurin — accurate near 0 only.
- Taylor — many anchors needed.
- Abramowitz & Stegun — constant time/space.
Inverse Error Function
- Winitzki — fast erf−1 approximation.
Effective numerically, but results cluster near the previous platform—often undesirable for game feel.
Bimodal Truncated Gaussian
Use a bimodal truncated Gaussian to reduce consecutive platforms near the same spot. Weights adjust with previous platform position (e.g., first quartile → left 25%, right 75%).
