Feature #588
closedUnhardcode tile claimability rules
Added by Alina Lenk 6 months ago. Updated 6 months ago.
0%
Description
Move rules for whether a tile can be claimed by a border source (based on terrain class, adjacency etc.) partially to ruleset effects. The goal is for anything hardcoded to be completely symmetrical in the terrain classes of the involved tiles and leave that distinction to ruleset-defined requirements. This will also include turning the "Claim_Ocean" and "Claim_Ocean_Limited" tech flags into user flags (and for most of the supplied rulesets, removing them).
Files
0003-Unhardcode-terrain-class-specific-border-claiming-ru.patch (46 KB) 0003-Unhardcode-terrain-class-specific-border-claiming-ru.patch | main | Alina Lenk, 05/11/2024 11:35 PM | |
0002-Unhardcode-terrain-class-specific-border-claiming-ru.patch (46.4 KB) 0002-Unhardcode-terrain-class-specific-border-claiming-ru.patch | main v2 | Alina Lenk, 05/13/2024 01:31 PM | |
0007-Unhardcode-terrain-class-specific-border-claiming-ru.patch (45.9 KB) 0007-Unhardcode-terrain-class-specific-border-claiming-ru.patch | main v3 | Alina Lenk, 05/16/2024 10:03 PM | |
0009-Unhardcode-terrain-class-specific-border-claiming-ru.patch (43.6 KB) 0009-Unhardcode-terrain-class-specific-border-claiming-ru.patch | main v4 | Alina Lenk, 05/22/2024 01:56 AM | |
0010-Unhardcode-terrain-class-specific-border-claiming-ru.patch (42.1 KB) 0010-Unhardcode-terrain-class-specific-border-claiming-ru.patch | main v5 | Alina Lenk, 05/24/2024 02:53 PM |
Updated by Alina Lenk 6 months ago
- File 0003-Unhardcode-terrain-class-specific-border-claiming-ru.patch 0003-Unhardcode-terrain-class-specific-border-claiming-ru.patch added
- Status changed from New to In Review
The way this patch works to allow access to all the previous behaviors (claim nothing, claim adjacent, claim continent / lakes and bays surrounded by the continent, claim anything), without half a dozen separate boolean effects, is to have thresholds (like the Casus_Belli_* effects).
Since an effect/requirement context can only hold a single tile, I've realized this using two separate effects (Tile_Claimable_From_Same and Tile_Claimable_From_Other) to evaluate against the target tile. The decision which tile to evaluate against was mostly made on a conceptual basis; the old behavior is phrased more in terms of "claim ocean (from wherever)" than "claim (whatever) from land".
Evaluating against the target tile does open the door to future changes, like making tiles with improvements (e.g. ocean tiles with fishing boats, bridges, burrow tubes etc.) claimable sooner.
There are also good arguments for instead evaluating against the border source, e.g. to let cities claim more than bases, or some bases claim more than others, or make it so coastal cities only claim sea tiles once they have a harbor. Hm. The more I think about it, the less sure I am that evaluating against the target is actually the more reasonable option. I'd appreciate any and all comments on this.
Alien ruleset: I decided to ditch the Claim_Ocean flag and directly use a tech requirement. If there were plans to give that flag to more than one tech, better to let me know now so we don't have to change it one way now and back later.
Stub ruleset: not sure about these changes. This preserves the old behavior, but that isn't really necessary for a minimal ruleset to be functional.
Finally, if there are any fundamental changes we want to make to what the rules can do before codifying them in a way ruleset authors depend upon, we should do them soon; possibly even before merging this, possibly after; definitely before S3_3-d3f, which is still a ways off, but the sooner, the better. (For instance, claiming parts another continent across a strait, or tiny islands in a city's coastal waters, or territorial waters along the coast in general; all of which would complicate the model, but some of which might be worthwhile.)
Updated by Marko Lindqvist 6 months ago
Haven't thought this much, but maybe you will: would it make sense to have this via enablers, as an internal action (we have those in 3.3. See Gain Veterancy and Escape) and no unit actor (so far all our enablers have a unit, but I have plans for other non-unit actions coming relatively soon anyway). That would give you both the "actor" and "target" requirements, as well as maybe being in line with how we implement things like these in the future, with the enablers.
Updated by Alina Lenk 6 months ago
I had thought about that, yeah; it would be a lot nicer. The problem with that (apart from the non-unit-actor thing, which is big enough in itself) is expressing the different levels of what's claimable. We'd either need a bunch of separate actions anyway (Claim Adjancent, Claim Continent etc.), or need a way to express whether actor and target are adjacent (currently only done via action range iirc), on the same continent, etc. Which, to be fair, sounds like something we'd want anyway, but it's not something we have currently.
Bottom line being, if we want to do it that way (which we probably do), there's a bunch of stuff we need to do first; so the question is whether to push this now and then probably change it again later, or scrap this for now until we can do it the better way.
Updated by Alina Lenk 6 months ago
- File 0002-Unhardcode-terrain-class-specific-border-claiming-ru.patch 0002-Unhardcode-terrain-class-specific-border-claiming-ru.patch added
Rebased patch on top of #590.
Updated by Alina Lenk 6 months ago
Updated by Alina Lenk 6 months ago
- File 0007-Unhardcode-terrain-class-specific-border-claiming-ru.patch 0007-Unhardcode-terrain-class-specific-border-claiming-ru.patch added
- Status changed from In Review to In Progress
- Target version changed from 3.3.0 to 3.3.0-d3f
Updated patch based on Feature #616: MaxDistanceSq requirement. Though I am officially pushing this back (unforeseen circumstances notwithstanding) until I've at least gotten it to the point where it can all be done via requirements; switching from effects to an internal action later is less of a hassle than switching away from a threshold-based solution again.
Updated by Alina Lenk 6 months ago
- Blocked by Feature #614: Tile relationship requirement added
- Blocked by Feature #616: MaxDistanceSq requirement added
- Blocked by Feature #629: Continent/ocean size requirement added
Updated by Alina Lenk 6 months ago
- Blocked by Feature #652: MaxRegionTiles requirement at C/Adjacent ranges added
Updated by Alina Lenk 6 months ago
- Blocked by Feature #654: TileRel requirement "Region Surrounded" added
Updated by Alina Lenk 6 months ago
- File 0009-Unhardcode-terrain-class-specific-border-claiming-ru.patch 0009-Unhardcode-terrain-class-specific-border-claiming-ru.patch added
Updated patch: All requirements are now unhardcoded. I've also gotten rid of the added effects to the stub ruleset, given that they're not necessary and that ruleset doesn't have any border sources with positive radius anyway.
I'm still deliberating whether to merge it like this, or add a "Same Terrain Class" TileRel requirement to need just one effect type (and streamline the implementation in some of the rulesets), or wait for non-unit-actor internal actions.
Updated by Alina Lenk 6 months ago
- Blocked by Feature #678: TileRel requirement "Same Terrain Class" added
Updated by Alina Lenk 6 months ago
- File 0010-Unhardcode-terrain-class-specific-border-claiming-ru.patch 0010-Unhardcode-terrain-class-specific-border-claiming-ru.patch added
- Status changed from In Progress to In Review
Alina Lenk wrote in #note-10:
I'm still deliberating whether to merge it like this, or add a "Same Terrain Class" TileRel requirement to need just one effect type (and streamline the implementation in some of the rulesets)
Did that. Updated patch is going to be the final one (I think); this might be migrated to an internal action later, but I'm not doing that now.