Terrain Effects for movement
@LaFayette While I think we could look at the overall usage of attachments and how the XML is structured that's probably better as a separate thread as territoryEffectAttachments already exist and I'm just looking to add a new option to them here.
As @wc_sumpton points out, I recently added
variablesin order to specify lists of various XML elements to avoid having to copy/paste them and manage updating them in multiple places.
attachmentsare kind of separate things. There are
supportAttachmentfor example that aren't directly tied to any specific
delegate. I believe the reason for
attachmentsis because the XML is parsed just a single time through so it defines most of the various elements first then creates the attachments to them so it can validate different attachment options to ensure they reference valid elements. This could potentially be changed and parsing updated but would be a significant update.
I think it would be best to take some of these points to a separate thread.
@Cernel I haven't fully decided if I'm going to limit negative modifiers to never allow it to be less than or equal to 0 movement cost. But my general thought is to allow any values and map makers will just need to ensure they don't do ridiculous things like have 2 adjacent territories that both give movement. I decided to make it a modifier rather than set it directly so you could have multiple territory effects combine together in a more logical way. For example, if I have forest cost +1 and mountain cost +1 if I had them define "2" then combining would seem to be "4" instead of "3". Its also easier as if in the future you combine territory effects and units then having them all as modifiers makes more sense then setting the cost directly.
@Cernel I haven't fully decided if I'm going to limit negative modifiers to never allow it to be less than or equal to 0 movement cost. But my general thought is to allow any values and map makers will just need to ensure they don't do ridiculous things like have 2 adjacent territories that both give movement.
I certainly agree with this. However, I think it may be worth adding a little tweak specifically for movement increase: a cap.
The case of decreasing movement is already fully handled by the fact that the unit can never go below 0 remaining movement (the point at which it stops).
The issue with increasing movement is that the unit doesn't have a maximum movement it can hit. This is true also for giving movement at start phase, of course, but it is not an issue there.
My suggestion is the movement increase from territory effects be capped to the basic movement of the unit (this would need a line in pos2, of course), and if the unit already has a bigger remaining movement than its basis, that remains the same. Practically, differently from units giving movement, territory effects would be only able to restore movement abilities, never to increase them.
Meaning, for example, if we have a territory with modifier -3 (gives +2 movement for entering):
- If a unit with 1 movement left and 4 basic movement enters it, the remaining movement is increased to 3.
- If a unit with 3 movement left and 4 basic movement enters it, the remaining movement is increased to 4 (not to 5).
- If a unit with 4 movement left and 4 basic movement enters it, the remaining movement remains 4 (instead of increasing to 6).
- If a unit with 5 movement left and 4 basic movement (the unit was boosted by something like an airport) enters it, the remaining movement remains 5 (instead of increasing to 7).
What I have in mind, that this feature may support, is the air ferry routes:
A realism issue of TripleA games is that air movement is a single fly, that it is usual something that takes a few hours of real time, while turns are easily over 1 month. For this reason, ferrying air units (something that you should be able to unlimitedly do across all over the world, if 1 turn is 1 month or more) cannot be represented. Beside making a map so extrmely detailed that every turn is representing 1 day (which would imply over 10,000 land territories and a playtime of hundreds of rounds), I see this may be achieved by having all eligible land territories giving aircrafts movement upon entering, but only as long as the remaining movement cannot go over a maximum (that would be equal to the distance the aircraft can manage to achieve in a single fly, typically flying over sea zones).
I decided to make it a modifier rather than set it directly so you could have multiple territory effects combine together in a more logical way. For example, if I have forest cost +1 and mountain cost +1 if I had them define "2" then combining would seem to be "4" instead of "3". Its also easier as if in the future you combine territory effects and units then having them all as modifiers makes more sense then setting the cost directly.
Albeit this would be inconsistent with combat bonuses, it may be advisable setting it at the highest amongst territory effects, rather than summing them up. If you think at the matter in term of them being choke points, only the smallest one should matter. Question for example would be if I have a forested mountain, should the movement be as slow as the worst between mountain and forest, or summing them up? Or if I'm representing swamps by having both forests and marshes in those territories (instead of having a swamp territory effect), should the swamp being as bad as the worst between a forest and a marsh or the sum of both (likely both increasing movement consumption over the default, if the default is representing open plains). I'm not really lobbying here, but probably the mapmakers more interested in multiple territory effects should consider the matter.
@Cernel Its an interesting idea. Though my general feel for trying to implement something like that would actually be using the units give movement and adding a requirement for getting that movement on conditions in the destination. So you essentially have "airports" which give movement but only if moving to another airport (this is also the same case for TWW where AA guns are only supposed to get +1 movement when loading onto transports).
I would be very disappointed if the movement bonus from territory effects be capped according to the basic movement of the unit. Then it would not be possible to have movement boosting territories like "roads" giving bonus on a mostly roadless map. Or "flat plains" giving cavalry bonus in a mixed territory map. "Hyperlanes" or "Jump Gate" territories giving movement bonus to spacecraft etc. Territories should be able to boost movement, just like naval base and air base.
@Frostion No problem, I'm not strong on that proposal. I just wonder if you either:
1- realize that "movement boosting territories like "roads"", if we are talking about territories that increase the remaining movement of units entering them, would need never to exist in nearby territories (that doesn't make any sense for roads), or they would give units virtually infinite movement, for going outside roads as well.
2- are rather thinking to cases like -0.5 bonuses, that would be not impacted at all by any max basic movement cap, as they would still be reducing remaining movement, albeit slowly so.
Since roads would be most likely territories one next to the others, I think you are being confused, and are actually thinking about something like point 2, that is not itself impacted by the presence or absence of any basic movement caps.
@redrum Territory effects are certainly not the best way for handling ferry routes, but this would be an additional feature request, obviously. Of course, normal airports giving +1 movements don't really make any sense (shocker). The movement of an aircraft is just given by his own characteristics at full fuel (comprising eventually detachable tanks) and airports do nothing to increase or decrease it. They are just needed to take off and land safely, but back in ww2 aircrafts needed really little in that way (whatever dry strip of plain land works), unless you are trying to build one in Greenland.
@redrum On this matter, a question may be if movement 0 (both basic or remaining) units should be able to move into a territory requiring 0 movement cost or giving any. If yes, this may support loading things like basic movement 0 materials into transports, as you could just give a territory effects giving -1 to materials in all "sea" territories (or the ones you want).
@Cernel Tho this would be just another workaround. Movement 0 units should just be always allowed to load onto ships, in my opinion, as long as they didn't move yet (and, of course, have an affordable transport cost assigned). This should be really something basic, but I'm going off topic.
@Frostion I don't plan to put any caps at this point. That being said here are some of my thoughts on some of the things you mention:
Roads/Flat Plains (I'd use a negative movementCostModifier so it costs only fractions of a move point)
<attachment name="territoryEffectAttachment" attachTo="road" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="infantry:artillery:tank" count="-0.5"/> </attachment> <attachment name="territoryEffectAttachment" attachTo="flatPlains" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="cavalry" count="-0.5"/> </attachment>
So say an infantry could then move 2 territories with roads instead of the normal 1 since it would then cost 0.5 per territory.
Hyperlanes/Jump Gate (I'd make them probably just connect together and have 0 movement cost)
<attachment name="territoryEffectAttachment" attachTo="hyperlanes" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="spacecraft" count="-1"/> </attachment>
@Cernel Yeah, the having 0 movement left and still moving to a territory with 0 cost or that gives movement is an interesting point that I'll have to think about. I think ideally they can but I'll have to see how easy/difficult that is to achieve.
@Frostion I don't plan to put any caps at this point.
Well, if you'll ever reconsider this, an easily agreeable cap (nobody can rationally be against, I suppose) is to have a cap equal to the max basic movement of the unit plus the opposite of the modifier minus 1.
So, for example, in my previous example of a unit having base movement 4 and the territory effect being -3, the cap would be at 6 (=4-(-3)-1). This would just assure from the bouncing to infinite movement practice (as likely eventually some mapmaker will overlook it, and make a map having this possibility).
Not trying to keep fighting a decided item, but I just hope also @Frostion and everyone now realize that, with movement cost paid/received upon entering, "Hyperlanes" or "Jump Gate" would make no sense, if they would be stuff that allows you to generally move faster to anywhere else, as you would get the movement if you enter that territory, but not if you start your turn in that territory (even if you can go out and in, to get the bonus, that still means that starting right where the Hype is equals being farther away from using it than starting in a nearby territory). This is a clear example of why charging upon exiting is overall more realistic, albeit, as I said, I agree that charging upon entering is more intuitive, at least when the effect reduces your movement, as also demonstrated by the fact that everyone else but me assumes that is the best practice.
<attachment name="territoryEffectAttachment" attachTo="mountain" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="armor" count="2"/> </attachment>
Then the armor can only enter a mountain territory from an adjacent territory. But if the count is set at a range:
<attachment name="territoryEffectAttachment" attachTo="mountain" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="armor" count="2-1"/> </attachment>
Where '2' is the normal entry cost but if the armor still has 1 movement left it could still enter the mountain territory.
@wc_sumpton But, then, the armour would be completely unaffected by the mountains. It could enter the mountains from 2 territories afar and the next turn it could leave them with its full 2 movement. Is this what you want? Not opposing your suggestion, just wondering.
@Cernel Yes, as long as the first territory moved into was not another mountain territory. If the first move were to enter the mountain territory the cost would be 2 and the armor would not be able to continue movement.
I understand what you are saying, my suggestion is just an option for the map makers. If the mountain territory is set to '2' and not '2-1' then the armor would only be able to enter as its only move.
Hope this help explain my suggestion.
@wc_sumpton I'm thinking about whether units can enter territories when they have remaining movement points but not enough for that territory. My thought is to have an XML property which controls whether they can or can't rather than doing a range on each individual territory effect. So something like:
<property name="Units Can Enter Territories With Higher Movement Costs Then Remaining Moves" value="false" editable="true"> <boolean/> </property>
@redrum This property would indirectly allow charging upon exiting. You just need to have in each territory a unit giving (at start turn) the exact same modifiers as given by the territory effects, then the practical behaviour would be exactly the same as charging upon exiting.
I indirectly agree to this.
@redrum I also think this would be good for defining territories you cannot move through, but you can move into. Sort of no blitz territories, except that it applies also to non combat movement. Currently you either have fully passable or fully impassable territories, while there is not an option for a territory to be accessible but not transitable. So, yeah, I think this is a good property to have. I can think of some uses, also for triggering territory effects during the course of the game.
And it starts to become a reality...
<attachment name="territoryEffectAttachment" attachTo="Mountain" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="germanStrategicBomber" count="5"/> </attachment>
Showing that a strat bomber that has 6 movement can't enter Austria as it would cost: 1 first move + 6 (1 base + 5 mountain) = 7.
@redrum Please clarify if movement value 0 and remaining movement 0 units can enter a movement cost 0 or less territory, or, probably better, have a property for defining it. This is quite important to settle a matter.
@Cernel I'm still deciding if its going to be feasible to allow 0 movement left units to continue to move. Due to how units work today, once they hit 0 movement they can't move any more.
@redrum My suggestion is having a property for it (could be removed if we sort out we really want one or the other). If not, I tend to think that this can be bundled with the property for entering with partial movement left. If that is true, then you can enter 0 with 0, otherwise you cannot.
And allowing bombers to have free movement into urban territories:
<attachment name="territoryEffectAttachment" attachTo="Urban" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="germanStrategicBomber" count="-1"/> </attachment>
Bomber with 0 movement left can move to a urban territory
Bomber with 0 movement left can't move to a non-urban territory
@Cernel I think I'm going to always allow units with 0 movement to move into adjacent territories that have movement cost of 0. I think that is the most natural approach and the way route finding is done, it would cause weirdness if you couldn't. Example if we allowed using all my movement points to move next to a territory with 0 movement cost and then not allowing moving into it in a separate move vs moving to the 0 movement cost territory in the original route would be allowed. This means if you have 0 movement cost territories, then 0 move units could move into them if they are adjacent. Generally, 0 movement cost or negative movement cost will be possible but in most cases isn't advisable unless you are essentially considering those territories as kind of "part of certain adjacent territories" or maybe like a wormhole.
<attachment name="territoryEffectAttachment" attachTo="Urban" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="germanAntiAirGun" count="-1"/> </attachment>