Unciv icon indicating copy to clipboard operation
Unciv copied to clipboard

AI cannot buy unbuildable constructions

Open SeventhM opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Game Version

4.9.2

Describe the bug

Reporting a bug someone on discord noticed:

AIs cannot buy units or buildings that are purchasable via a stat if it has the unbuildable unique. This is because the AI cannot purchase objects unless it is currently building it. See here. Funny side effect of how the function is written is it can only ever purchase one object a turn per city. Also it cannot purchase with anything except gold unless you talk about hardcoded unit categories

Seems like the AI purchase logic in general needs fixing up

Steps to Reproduce

N/A

Expected Behavior

I will pretend the answer is "N/A"

Screenshots

No response

Link to save file

No response

Operating System

Android

Additional Information

No response

SeventhM avatar Nov 25 '23 23:11 SeventhM

I will pretend the answer is 42

Good catch - except I expect most of the original coders were aware they were building better-than-nothing limited approaches, only the big picture got lost...?

Anyway, go ahead, we know you're a proficient coder.

SomeTroglodyte avatar Nov 26 '23 00:11 SomeTroglodyte

we know you're a proficient coder

Yeah, but I'm not much of an AI dev. I'd probably copy over some of the build construction logic and call it a day. I know Tuvus has been making adjustments to the AI, so this issue is more making note of something to fix than just a setup for me to fix

SeventhM avatar Nov 26 '23 00:11 SeventhM

not much of an AI dev

Exactly, me neither. And you might just as well have added a @ to spam them right away... I reined myself in on that.

SomeTroglodyte avatar Nov 26 '23 01:11 SomeTroglodyte

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Mar 14 '24 20:03 github-actions[bot]

Removing Stale label, but only as an aide to #11264

SeventhM avatar Mar 19 '24 03:03 SeventhM

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Jun 18 '24 03:06 github-actions[bot]

I am unstaling this since it is important and is relatively high on my list. I'll see when I can get to it.

tuvus avatar Jun 18 '24 23:06 tuvus