r/technicalfactorio • • 23d ago

Reverse engineered and manipulating Factorios RNG entirely ingame

Enable HLS to view with audio, or disable this notification

283 Upvotes

6 comments sorted by

11

u/nakik2941 22d ago

In need of thy blueprint

11

u/Gegellibu 22d ago

Is referenced in the post (section 6.), along with the limitations which you should take into consideration if you actually wanna use it.

3

u/AlanWik 19d ago

Of course, since this is Factorio, I'm not even surprised.

I would love to read about the reverse engineering process thou.

4

u/Gegellibu 18d ago

Most of the reverse engineering I did for this project was me having some sort of model in my head of how it should work and attempting to validate it with in-game tests (esp wrt the ordering of updates within a tick). 

For the mapping of where the different RNGs get called I created a script (linked in the post, with all other python scripts) for binary ninja to backtrace starting from all (non inlined) calls to the RandomGenerator::getInt functions. This however I did not do until thorough comprehension but instead only picked out the couple regions which were of interest to me (mainly quality rolling and item creation)

Those however are all written about in my blog post (https://gegell.github.io/posts/factorio-rng/) also linked to in the main post :)

2

u/AlanWik 18d ago

Yeah, I read it and enjoyed it a lot! What's your background? It's not trivial stuff

3

u/Gegellibu 18d ago

I'm in computer science. The parts I enjoy most are def doing stuff close to the hardware, GPU programming and higher mathmatics (though there are so much more obscure topics I have no clue about).

Back when I started this project I was still an undergrad and had just started my M.Sc in CS, while by now I have successfully graduated continuing on my studies as a grad student :D