Open DarkShadow44 opened 3 years ago
This is an idea I like in principle, but it is not really implementable - tanks exist in too large a number across a map to make caching their locations and ticking them remotely performant.
Hm, wouldn't ticking every 5 seconds or so be good enough, for performance I mean? For clarity, only the ticking is performance relevant, right? As a fallback, for too many tanks, maybe distribute the ticks randomly over a limited number of tanks? That would delay the effect a bit, bit would keep the performance high.
Hm, wouldn't ticking every 5 seconds or so be good enough, for performance I mean?
No, because the sheer size of that cache would make just storing and reading it expensive, plus the fact that factorio lends itself to massive spam of infrastructure where hundreds of thousands of tanks is not an unrealistic expectation.
As it is, I have issues with people complaining about EndgameCombat because they use ten thousand custom-scripted turrets.
I understand.. From a design perspective, would preventing the fluid from entering a tank be good enough? There's already a filter property for pipes/tanks, maybe they are willing to add a blacklist filter as well?
So, I researched a bit, and I don't think a blacklist filter will be coming (devs said it would need a big rework since the fluid system doesn't work like that).
However, we could only update a certain number of tanks - I got a small POC (for steam). The idea is:
Since the point is to discourage building steam tanks, there should not be too many. So we can easily run even complex logic as the cooling process
Only problem is, the more tanks there are, the slower the update rate is - the overall loss (once added) should be the same though. The save of UPS is worth this I think.
I tested with ~370k tanks. With that mod, I get 48 UPS, without 56 UPS. Which sounds acceptable to me.
Test save (370k tanks): testtanks.zip
For a few tanks only, you can always make a fresh save.
POC mod: SteamCooling_0.0.2.zip (Adapted from https://mods.factorio.com/mod/SteamCooling)
What would you think about that idea?
1000 tanks a tick is still going to be massively overly costly, and that does not avoid the need to cache every tank in a giant global table whose size would probably double save/load times.
1000 tanks a tick is still going to be massively overly costly
Yeah, that's the problem with handling the concept in lua. Sure it loops 1000 times, but keep in mind that most tanks are paused from ticking for 5-10 ticks before they get considered again. What drop in performance would you consider acceptable? As I said, I tested, and the drop wasn't too bad with 370k tanks.
and that does not avoid the need to cache every tank in a giant global table whose size would probably double save/load times
The table could be recreated every load. This should still be faster for loading, and a lot for saving.
The table could be recreated every load.
This requires scanning the surface, which is very slow - making loading even slower - and creates a huge RAM spike on large maps.
Right now the thermally heated water loses heat when put into normal fluid wagons. Maybe something similarfor storage in fluid tanks is possible?