Hi,
As a developer, I would like to understand how factorio internally handle stuff/data, especially, how factorio track and update the position of every single resource in the game?
I made some thought experiment and came with this ideas:
1. Each sprite of resources that move on belt has coordinates. So, at each tick, the game as to update coordinates of every resources and do stuff when the enter the next tile.
That solution should cost enormous quantity of computation and tests.
2. Each tiles on game only track the resources placed on it. At each tick, it update position of the resources. When they enter the next tile, the owner (tile) of the resource change.
Some computation can be mutualized, but it should cost a lot anyway.
Any other ideas?
But, how It works?
Re: But, how It works?
This has been optimized a lot, and I'm not familiar with the specifics, but you'd probably be very interested in their weekly blog, which often includes technical things about optimization. Just a few that might interest you: Belt optimizations (1, 2), pathfinding, noise, GUIs, electric networks and smoke, misc. stuff, more various stuff (cont.), FPS and multithreading, and rendering (cont.). Let me know if there's anything else you want to read about specifically, and I can probably find something for you.
There are 10 types of people: those who get this joke and those who don't.
[solved] Re: But, how It works?
Thank you, I found what I was looking for.