Territory effects that apply only to some borders of a territory
One feature that TripleA is missing is the ability to have a territory effect apply to only one border/connection of a territory. That is, units entering from that direction will have that effect applied, but not units entering from a different one.
The original Imperialism 1974 board game has this for Mountains and Rivers: https://boardgamegeek.com/image/1072128/imperialism
Another example of this is the History of the World board game:
I'm sure there are others - feel free to share if there are examples - or if it's something you'd use in a TripleA map you're working on.
Since I've been working on Imperialism 1974, I've been thinking about the best way to implement this in the engine.
One option is to add a new ConnectionAttachment (doesn't currently exist), but I think this is actually not flexible enough to support something like the History of the World map above, where you may need to have the effect applied when entering through a connection, but not leaving through it.
Thinking about this, maybe the easiest way to fit this into the current engine is to expand TerritoryAttachment and add another option like
So you could specify something like:
<attachment name="territoryAttachment" attachTo="T1" javaClass="TerritoryAttachment" type="territory"> <option name="production" value="2"/> <option name="territoryEffect" value="forest"/> <option name="directionalTerritoryEffect" value="T2:mountain"/> </attachment>
So the above would specify that entering from T2 to T1 would apply the "mountain" territory effect to units. If you want it bidirectional, you would specify the same on T2.
(And when we switch to a more structured XML syntax, they can be proper attributes instead of packing two things separated by : as the value).
Besides the syntax, we'd need to teach the engine to track which territory a unit entered by for the purposes of figuring out which TerritoryEffects apply to that unit. Would probably be a bit of work, but seems doable in general. If you just spawn units there in edit mode or via trigger, then no directional territory effects would be applied.
Thoughts? Objections? I can look at implementing something like this if people agree with the proposal.
@myrd Not sure if this would scale well and could be error prone as well.
Is the issue that there should be no territory effect if say for example a unit is already in mountains and is entering mountains, but if the territory type change, then there should be a territory effect?
No, it's not intended to cover a "territory change" (just like currently going from mountains to mountains still applies the effect).
It's intended to cover the case where an attack would pass through a mountain and therefore suffer penalties - but the mountain is only on one side of the territory (so an attack from the other side doesn't suffer).
As for scalability, I think there shouldn't be a problem - it's just extra bookkeeping - i.e. we'd need to keep around the Route each unit arrived via all the way to the battle code (well, really just the
arrivingFromterritory). The battle code then just has a
Map<Territory /* fromTerritory */, Collection<TerritoryEffects>and for each unit, the appropriate effects are applied based on its
arrivingFromterritory. So it's just a matter of plumbing.
@myrd Regarding scalability concerns, my concern is more for getting the configuration correct and the number of territory connections where this would need to be specified.
I think this probably would be better attached to the territory and/or territory connection rather than territory effects.
There is a bigger ongoing conversation that is a bit scattered regarding the 1.9 map XML syntax and how to transition that. Overall I'm a bit tempted to say that the 1.9 XML spec should be frozen in favor of incorporating such changes into a future spec. So some apologies for being a bit initially negative to this idea. I think with some updated XML syntax for future engines this perhaps could be done quite a bit more cleanly. Having a list somewhere of things we would want to support would be valuable and we could help with re-formulating a better and more expressive XML syntax.
I might be able to use it. Currently I have Landmines that only defend on one TTy border. i made different colored LMs and use edit to make it work. It wouldn't solve all the LM issues but it might help if it can tell which units attack from which border.
I truly hope this feature gets implemented: it is critical to represent things like sea-borne invasions, rivers and mountains, that are usually features on the border between two zones rather than all around a single one.
Another similar thing would be having units defending only from invasions from a specific connection, think about the Maginot line or the Atlantic wall: when you build bunkers, these bunkers should be able to hit units only coming from a specific other zone adjacent to the zone where they are and this zone should be chosen in the moment the bunkers are placed.
There is a 'connectionAttachment' already, 'canalAttachment'. Maybe it would be easer to expand this then create something new.
@wc_sumpton I did think of this, but canal attachment has technically 4 territories it affects - the two sea zones and the two land zones.
So it's a bit of a different model. We could make the semantics such that the land zones are optional and allow the sea zones to be land zones, but it feels like that's changing too much to reuse. Especially since then we'd need to duplicate the properties territory effects have.
Although as an aside, territory effects already duplicate some properties that support attachments have, but are more limited. Perhaps for a more flexible system, it would be better to reuse support attachments for them too (but that would be an incompatible change).
I understand that 'canalAttachment' is used to connect sea zones with land zone restrictions. But it can also be used to connect land zones.
One of the first modifications could be to allow the option "landTerritories" to accept sea zone (this might already be allowed), and the uses of a key word like "None".
Then all that would need to be done is allow the use of 'territoryEffect' be attached to the 'canalAttachment'. Not simple I understand.
Also, a change to the 'territoryEffect' to add a limit to the number of combat rounds.
These are my thoughts.