yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.51k stars 1.57k forks source link

Pathfinding error #6551

Closed saud2410 closed 1 year ago

saud2410 commented 2 years ago

OS: Android 12

Ver: 4.0.6 patch-1, apk from github

mod: horseman till Metallurgy

Savefile: Mongolia - 349 turns.zip

Description: Missionary unit chooses wrong way on the road so it fails to reach destination.

situation & picture
- See the missionary on the left of Atilla's Court. It has to go down. You can see other missionary on the hill near the mountain. That's where it has to reach on the next turn. ![InkedScreenshot_20220415-043332_UnCiv_LI](https://user-images.githubusercontent.com/64586749/163466133-3968cc8d-1dc5-4e2a-bb50-b76b373c7ace.jpg)
- For now, the missionary has to go 4 o'clock of Magnitogorsk to reach the destination optimally. You can see white circles. It has 1.3 mv point and it's on the road so it can go if it goes "left". Weird thing is, there are also white circles that it cannot reach. ![InkedScreenshot_20220415-043348_UnCiv_LI](https://user-images.githubusercontent.com/64586749/163466150-0115f077-2a55-48d2-aba7-55cafac51dd6.jpg)
- But the pathetic missionary goes down, because game thought it can also reach straight downward.🤦 I cannot move it from tile to tile manually because all roads are occupied by Almaty units. Now there are more suspicious white circles 2 tiles away from the missionary. ![InkedScreenshot_20220415-043357_UnCiv_LI](https://user-images.githubusercontent.com/64586749/163466406-02daba1f-2bc7-4af3-b4de-f89da2db2608.jpg)

Additional context: I think the reason of this bug is that pathfinding AI (dunno how i should call it) recognizes 1 additional tiles when the unit moves long distance. I've seen it for quite a long time, but there are no actual problem if i pay attention. But now it makes things mess. I'm also worried for AIs. Player can adapt to the problem, but AIs cannot cuz it's AI issue.

saud2410 commented 2 years ago

(Copied from #6090 written by me)

OS: Android 11, SM-G970N

Ver: 3.19.1 from Playstore

mod: horseman-till-metallurgy ※ I'm afraid to tell but this issue occurred while i'm using prototype of the mod. If you wanna reproduce, please download mod from the repository directly, place it to Unciv mod folder(for example Android/data/com.unciv.app/files/mods), change modename into this:

HorsemanTillMetallurgy

Savefile: Mongolia - 323 turns.zip

Description: If i choose stopover, unit waits 1 turn to move where it can go immediately.

situation & picture
1. Inquisitor near Turfan will move to the hill, but there's worker. ![Screenshot_20220201-131909_UnCiv_LI](https://user-images.githubusercontent.com/64586749/151914800-76a6590a-fc81-4356-ab94-ce545b7d1183.jpg)
2. Move the worker, and popup says 1 turn. If i click now, there's no problem; it goes to the hill like 5. ![Screenshot_20220201-134010_UnCiv](https://user-images.githubusercontent.com/64586749/151914969-3023ee35-2d3c-44cf-97b1-73edae97671e.jpg)
3. Move inquisitor, and popup still says 1 turn. ![Screenshot_20220201-132134_UnCiv](https://user-images.githubusercontent.com/64586749/151915470-e1b1710f-09fd-4c7e-b2fb-8b04d76db3cf.jpg)
4. But if i click from 3, inquisitor waits 1 turn to move. ![Screenshot_20220201-132150_UnCiv](https://user-images.githubusercontent.com/64586749/151915573-7abcf642-f4d1-40be-975e-b292439b588f.jpg)
5. If i manually move inquisitor from 4, it still can reach destination. ![Screenshot_20220201-132209_UnCiv](https://user-images.githubusercontent.com/64586749/151915825-87895d62-11fb-4121-a713-4a04ac0fbb7c.jpg)
yairm210 commented 1 year ago

Since fixed

saud2410 commented 1 year ago

I doubt it, @yairm210

Ver: 4.3.15 exe, win x64 OS: Windows 10 x64

1. Scout seems to be able to reach destination but actually it can't.

Autosave-Mongolia-86.zip

details
▷ Scout below Karakorum moves toward Antium. The journey is; >Rail(scout) → Rail → Rail → Rail → Road → Road → Road → Road → Road(city center) → Road(missionary) ![path er sct 01](https://user-images.githubusercontent.com/64586749/210234256-c9640916-9304-48ae-b4cf-b6a87eecf8ea.jpeg) ▷ When it approaches, it shows like this. Tho it shows it can reach destination in this turn, if you tap it, it just doesn't move. Why? ![path er sct 02](https://user-images.githubusercontent.com/64586749/210234452-8acf1364-5206-45bb-add1-49d4af576ade.jpeg) Maybe it's normal, and i'm misunderstanding its mechanism. But mv=0.4 is bigger than mv=0.33 or mv=0.3. When moving on road, at first 0.3 is depleted, then 0.4(+0.3=0.7), and then 0.3(+0.7)=1. So I thought "Unciv takes into account 2 decimal places but it just doesn't show us!", and i was wrong.

2. Same with 4.0.6 above

Autosave-Mongolia-91.zip

details
▷ I made nearly same condition. It was painfully boring but worth it. Let's give them encore. ![path er mis 01](https://user-images.githubusercontent.com/64586749/210239267-784028cd-9dba-478b-9347-0c9b14b7381e.jpg) ▷ First, missionary should have 1.3 mv. Go upper side of Antium to roam around and come back where it was. ![path er mis 02](https://user-images.githubusercontent.com/64586749/210239649-493dc093-0926-416b-8924-763b3fdfd57c.jpg) ▷ Missionary now have 1.3 movement. It shows exactly same transparent marks on downward of Antium. It indicates you can move there now, which is just wrong. However, red-purple marked tile totally makes sense. ![path er mis 03](https://user-images.githubusercontent.com/64586749/210242045-e145aefe-6f54-4435-ae82-bec5e5a02166.jpg) ▷ In case you wanna see what happens if i click there; still choosing **WRONG** path 🤦 Seems the damn missionary just refuses to reach destination. ![path er mis 04](https://user-images.githubusercontent.com/64586749/210240986-b78bc1f7-221a-419a-8b2e-89e3afa216aa.jpg) I should have updatedd this earlier. Old version savefile with some crappy mod — I would have hated to look too. Anyway i think it's obvious that nothing is fixed.
saud2410 commented 1 year ago

Again, i think whole problem is because of movement scaling. I dunno how it works but it just not intuitive nor working properly.

yairm210 commented 1 year ago

I thought there were 2 movement bugs and we solved them Apparently there were 3, what fun And yes, this has to do with 'minimum movement'

yairm210 commented 1 year ago

There's always another edge case... 😫