The remaining 50% is 10% development and 40% testing and refinement. I might try finish the development tonight but honestly I’ve got a hankering to go play some Battleground Europe – it’s a little MMO wargame y’all might have heard of. Some rumors say it’s being bought by Sony but I can only wish :)
Most of today was exploring methods for representing the lists – these lists are relatively large and have highly variable rates of change. The best performance I could find was a std::map<time_t, std::vector<ResupplyTicket>> with the vector pre-allocated to the sum of each vehicle’s capacity. That’s probably going to wind up to being around about 1Mb of RAM just for the resupply queues.
My best estimate is that average usage of that memory will be around 3% and I’ll have to track the capacity so that I can ensure a single resize per TOE when RDP gets processed.
Down to 15 TODO:TOEs: 4 are resupply based (just haven’t removed them yet), 3 are questions that probably won’t be implemented until after TOEs.
I’ve re-implemented trickle supply – which applies to brigades coming back from off-map, to new equipment added by RDP, to equipment that went “missing” while a brigade was out of supply, etc.
I also took a detour to clean up the in/out of supply code and dispensed with the old concept of being “out of supply” when you have no friendly links. Whether a town is in supply is now entirely based on having factory links. Simplifying this made it much easier to ensure things worked as expected.
This was because trickle supply actually gets involved more often than you might think: Brigades getting moved off-map lose their supply list and when they move back on-map they restart with trickle supply – they don’t build up supply while off-map. And if a brigade is in a pocket it stops getting resupply – if you manage to reconnect that pocket the brigades in it will start to trickle supply. And, uh, if the server crashes, the missing equipment will be trickle supplied – but on a shorter timer.
So now if a brigade is in a town that has no factory link, it gets no resupply. Not delayed resupply – no resupply – until you reconnect the pocket. Unless you manually resupply it ;)