Change the way Refinery works
As a programmer, I've always wondered about why refinery is so aggressive in its design and code. It consumes larges amount of processing and resources from the server.
It works aggressively, making constant calculations / operations per second, and over time I saw the increase in lag on the servers as more refineries were up and running. This has improved with game updates, but still needs a better design.
The operations I see happen are:
1. Look for ore in the ship's storage.
2. Find % refinement of the ore and calculate quantity to be reduced.
3. Remove amount of ore from storage.
4. Look for refined ingot stack in storage.
5. Add quantity.
These basic operations are indispensable to have a system of refinement in the game, however, I believe that the optimization would come with a game design change of the refinery.
1. It has to process huge amounts of minerals at once and take longer to deliver these materials. Something similar to what the assembler does showing the progression of construction.
2. We could have one module to increase the amount of material processed at a time.
3. Given this new design, we could select which materials the refinery would use and it could process alternately.
1. Player choose Iron Ore to be processed.
2. Refinery picks up 1000kg of Iron Ore (or what the storage have).
3. Refinary starts processing 1000kg of iron ore. [Sleep for 10 seconds (processing time for 1000kg )].
4. Refinary wake up after 10 seconds.
5. Search for the storage to deliver the Ore Ingot.
The goal is to keep the refinery idle for longer times, avoiding item search / removal / addition operations per second that is currently happening.