Earlier quoted context omitted.
Is the Factorio source code available anywhere? I would be really curious to see how a game like Factorio was developed (e.g., what parts are 'the engine' and what parts are scripted? how does such a complex game have so few bugs?)
Factorio is closed-source, unfortunately. Still, you can read a lot about how the devs developed it on their "Friday Facts" posts: https://factorio.com/blog/
Basically - tests, reproducibility, and dedication to tracking down "weird minor bugs" before they become "major show stoppers".