dhruv-tailor / excelmakesbelhappypack

Combination of Governments Expanded, Missions Expanded and Ideas Variation
36 stars 15 forks source link

Fixes to Fort placement logic. #74

Closed SpiritBaker closed 4 years ago

SpiritBaker commented 4 years ago

Not sure if the second part was working at all.

stackpoint commented 4 years ago

Were there any problems you observed? Looked through it and the original code should work?

SpiritBaker commented 4 years ago

First part was working partially, the second part was not working at all. Still testing it to be 100% sure. But the fix looks better so far.

SpiritBaker commented 4 years ago

image

stackpoint commented 4 years ago

The goal was to encourage the AI to build the forts be lined up further apart [x][ ][ ][x] instead of [x][ ][x]. Maybe reducing that factor to 0.8 would be better than removing it altogether?

Also does this have any functionality compared to the almost identical modifier:

        modifier = {
            factor = 0.6
            any_neighbor_province = {
                OR = {
                    has_building = fort_15th
                    has_building = fort_16th
                    has_building = fort_17th
                    has_building = fort_18th
                }
            }
            NOT = { is_capital = yes }
        }
SpiritBaker commented 4 years ago

No, there's no check for owned provinces. I think it was the original intend.

stackpoint commented 4 years ago

Doesn't that mean all that code does is reduce the factor of the AI building a fort near another fort owned by someone else?

SpiritBaker commented 4 years ago

I think Forts right on the border are generally bad, due to how zone of control is implemented.

stackpoint commented 4 years ago

So is [x][ ][x] better than [x][ ][ ][x]? I actually don't know the logic for one or the other?

SpiritBaker commented 4 years ago

And my reasons for changing the first one. With a Fix, AI is deleting owned forts that border each other. Essentially I just added AND, kinda hard to see in a generated preview.

        modifier = {
            factor = 0
            any_neighbor_province = {
                AND = {
                    owned_by = ROOT
                    OR = {
                        has_building = fort_15th
                        has_building = fort_16th
                        has_building = fort_17th
                        has_building = fort_18th
                    }
                }
            }
            NOT = { is_capital = yes }          
        }
stackpoint commented 4 years ago

Shouldn't the AND be implied there? It's strange that it mattered there.

SpiritBaker commented 4 years ago

Was not sure myself, but apparently it's not.

any_ | Trigger | Requires valid trigger matches for one subscope in the set.

stackpoint commented 4 years ago

The set being the neighbor_provinces not the trigger conditional.

SpiritBaker commented 4 years ago

Also this, not sure what does this mean exactly

any_neighbor_province | any_neighbor_province = { } | Scopes to one province that shares a border (or sea zone?) with the current scope. | Multiple Subscopes No

stackpoint commented 4 years ago

Which part of that?

SpiritBaker commented 4 years ago

Multiple Subscopes No, part.

all_neighbor_province is what support multiple subscopes.

stackpoint commented 4 years ago

Actually it seems like the references to ROOT need to be replaced by FROM.

# FROM = owner # ROOT = province

stackpoint commented 4 years ago

Multiple subscopes refers to "Requires valid trigger matches for one subscope in the set."

stackpoint commented 4 years ago

So I made these edits based on your suggestions and got the AI to delete the 4 fort line in Constantinople region. I dozed off so I didn't see exactly when they did it but it happened all over, France, Portugal, etc.

00_buildings.txt Idea Variation Buildings.txt