Monday, June 11, 2012

Supply and reinforcement done... sort of

Supply and reinforcement is functionally complete but it is extremely slow.


I like the functionality and I've built out France to be a complete nation so that the French troops will have their own supply chain while they invade Spain in my mythical test scenario.


Normally, it is considered bad form to optimize prematurely.  There are a lot of good reasons for this, the biggest being that you are likely to make changes down the road that will force you to re-optimize later.


However, I've decided to bite the bullet and tackle it now for a couple of reasons:
1) It is so slow that it will make testing everything painful.  This will cause a development inefficiency as I have to wait every time I hit the new turn button.
2) It is slow even with the relatively small countries and armies of France and Spain.  What happens when I get Russia built out with a 4 million man army???  If I can't make it fast now, I'm in big trouble when the complete game is done.  Might as well find out now if my supply chain system is just flat out too slow and needs to be scrapped and re-written.
3) Most of the optimization should be doable by simply caching the previous supply chain and then having some sort of test to determine how much of it needs to be recalculated.  This is fairly straightforward.
4) The supply chain code is fresh in my mind right now.  If I come back to optimizing it in 3 months, I will need to bring myself back up to speed.


So, taking that all into account, I'm extending this release to include an optimized supply chain procedure...

No comments:

Post a Comment