Page 1 of 1

damaged units trace to factory

Posted: Sun Nov 30, 2008 7:19 pm
by WanderingHead
From alternate thread here:
ORIGINAL: Lucky1
Since you are explaining the mysteries of retreats, I wonder whether it might be possible to explain how damaged items trace to factories. I have always been puzzled about this and wonder (for example) why my damaged Chinese fighter (and often, other units) queues up in Sinkiang....

There is a lot going on under the hood that is rather complicated to explain. This is an example of that. The whole objective (as with retreats) is to have it work intuitively enough that you usually don't question it.

Damaged units look for the factory that has the most unused capacity. This is most tricky with China, because you (should) freeze production of everything in seasons where China has no production ability. This means that every factory appears to have unused capacity.

Capacity is not the only thing that goes into it. There is a check that units can get to a factory, and some funky port-to-port rules (described in release notes), and there is a little discouragement for non-naval units in ports (in an effort to preserve port capacity for naval repairs).

Throw all this in together, and in the case of a tie the region with the lowest region number will be found first. For China, this means Sinkiang.


RE: damaged units trace to factory

Posted: Sun Nov 30, 2008 11:30 pm
by Lucky1
I almost always freeze production (allowing for mental lapses) in China, so I am still puzzled why units queue in Sinkiang. Is it because it is the furthest away from the action? I am not clear on how the factors you describe come into play in this situation.... (sorry about the difficult questions!) I have had situations where it is the only damaged unit....
 
Thanks as always for your hard work!

RE: damaged units trace to factory

Posted: Mon Dec 01, 2008 1:55 am
by WanderingHead
ORIGINAL: Lucky1
I am still puzzled why units queue in Sinkiang.

Because the region Sinkiang has the lowest region number (161), which simply means that it is found first. It is not the result of any intentional algorithm, just the luck of the order in which regions were numbered.

When all else is equal, sometimes it comes down to having either the smallest or the largest region number.


RE: damaged units trace to factory

Posted: Mon Dec 01, 2008 3:22 am
by Lucky1
If I wished to avoid the problem, would it help if I queued a unit in Sinkiang, but 'froze' its production? Would this somehow be factored into calculating whether capacity was being used?

RE: damaged units trace to factory

Posted: Mon Dec 01, 2008 6:55 am
by GKar
No, but it would help if there was a unit "in real production" during the turns where China doesn't produce anything anyway.

As a suggestion for WH, would it be hard to introduce a random choice between all regions with the same trace value instead of just picking the first or last?

RE: damaged units trace to factory

Posted: Tue Dec 02, 2008 9:13 pm
by Lucky1
I would humbly suggest that queuing priority be given to factory regions where units were damaged in the first place. For example, in a recent game Kyushu was attacked amphibiously. Although it has working factories etc., the damaged artillery (much needed for repelling amphib invasions) were queued for production in Honshu. Rather than be back in Kyushu at the end of my turn, they are now showing up hundreds of kilomtres away in Honshu. Kyushu, where I had purposely left them, was now denuded. I think this is illogical on many levels. Fundamentally, if I had wanted the units to be in Honshu, they would have been in Honshu.
 
So I would suggest that queuing preference be given to where the player chose to have the units in the first place (if sufficient production exists to allow this).

RE: damaged units trace to factory

Posted: Thu Dec 04, 2008 5:28 am
by a511
I fully understand Lucky1's frustration ito where the CHN damaged units are traced to.  However, I think the queuing preference to player to chose is too much work for the player (and i doubt whether thats possible to program without opening another can of worms ...)
 
I think the most logical way to solve the issue is to give first priority to trace the damaged units to its original region (assuming there are available production capacity) instead of picking the first or last region no.
 
a511

RE: damaged units trace to factory

Posted: Sun Dec 07, 2008 3:59 am
by WanderingHead
I'm thinking I could add a *small* bias towards queueing at factories that are closer to the damaged unit's location. This would prevent the Sinkiang thing, and somewhat reduce the Honshu thing. The issue with Honshu is that it has a lot more productive capacity, so it really sucks them in.

And in general the algorithm actually makes sense ... it simply looks for the region with the most production, so units don't clog factories that don't have production. Remember it has to work in many situations. Having damaged units almost always queue in factories in regions where they are damaged would get real frustrating when you are on the retreat.