Multiple Canals Between 2 Sea Zones

classic Classic list List threaded Threaded
71 messages Options
1234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiple Canals Between 2 Sea Zones

redrum
Administrator
So I'm planning to make some fixes to how canals work as currently in WaW and TRS they don't function properly.

Currently, you must own all canals between 2 sea zones in order to move between them. This is how the code reads in the engine as well how it functions in WaW and TRS: https://github.com/triplea-game/triplea/blob/master/src/games/strategy/triplea/delegate/MoveValidator.java#L1424

WaW and TRS are meant to allow movement if *any* canal is owned not *all* between 2 sea zones. This makes sense as well since if you wanted to own all of them then you could just define it as a single canal with more than 2 territories.

So I think we need an engine change to properly fix this issue. The question is does it make sense to have both a AND (need all to own all canals) and OR (own any canals) option? I don't believe the first option is really needed since you could just create a single canal with more than 2 territories to cover this case.

So my proposal is to switch canal logic to check that any 1 canal is controlled between 2 territories instead of checking that all canals are controlled in order to move between the territories.

I'd like to get feedback on whether there are any cases this doesn't cover or if there is anything else that needs updated around canals.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

beelee
"or if there is anything else that needs updated around canals."  

As long as you're in canal mode, neutrals can't pass through. Maybe this is already possible with user actions IDK. As always disregard if not relevant.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

aaalafayette
Administrator
In reply to this post by redrum
With some dirty bash-fu, below is a list of potential maps that could be impacted. Effectively the bash line counts duplicate  "attatchTo" values after finding "CanalAttachment" lines, and then filters out anything that is a "1" count, leaving only duplicates. Mileage may vary, but each territory listed in this report should have as many canals as listed. For exmaple, 2 canals attached to sz 19 in ColdWarAsia 1948.

It would be ideal if this report could count bi-directional connection counts, alas it does stop short of that ;)

Bottom line, if you check all the maps listed below, you'll know the full list of maps that you could be impacting:



dan@dan-desk:~/work/maps$ for i in $(find . -type f -name "*xml"); do echo -e "\n\n$i";  grep "CanalAttachment" $i  | egrep -o "attatchTo=\".*javaClass"  | sort | uniq -c | grep -v "^ *1"; done;



./cold_war_asia1948/map/games/ColdWarAsia1948.xml
      2 attatchTo="Sea Zone 19" javaClass


./cold_war_asia1948/map/games/ColdWarAsia1948Japan.xml
      2 attatchTo="Sea Zone 19" javaClass


./classic_variations/map/games/four_if_by_sea.xml
      2 attatchTo="Carribean Sea Zone" javaClass
      2 attatchTo="East Mediteranean Sea Zone" javaClass
      2 attatchTo="Red Sea Zone" javaClass
      2 attatchTo="West Panama Sea Zone" javaClass


./civil_war/map/games/Civil_War_Eastern_Campaigns.xml
      3 attatchTo="Baltimore Station" javaClass
      2 attatchTo="Chambersburg Station" javaClass
      2 attatchTo="Culpeper Station" javaClass
      3 attatchTo="Gordonsville Station" javaClass
      3 attatchTo="Hanover Junction Station" javaClass
      2 attatchTo="Harrisburg Station" javaClass
      2 attatchTo="Manassas Station" javaClass
      2 attatchTo="Mechanicsville Station" javaClass
      3 attatchTo="Petersburg Station" javaClass
      2 attatchTo="Strasburg Station" javaClass
      2 attatchTo="Washington Station" javaClass
      3 attatchTo="York Station" javaClass


./civil_war/map/games/Civil_War.xml
      2 attatchTo="Aberdeen Station" javaClass
      3 attatchTo="Allentown Station" javaClass
      3 attatchTo="Alton Station" javaClass
      4 attatchTo="Andersen Station" javaClass
:
:
      3 attatchTo="Warsaw Station" javaClass
      2 attatchTo="Washington Station" javaClass
      2 attatchTo="Wilmington Station" javaClass
      2 attatchTo="Wooster Station" javaClass
      2 attatchTo="Yazoo River Lower" javaClass
      3 attatchTo="York Station" javaClass
      3 attatchTo="Zanesville Station" javaClass



./blue_vs_gray/map/games/blue_vs_gray.xml
      2 attatchTo="Naval Assault" javaClass


./large_middle_earth/map/games/Large_Middle_Earth.xml
      2 attatchTo="sz Baranduin 3" javaClass
      2 attatchTo="sz Lower Anduin 3" javaClass
      2 attatchTo="sz Upper Anduin 5" javaClass


./total_world_war/map/games/Total_World_War_Dec1941.xml
      2 attatchTo="127 Sea Zone" javaClass
      2 attatchTo="128 Sea Zone" javaClass
      2 attatchTo="26 Sea Zone" javaClass
      2 attatchTo="27 Sea Zone" javaClass


./world_war_ii_v6_1941/map/games/WW2v6_1941.xml
      2 attatchTo="17 Sea Zone" javaClass


./camp_david/map/games/1948_Arab-Israeli_War.xml
      2 attatchTo="3 Sea Zone" javaClass
      3 attatchTo="Suez Canal" javaClass


./camp_david/map/games/1973_Yom_Kippur_War.xml
      2 attatchTo="3 Sea Zone" javaClass
      3 attatchTo="Suez Canal" javaClass


./camp_david/map/games/1956_Suez_Crisis.xml
      2 attatchTo="3 Sea Zone" javaClass
      3 attatchTo="Suez Canal" javaClass


./camp_david/map/games/1967_Six-Day_War.xml
      2 attatchTo="3 Sea Zone" javaClass
      3 attatchTo="Suez Canal" javaClass

./ancient_times/map/games/Ancient_Times.xml
      2 attatchTo="sz 54" javaClass
      2 attatchTo="sz 55" javaClass

./world_war_ii_v5_1942/map/games/WW2v5_1942_2nd.xml
      2 attatchTo="17 Sea Zone" javaClass
      2 attatchTo="18 Sea Zone" javaClass

./world_at_war/map/games/World_At_War_1940.xml
      3 attatchTo="sz105" javaClass
      3 attatchTo="sz108" javaClass
      4 attatchTo="sz109" javaClass
      4 attatchTo="sz110" javaClass
      4 attatchTo="sz72" javaClass
      3 attatchTo="sz73" javaClass
      5 attatchTo="sz74" javaClass
      5 attatchTo="sz83" javaClass


./world_at_war/map/games/World_At_War.xml
      3 attatchTo="sz105" javaClass
      3 attatchTo="sz108" javaClass
      4 attatchTo="sz109" javaClass
      4 attatchTo="sz110" javaClass
      4 attatchTo="sz72" javaClass
      3 attatchTo="sz73" javaClass
      5 attatchTo="sz74" javaClass
      5 attatchTo="sz83" javaClass


./the_rising_sun/map/games/The_Rising_Sun.xml
      3 attatchTo="sz42" javaClass
      2 attatchTo="sz46" javaClass
      2 attatchTo="sz48" javaClass
      3 attatchTo="sz50" javaClass
      3 attatchTo="sz57" javaClass
      3 attatchTo="sz58" javaClass
      5 attatchTo="sz59" javaClass
      2 attatchTo="sz60" javaClass
      3 attatchTo="sz81" javaClass



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
In reply to this post by redrum
http://tripleadev.1671093.n2.nabble.com/WORLD-AT-WAR-tp5862407p7590413.html

Cernel wrote
1) I would ask Veqryn why the current behaviour has been set as having the AND thing (maybe be was a SB decision back in v1 tho), instead of OR, and if this is functional to something at all, or it can be just simply recreated by summing up all AND canals in only 1 canal needing ownership of all previous stuff. Also, better to make sure that when Veqryn said, in this topic:
Veqryn wrote
no, this is a problem with the map xml

the engine can currently handle multiple canals, I've made sure of it

someone just needs to update the canal coding in the xml to have different names for each of the attachments that are on the same territory
(see pos2 for example)
He was wrong and just misunderstood how canals were supposed to work.

2) Canals have many other features, aside from just being regular v1 canals; for example, you could have 2 serial canals, you need both to pass, but with different settings for each one. For example, you could have first canal related to territory A only that doesn't allow subs to pass, and the second one related to territory A and B, but allowing subs to pass, so you can't just bundle them all in a single canal. For example, I could code 2 serial canals in the gibraltar strait as to enforce the behaviour that only subs can pass if only gibraltar is enemy, while nothing can pass if both gibraltar and morocco are enemy.

3) As to if there are any maps that will be broken, by changing AND to OR, and if it will be possible or not to correct them, I don't know, but I play only a very few of all maps TA have.

4) In general, when things are not sure, keeping the current behaviour as default is better.

5) In general, I believe having both options AND and OR is better than only one of the 2, as it gives mapmakers more freedom (and probably there may be some cool possibilities that the current AND behaviour allows, we are not thinking about).

6) If it would not be feasible to have the options of setting AND or OR (maybe as a property, to keep it simple), then my guess is that OR is better, both for allowing for supporting WaW (a map I personally dislike, but that it is in High Quality and much popular), expecially for the Artificial Intelligence, and because the OR thing is going to probably allow for more stuff (would also allow for setting canals that you can block only with both sides) than the AND thing. So, if it would not be possible having the option of setting the AND or the OR in the map (first best), I guess I would vote for the OR.

7) The engine changes should be tested as being friendly with the case of partially inter-lapsing canals, meaning canals sharing one sea zone; one example and test mod is the v3 official rule for the Dardanelles strait, that I've enforched in a mod (on request), you can find here:
http://tripleadev.1671093.n2.nabble.com/WW2v3-1941-Dardanelles-Closed-to-Sea-Movement-tp7588683p7588684.html
As you can see, here you have the situation of having a canal between 14 and 16, and a canal between 15 and 16; it should be no problem, cause you have only 1 canal for each connection, but saying just in case (here you can't go out of 16 if both canals are not friendly).

8) I'm really not the good person for talking about WaW, and just got in since I saw there was much misunderstandings goin on (we both guessed ice was saying the opposite of what he was, and I saw that the notes were saying you needed only 1 canal, while you wanted to change as all canals needed, which finally ice confirmed as being the right interpretation of the Notes, as I was saying initially). Since I've never played WaW, probably you need to join lobby and chat with some veteran players, cause they very rarely talk in forum (but will be very upset if WaW changes in some way different from what they play). ice is good, but talking with only 1 person might cause misunderstandings (as here you (and me) were initially thinking that ice was supporting the all canals thing you wanted to set as definitive, since he said canals work currently fine (which is not the case)).
To sum up, I believe that the change from AND to OR is neat, because I guess OR opens up more mapmaking possibilities than AND, and it is currently functional to the most poular WaW and tRS maps (I don't like them, but doesn't matter). But even better would be keeping both AND and OR, and even better being able to set a minimum number of canals to own, from 0 to all, with all=AND being -1.

While OR is better than AND, AND has its uselfulness too, at least for future mapmaking, so I would suggest keeping both options, or even a settable number of mimimum canals to own, if feasible.

If I have to make 1 more example, I could make a land territory canal (a canal that restricts movement between land territories, not sea zones) for going from the territory A to the territory B, with a sea zone C in between, saying that air units only can always go from A to B in 1 move, while light units can land cross the channel only if A and B are both friendly, while heavy units need that A and B and also the sea zone C are friendly (let's assume the first ones can ford and the second one need a bridge pontoon that can be destroyed by enemy ships, or whatever). In order to achieve this, I need to make 2 canals restricting movement between A and B, the first canal just always impeding movement to all units but air ones, if any of A and B are not friendly, and the second one impeding movement of all units but air and not-light ones, if A, B and C are not friendly. To implement such a sensible rule (fording rivers/straits with freedom for air units, friendly shores needed for light units, and friendly shores plus friendly sea needed for heavy units), the current AND behaviour is needed.
In such a case, I would need an AND relationship.
In case you are wondering, I've no short term plans of using either AND or OR myself, nor I know of any maps that need the current AND relationship not being changed to OR.

Redrum is correct that for any simple AND canals, restricting movement all to the same stuff (normally, everything but air units), current multiple canals with AND can be easily substituted with a single canal, with all territories summed up.

While we are at it, I also suggest to allow canals having no territory requirement at all, and in this case being always impassable to some units and never to others (default all units but air ones, as normal); this would be an interesting feature it is currently possible to have only with simple hacks (like using a box territory for it, unreachable and assigned to Neutral). This would be, for example, useful to a map in which there are some units that can always ford rivers and some other units that can never do it (for example, anphibious tanks; the germans had a few of them in WW2 as well). Not a big issue, anyway, because you can just make a hacky box territory for it, as I said.

Anyway, if it would be really unfeasible to just expand what canals can currently do, without also limiting them, I guess OR is better than AND for them.

Beside supporting WaW and tRS style canals, having an OR relationship would also allow for having straits working as to blocking sea movement only when both sides being hostile (think about a medieval boom), by making two regular canals between the same two sea zones, each one assigned only to one or the other of the relative two land territories beside the sea channel. I remember such a feature was asked in the past, by some mapmakers, and it is currently possible to implement such a strait rule only by heavily hacking with triggers changing raw data under conditions.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
This post was updated on .
In reply to this post by aaalafayette
The curious presence of v5 on the list is only due to the presence of the following comment:

                                <attatchment name="canalAttatchmentTurkish_Straits" attatchTo="17 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>
                                <attatchment name="canalAttatchmentTurkish_Straits" attatchTo="18 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>

Which is actually a wrong way to make the Turkish_Straits. It should be something like (didn't test):

                                <attatchment name="canalAttatchmentTurkish_Straits_1" attatchTo="15 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits 1"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>
                                <attatchment name="canalAttatchmentTurkish_Straits_1" attatchTo="16 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits 1"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>
                                <attatchment name="canalAttatchmentTurkish_Straits_2" attatchTo="16 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits 2"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>
                                <attatchment name="canalAttatchmentTurkish_Straits_2" attatchTo="17 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                                                <option name="canalName" value="Turkish Straits 2"/>
                                                <option name="landTerritories" value="Turkey"/>
                                </attatchment>

I'd suggest redo the stuff excluding what's commented out, if possible.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
In reply to this post by redrum
I have no skills, so what I'm just saying may as well be just a load of nonsense, but what about this: adding the possibility of having multiple differently named canalAttatchments sharing the same "canalName". If the "canalName" is the same, the different canals are in a OR relationship (parallel canals), if the "canalName" is different, the different canals are in a AND relationship (serial canals).

In this case, the current WaW would work same as now (AND), as it is coded; for example this serie of sz74 - sz83 canals:

                <attatchment name="canalAttatchment13" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal13"/>
                        <option name="landTerritories" value="S.Guinea:New Britain"/>
                </attatchment>
                <attatchment name="canalAttatchment13" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal13"/>
                        <option name="landTerritories" value="S.Guinea:New Britain"/>
                </attatchment>

                <attatchment name="canalAttatchment14" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal14"/>
                        <option name="landTerritories" value="New Britain:Samo"/>
                </attatchment>
                <attatchment name="canalAttatchment14" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal14"/>
                        <option name="landTerritories" value="New Britain:Samo"/>
                </attatchment>

                <attatchment name="canalAttatchment15" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal15"/>
                        <option name="landTerritories" value="Samo:Boku"/>
                </attatchment>
                <attatchment name="canalAttatchment15" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal15"/>
                        <option name="landTerritories" value="Samo:Boku"/>
                </attatchment>

                <attatchment name="canalAttatchment16" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal16"/>
                        <option name="landTerritories" value="Boku:Guadacanal"/>
                </attatchment>
                <attatchment name="canalAttatchment16" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal16"/>
                        <option name="landTerritories" value="Boku:Guadacanal"/>
                </attatchment>

                <attatchment name="canalAttatchment17" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal17"/>
                        <option name="landTerritories" value="Guadacanal:Cristobal"/>
                </attatchment>
                <attatchment name="canalAttatchment17" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal17"/>
                        <option name="landTerritories" value="Guadacanal:Cristobal"/>
                </attatchment>
would be in a "AND" relationship, still (nothing changes from now).

To have them in an "OR" relationship, we would just need giving all the same "canalName", for example:

                <attatchment name="canalAttatchment13" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="S.Guinea:New Britain"/>
                </attatchment>
                <attatchment name="canalAttatchment13" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="S.Guinea:New Britain"/>
                </attatchment>

                <attatchment name="canalAttatchment14" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="New Britain:Samo"/>
                </attatchment>
                <attatchment name="canalAttatchment14" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="New Britain:Samo"/>
                </attatchment>

                <attatchment name="canalAttatchment15" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Samo:Boku"/>
                </attatchment>
                <attatchment name="canalAttatchment15" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Samo:Boku"/>
                </attatchment>

                <attatchment name="canalAttatchment16" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Boku:Guadacanal"/>
                </attatchment>
                <attatchment name="canalAttatchment16" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Boku:Guadacanal"/>
                </attatchment>

                <attatchment name="canalAttatchment17" attatchTo="sz74" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Guadacanal:Cristobal"/>
                </attatchment>
                <attatchment name="canalAttatchment17" attatchTo="sz83" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal_74_83"/>
                        <option name="landTerritories" value="Guadacanal:Cristobal"/>
                </attatchment>
The only hard restriction left wold be that different canals need to have different naming after the "canalAttatchment", but they can share the same "canalName", if they want to be in a OR relationship.

Such a change, if feasible, would fully keep all the current AND possibilities for current and future mapmaking, as well as fully assuring the exact functionality of already made maps, while adding a great deal of possibilities for future mapmaking, beside allowing to implement the WaW and tRS rules with some very simple changes to the current xml.

Thus, this would be not a change to the engine, but "only" an addition.

I'm thinking this would be about the same principle as how it works for supportAttachments, in which different supportAttachments with the same "bonusType" will not stack, while they will stack with different bonus type. Where the "bonusType" for the supportAttachments would be like the "canalName" for the canalAttachments.

Am I making any sense, by mere chance?
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
Also, as a side note, and probably just me not getting it, I've actually never got what's currently the point of having to have both the same names, starting with "canalAttatchment", as well as the same "canalName", in the two entries required for each canal, as well as no other canals possibly having either of them. Seems like making the whole presence of the "canalName" option something redundant, already covered by the name after the "canalAttatchment". I've never actually understood why, as now, the "canalName" option exists at all, and what it is its purpose, exactly, other than adding a second name entry for the canal (made up by the sum of the two attatchments), beside the name right after the "canalAttatchment".

Meaning as now if we have:

                <attatchment name="canalAttatchmentSuez" attatchTo="15 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Suez Canal"/>
                        <option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
                </attatchment>

                <attatchment name="canalAttatchmentSuez" attatchTo="34 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Suez Canal"/>
                        <option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
                </attatchment>

Why not simply having, instead:

                <attatchment name="canalAttatchmentSuez Canal" attatchTo="15 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
                </attatchment>

                <attatchment name="canalAttatchmentSuez Canal" attatchTo="34 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
                </attatchment>

Meaning I'm not getting the reason of the current existance of the "canalName" option. That's why I'm suggesting to use it for something.

Again, totally possible it's just me not getting stuff.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@aaalafayette - Thanks for the list. I looked through all them and it appears there is only 1 map that currently has multiple canals between sea zones that should definitely act as AND (Camp David). This should just be updated to have one canal with 3 territories needed rather than 2 serial canals. The only ones I'm not 100% sure on is Civil War because of the sheer number of rail canals and Ancient Times which has 2 canals around Oresund that appear that they should be parallel OR not serial AND.

./cold_war_asia1948/map/games/ColdWarAsia1948.xml
- Commented out

./cold_war_asia1948/map/games/ColdWarAsia1948Japan.xml
- Commented out

./classic_variations/map/games/four_if_by_sea.xml
- Duplicate canals

./civil_war/map/games/Civil_War_Eastern_Campaigns.xml
- Different territories (95% sure as there are lots)

./civil_war/map/games/Civil_War.xml
- Different territories (95% sure as there are lots)

./blue_vs_gray/map/games/blue_vs_gray.xml
- Different territories

./large_middle_earth/map/games/Large_Middle_Earth.xml
- Different territories

./total_world_war/map/games/Total_World_War_Dec1941.xml
- Duplicate canals

./world_war_ii_v6_1941/map/games/WW2v6_1941.xml
- Different territories

./camp_david/map/games/1948_Arab-Israeli_War.xml
- Has 2 serial canals which need updated to be one canal with 3 territories

./camp_david/map/games/1973_Yom_Kippur_War.xml
- Has 2 serial canals which need updated to be one canal with 3 territories

./camp_david/map/games/1956_Suez_Crisis.xml
- Has 2 serial canals which need updated to be one canal with 3 territories

./camp_david/map/games/1967_Six-Day_War.xml
- Has 2 serial canals which need updated to be one canal with 3 territories

./ancient_times/map/games/Ancient_Times.xml
- Looks like this should function as WaW and TRS as 2 parallel OR canals

./world_war_ii_v5_1942/map/games/WW2v5_1942_2nd.xml
- Commented out

./world_at_war/map/games/World_At_War_1940.xml
- Should be parallel OR canals

./world_at_war/map/games/World_At_War.xml
- Should be parallel OR canals

./the_rising_sun/map/games/The_Rising_Sun.xml
- Should be parallel OR canals
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Cernel - Some interesting ideas. At this point, I'd rather first just fix the existing functionality from AND to OR as this already gives more flexibility and is pretty easy (low risk) to change. We can always look to truly 'enhance' canals later on.

In regards to 'canalName', this is used to pair up the canal attachments but in theory you could just use the attachment name and then this probably isn't needed. The issue with ever changing this is that the attachment name right now doesn't really matter so I think there exists lots of canal pairs that correctly use the 'canalName' but don't have the same attachment name.

@all - Based on the findings/discussion so far my initial plan is:

- Submit code to change for multiple canals between territories being OR instead of AND
- Post a message in the Camp David, Ancient Times, and Civil War map threads regarding this potential change from multiple canals between territories being AND to OR to get any feedback from map owners
- Map owners will have til we release the next TripleA version to respond
- If map owners don't respond I will move forward with the following assumptions around each:
--- Camp David - will be updated to have a single canal with 3 territories rather than 2 serial canals
--- Ancient Times - no changes will be made as I believe this should work parallel canals like WaW/TRS
--- Civil War - no changes/impact as I don't believe there are any territories with multiple canals
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Frostion
I currently only have one map with channels, and that is my unreleased Age of Tribes map.
(It is unreleased as the Easy AI never shops units with the second resource of the game, “tech”. The Hard AI does this. The Easy AI will therefore not advance away from the caveman stage. I guess I am waiting for the removal of the Easy AI from the game.)

On that map there are a few channels. All are normal “control these two territories and you may sail through this one passage” channels.

However, I would like to code one of them different than the others if I could. The Strait of Denmark:



Right now this channel is is just “control jutland and Sealand and you may sail through”, and this is what the decoration graphics with the chains tries to symbolize/hint. I would of course also like to make it possible to control Sealand and Skaane and sail through. Then I would replace the half chain with a full chain.
I hope that there will be a post explaining any coding instructions. Will the Pact of Steel 2 xml be updated with new info on channel coding (if this will be the case)?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Frostion - Yep that is exactly what this change will allow. You can define as many canals as you want between 2 sea zones and if any of them are controlled them you can move between the sea zones. So you'll be able to have separate canals Jutland/Sealand and Sealand/Skaane then only one of these pairs needs owned to sail through.

In Pact of Steel 2, it mentions that you can have multiple canals but doesn't specify how they will work:
"You may have multiple canalAttatchment's per territory, so long as they have different names that start with "canalAttatchment". Each "canal" must consist of 2 attachments attached to the connected sea (or land) zones. The following options are allowed for "canalAttatchmentXXX" (all canal attachments need identical attachments attached to the 2 sea zones involved)."

This should probably be tweaked to describe if you have multiple canals between 2 territories how they actually function.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Veqryn
Administrator
This post was updated on .
First, to clear up a misconception about current canal attachments.

Here is the text from pact of steel 2 xml:
		<!-- Canals -->
		<!-- You may have multiple canalAttatchment's per territory, so long as they have different names that start with "canalAttatchment".
			Each "canal" must consist of 2 attachments attached to the connected sea (or land) zones. -->
		<!-- The following options are allowed for "canalAttatchmentXXX" (all canal attachments need identical attachments attached to the 2 sea zones involved).
				canalName							values: any string name for the canal. must match its counterpart attachment.
				landTerritories						values: a colon (":") delimited list of the territories that make up this canal. must match its counterpart attachment. Can be any number of territories, but at least 1 territory.
				excludedUnits						values: an optional list of all the units that will NOT be validated by the canal. If left blank, then all Air units will not be validated. Can also be set to "NONE" or "ALL".
															example: <option name="excludedUnits" value="submarine:fighter:bomber:air_transport"/>
		-->

		<attatchment name="canalAttatchmentSuez" attatchTo="15 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
			<option name="canalName" value="Suez Canal"/>
			<option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
		</attatchment>

		<attatchment name="canalAttatchmentSuez" attatchTo="34 Sea Zone" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
			<option name="canalName" value="Suez Canal"/>
			<option name="landTerritories" value="Anglo Egypt:Trans-Jordan"/>
		</attatchment>

What the statement, "You may have multiple canalAttatchment's per territory, so long as they have different names that start with canalAttatchment.", means is:
You can attach multiple canal attachments to a given territory (in the above case, '15 Sea Zone').  So for example, you could have 2 canals, one for moving between sea zones 15 and 34, and another canal for moving between sea zones 15 and 93.
Previous to this change, you could only have one canal attachment per territory, and the territory had to be a sea zone.  After my changes to the game engine, you could have more than one attachment per territory, and it could be any territory, not just sea zones.




Now, to move onto the proposed changes.

I strongly disagree with the idea of switching to a "OR" relationship, if I understand this thread correctly.

Here is what I would propose instead:
<option name="landTerritories" value="Anglo Egypt:Trans-Jordan" count="1"/>

If "count" is missing, then it defaults to a number equal to the number of territories in the list.

This would have the exact same syntax and result as national objective and condition attachments, and it could reuse the code that already deals with parsing this kind of stuff.

Not only that, but this would be backwards compatible with all the current XML's.


(Note to redrum for when you get into the code of this.  "count" is just a fancy way of having the first element in the delimited list be called out separately. The following two things are actually equal when they are pumped into the "set" function of the specified attachment:
value="Germans:Italians:Japanese" count="2"
value="2:Germans:Italians:Japanese"
)
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Veqryn - I don't think that change would fix the problem.

So here is an example of the issue from WaW:

sz73 - sz110 are separate by 3 canals:
- Flores-Nayumo
- Nayumo-Ceram
- Ceram-Okaba

If any 1 of these canals is owned then your ships can pass between sz73 - sz110. The problem is currently the engine makes you own all 3 of these canals in order to pass between the 2 sea zones.

Your above proposal wouldn't fix this as if you combine all these into a single canal you'd need some way of saying if you own Flores-Nayumo OR Nayumo-Ceram OR Ceram-Okaba then you can pass but not if you own say Flores-Ceram.

This for example would NOT work:
<option name="landTerritories" value="Flores:Nayumo:Ceram:Okaba" count="2"/>

Unless I'm missing something I don't see how you could make it work without changing to allow some sort of OR functionality across canals.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
In reply to this post by Veqryn
Veqryn wrote
Previous to this change, you could only have one canal attachment per territory, and the territory had to be a sea zone.  After my changes to the game engine, you could have more than one attachment per territory, and it could be any territory, not just sea zones.
This is a great improvement, higly enhancing strategical representative capabilities of mapmakers, still yet to be used to any significant extent (aside very few things, like Turkish straits). Thanks for it.

Myself, for example, in a map like WaW, would land connect all canals and, for canals supposet to not actually be land connected, create a land canal allowing passage only for air units. And, in general, the possiblity of having selective bridges is very cool, for example you can say that Sicily - Taranto is a movement 1 move for air units only, and not a sea canal, nor directly connected, for anything else at all.

This allows giving multiple dimensions to any maps, and create narrow straits that can block land movement, while being insignificant (as they should) for air movement.

That was one of the biggest improvements of TA.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Veqryn
Administrator
In reply to this post by redrum
ahhhh, i must have misunderstood.

hm... and you want to globally change canals to use an OR relationship to solve this?

is there a use case for a combination of AND and OR, similar to how condition attachments work?
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Veqryn - Exactly. That is essentially what this thread is to discuss and determine. I don't believe there is a case of needing the AND relationship since you could just have multiple territories in a single canal.

For example, if you wanted to have 2 serial canals each with 2 land territories for ownership (think of a strait) then you could instead just create a single canal with all 4 territories for ownership.

So I don't think there is a good case for AND. There appears to only be 1 map that needs updated if we change the global relationship from AND to OR as it was doing essentially what I describe in the example.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Veqryn
Administrator
the only case i can think of for needing both AND and OR would be something like needing:
(territory A OR territory B) AND territory C

it might be easier to jump to a system that allows that, then to create a half measure of switching everything to use "OR"
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Veqryn - That can be handled by the OR system as (territory A AND territory C) OR (territory B AND territory C). So it would be just 2 canals each with 2 needed territories. Essentially a single canal acts as 'AND' and then combining canals acts as 'OR' from a logical standpoint.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

Cernel
In reply to this post by redrum
Ok... I was actually unsure if Veqryn was understanding the matter at all, cause its solution is allright, but the way he presented it seemed to hint he didn't actually get it.

I already asked about it in this post, btw:
http://tripleadev.1671093.n2.nabble.com/WORLD-AT-WAR-tp5862407p7590610.html

Actually, redrum & Veqryn, in the case redrum describes, as well in all WaW cases and more, Veqryn's system would work fine already, believe it or not. You can set up combinations of AND or OR either with the AND or the OR being into or out parentesis. The only substantial matter is that some solutions are more intuitive for the human mind than others.

Saying you need "(A and B) or (B and C) or (C and D)" is logically the same as saying you need "(B and (A or C)) or (C and D)" which is the same as "(B or C) and (B or D) and (A or C)" and other formulations (and this last formulation is not more complex, but simply less intuitive for humans).

In the simple Frostion case, we would have the easy "(A and B) or (B and C)" = "B and (A or C)", as Veqryn said. This is pretty intuitive and I guess 80% people can get it.

Going back on topic, in the redrum's case I'm replying to, you can fully implement the wanted rule by having this set of canals, as per Veqryn's imput:

                <attatchment name="canalAttatchment10" attatchTo="sz73" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal10"/>
                        <option name="landTerritories" value="Nayumo:Ceram" count="1"/>
                </attatchment>
                <attatchment name="canalAttatchment10" attatchTo="sz110" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal10"/>
                        <option name="landTerritories" value="Nayumo:Ceram" count="1"/>
                </attatchment>

                <attatchment name="canalAttatchment11" attatchTo="sz73" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal11"/>
                        <option name="landTerritories" value="Nayumo:Okaba" count="1"/>
                </attatchment>
                <attatchment name="canalAttatchment11" attatchTo="sz110" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal11"/>
                        <option name="landTerritories" value="Nayumo:Okaba" count="1"/>
                </attatchment>

                <attatchment name="canalAttatchment12" attatchTo="sz73" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal12"/>
                        <option name="landTerritories" value="Flores:Ceram" count="1"/>
                </attatchment>
                <attatchment name="canalAttatchment12" attatchTo="sz110" javaClass="games.strategy.triplea.attatchments.CanalAttachment" type="territory">
                        <option name="canalName" value="Canal12"/>
                        <option name="landTerritories" value="Flores:Ceram" count="1"/>
                </attatchment>

In the most complex case (WaW wise) of "(A and B) or (B and C) or (C and D) or (D and E) or (E and F)" (for S.Guinea, New Britain, Samo, Boku, Guadalcanal, Cristobal),
it would be:
(B or D or E) and (B or D or F) and (B or C or E) and (A or C or E)
Thus the relative 4 canals set, that you can derive, mutatis mutandis.

With this said, I feel a bit unconfortable with Veqryn's solution, because only a few people are arguably intelligent enough to use (or even get) such a system properly, no matter how well you explain it (and better you explain it very well in pos2). So, I fear we make something that now redrum will use with no problems for WaW and tRS now, then almost noone else will use or figure out anymore again. If all mapmakers would be Veqryns I would say: "sure, np, go ahead, easy enough".

With this said, if you want to open a poll to vote only between redrum and Veqryn solutions (that would be a funny poll, 90% people voting randomly), I would absolutely vote for Veqryn's. Because I really want the AND ability amongst canals to be kept, plus this system is even more expansive of an AND/OR switch, albeit for no immediate reasons.

Still, if you think this would be the best way, code wise (on which I've no clue whatsoever), go ahead; I guess anyone can ask for help and hopefully get solved in Forum the canal attachments for his own maps by some nice people, upon (almost inevitably IMO) getting stuck on it.

Again, since I have no skills, anything I just said may be plainly wrong.

p.s.: At Veqryn: You might want to update your Napoleonic map having the Holstein, Sjaelland, Skane canal working as per Frostion's, btw, since there is actually the sea between Sjaelland and Skane. Tho, realistically, that canal should not exist, cause in those times you can't avoid ships passing in between of Holstein and Sjaelland, really.

and:
redrum wrote
So I don't think there is a good case for AND.
I still believe the cases I've pointed out are good. Thanks.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Canals Between 2 Sea Zones

redrum
Administrator
@Cernel - So you are correct that we could use Veqryn's solution and essentially make each canal act as the 'OR' using the count. But as you demonstrated its much more difficult to understand when canals naturally act closer to the inverse as in a single canal being 'AND' then 'OR' in between them all.

I think this is much more intuitive and the code change would be easier as well. No new map parameters just a single engine change to switch from the global AND to global OR. I'm still not sure why you would vote for the system that you've essentially shown is clearly more difficult for most people to understand?

Can you imagine if you wrote the the canal logic for WaW of '(B or D or E) and (B or D or F) and (B or C or E) and (A or C or E)' in the game notes. Everyone would be like wtf... Then you'd explain well that is equivalent to (A and B) or (B and C) or (C and D) or (D and E) or (E and F) and they'd be like oh that makes sense.
1234
Loading...