Shannon V. OKeets
Posts: 22095
Joined: 5/19/2005 From: Honolulu, Hawaii Status: offline
|
quote:
ORIGINAL: Incy quote:
If a previous path fails (e.g., due to weather) then the program will search for a path with fewer available basic path hexes. Finding one, that will become the new 'previous' path. The next time the program needs to find supply for the the unit/secondary supply source, it will try to use the previous path. So, if a path with 2 Basic Path Hexes becomes required, that will become the new default. The problem is with paths where the optimal lenght is 3 or 4. -when the weather turns bad you'll do an exhaustive search and fail, no path being recorded. -when the weather turns good you'll do another search and succeed This will repeat over and over again. Worse, where paths are longer than 4 you'll end up doing exhaustive searches every time anything at all is checked. Units with paths longer than 4 (or with no path) can be very expensive. As the game proceeds potentially hundreds of units could be without a 4-lenght or better path. Given that they have no path, every such search should be expensive, too. The problem is that whenever anything happens that can affect supply, all of those units will have to be retested. So in the late game you may end up testing potentially hundreds of paths everytime a zoc or a hex changes. It's not that bad. Only the rail paths from secondary to primary are ever more than 4 hexes away, so those searches are fast. Most of the seconary to primary never change (i.e., the cities are immobile). For example, tracing from capitals captured by the Germans (or aligned to Germany) to a German city remains the same throughout the game for the most part. I am keeping the last successful path for each unit, even if it has since failed. This means that if a unit has supply with a path of 4 and the weather changes to 2 and all paths fail (i.e., the unit is out of supply), I still have the last successful path, so if the weather gets nice again, the path should work again. Storing paths is easy and takes very little memory. Checking them is also very fast to do. EDIT: Existing overseas paths are easy to validate too, with the caveat that some are rail paths. From testing the new supply determination code in detail, the worst case I have seen is Ethiopia when it is held by the Italians. That secondary supply source is virtually never able to trace back to a primary supply source, but it has to be checked continuously to see if a miracle has occurred.
< Message edited by Shannon V. OKeets -- 6/6/2010 1:58:59 AM >
_____________________________
Steve Perfection is an elusive goal.
|