Rail Network Outlines for Decoration
2025-04-05To make the world of Railroad Scheduler more visually rich, we’re working on an optimized system for decorative object placement.
🌲 Dingbats & Biomes
Since about the beginning, we've been placing decorative objects (called "dingbats") like trees, rocks, houses etc. around the rail tracks. Later, we introduced biomes, each with its own set of dingbats. Imagine a forest on one end of the track and an urban area on the other.
This was a step in the right direction, but we still feel like Railroad Scheduler would benefit from more decoration along the tracks.
🧠 Smarter Dingbat Placement
So far, we've been using a kind of rejection sampling for distributing the dingbats around the rails. This means we randomly place dingbats and then check if they fit the biome and distance requirements. If they don’t, we simply discard them. This is simple but it's also a lot of wasted effort. We end up placing many dingbats that we then have to throw away, which is inefficient and can lead to performance issues, especially in larger maps. As a result, we kind of had to cut the number of dingbats we could place to keep the game running smoothly.
As an improvement to this, we're working on a new system that aims to place dingbats where they're needed from the start. What we're basically doing is moving away from rejection sampling and towards importance sampling. More specifically, we're working on a mathematical model of outlines around the tracks that allows us to place dingbats statistically at the right place along the rails and at the right distance from them. Check the image below to see a snapshot of what this looks like currently.
Our final goal with this is a more diverse and rich distribution of decoration at the same performance.
