Page 1 of 1
Weird supply issue
Posted: Tue Feb 22, 2022 3:30 am
by stjeand
I am in Yugoslavia in October attacking.
When the game came up it said an Italian unit is out of supply.
Then I checked it.
The hex says it has a supply level 2.
How can the unit be out of supply?
I checked the unit and it is out.
Did I miss something?

RE: Weird supply issue
Posted: Tue Feb 22, 2022 8:40 am
by AlvaroSousa
This is in the current version?
RE: Weird supply issue
Posted: Tue Feb 22, 2022 8:41 am
by AlvaroSousa
Is it a PBEM or A.I. game?
RE: Weird supply issue
Posted: Tue Feb 22, 2022 8:55 am
by AlvaroSousa
It is a discrepancy between calculating supply source and supply range. But I would like to test it with your game. I don't want to make major changes to the supply system without testing this bug. It is rare.
Looking at the code there shouldn't be a problem but this is code with lots of data.
RE: Weird supply issue
Posted: Tue Feb 22, 2022 9:15 am
by stjeand
It was a PBEM game...
Yes updated version.
Sadly I finished the turn...HOPEFULLY I will be in supply this turn as it could create an issue taking Yugoslavia.
Honestly when I get the turn back I suspect I will be in supply since rail will have moved more. Could try to reproduce it though if you like.
I don't think it is crippling...just was surprising.
RE: Weird supply issue
Posted: Wed Feb 23, 2022 5:54 am
by AlvaroSousa
It calcs supply source first then distribution. Might be a move cost discrepancy somewhere. I will look at it more next patch.
RE: Weird supply issue
Posted: Wed Feb 23, 2022 6:27 am
by stjeand
I was in supply the next turn...could have been due to rail supply moving further. Might be able to try to reproduce when I have time if you like.
Re: Weird supply issue
Posted: Mon Feb 28, 2022 2:01 pm
by AlvaroSousa
Keep an eye out for it.
The supply code is incredibly complex and delicate because I hadn't programmed in a long time. To change it now would be a nightmare. WP2 will have less issues because the underlying data structure will be better.
Re: Weird supply issue
Posted: Mon Feb 28, 2022 2:29 pm
by stjeand
It seems extremely rare...that was the first time I had seen where I should be in supply but was not...so at least there is that.