03-15-2013, 04:55 PM
that one I can explain!
Recently plantpots were found to be hogging quite a goddamn lot of cpu resources (which we still haven't entirely resolved, but still) so what I did was make them calculate on every other tick, rather than every tick.
To explain that a little, the game has "loops" for various things - player characters, machinery, lighting, etc. It's basically a big list of everything of that type that the game iterates through, basically checking up on every thing to make it carry out it's instructions constantly. Plantpots are in the machine loop, which means every time they come up in the list they carry out instructions called a process - there's quite a lot of stuff in the plantpot process, so whenever each plantpot gets it's "turn" in the list, they have a lot to do before they can move onto the next one. Since there's a good 8-10 plant pots, it results in a lot of cpu being taken up, which can contribute greatly to lag.
So what I did was make the plant pots skip every other turn, and doubled the numbers of stuff like amounts of reagents they consume or the odds of particular things happening to compensate for the fact that they're not happening as regularly anymore. In addition I made them update their icon every sixth tick, meaning plants may be in a different condition to what they visibly appear as. I did make them update immediately if a new plant was planted or a plant died however.
This may lead to some slightly odd behavior from the plant pots, but they should be pretty much functioning as they usually do.
Recently plantpots were found to be hogging quite a goddamn lot of cpu resources (which we still haven't entirely resolved, but still) so what I did was make them calculate on every other tick, rather than every tick.
To explain that a little, the game has "loops" for various things - player characters, machinery, lighting, etc. It's basically a big list of everything of that type that the game iterates through, basically checking up on every thing to make it carry out it's instructions constantly. Plantpots are in the machine loop, which means every time they come up in the list they carry out instructions called a process - there's quite a lot of stuff in the plantpot process, so whenever each plantpot gets it's "turn" in the list, they have a lot to do before they can move onto the next one. Since there's a good 8-10 plant pots, it results in a lot of cpu being taken up, which can contribute greatly to lag.
So what I did was make the plant pots skip every other turn, and doubled the numbers of stuff like amounts of reagents they consume or the odds of particular things happening to compensate for the fact that they're not happening as regularly anymore. In addition I made them update their icon every sixth tick, meaning plants may be in a different condition to what they visibly appear as. I did make them update immediately if a new plant was planted or a plant died however.
This may lead to some slightly odd behavior from the plant pots, but they should be pretty much functioning as they usually do.