Page 1 of 2
XML bonuses question - overrides

Posted:
Wed Oct 07, 2009 11:01 am
by Industrial Helix
Ok, for my 13 American Colonies map I have run into a bit of a dilemma.
Basically, in order for the bonuses to work on a number of colonies basis I've found that I have to write the continent as it is and then have it override all other possible bonuses in the same number of colonies category as well as in every lesser number of colonies category.
For Example:
Continent is Georgia and South Carolina, therefore it must override all other 2 colony bonuses.
Continent is Georgia, South Carolina, North Carolina and Virginia, therefore it must override all 2 colony, 3 colony and 4 colony bonuses.
I'm at 200 microsoft word pages already and I've only finished the 2 colony bonus overrides. I've got a long way to go and I'm wondering if there is a more efficient way of writing this XML.
Is there a code for Any two of the following continents equals a bonus of x code or something?
Thanks!
Re: XML bonuses question

Posted:
Wed Oct 07, 2009 1:09 pm
by AndrewB
I think this way should work:
For example:
Conceptual model:
Continent 1
Colony A
Colony B
Colony C
Colony D
Required = 2 bonus = 1
Continent 2
Colony A
Colony B
Colony C
Colony D
Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)
Continent 3
Colony A
Colony B
Colony C
Colony D
Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)
There is another way as well, but it is not suited for every bonus structure:
Create a pairs combinations (as it is done in USApocalipse xml).
For example:
Bonus 1
Colony A
Colony B
Bonus = 1
Bonus 2
Colony A
Colony C
Bonus = 1
Bonus 3
Colony B
Colony C
Bonus = 1
In this case, if the player will hold all 3 colonies he will get 1+1+1 bonus.
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 3:29 am
by yeti_c
AndrewB wrote:I think this way should work:
For example:
Conceptual model:
Continent 1
Colony A
Colony B
Colony C
Colony D
Required = 2 bonus = 1
Continent 2
Colony A
Colony B
Colony C
Colony D
Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)
Continent 3
Colony A
Colony B
Colony C
Colony D
Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)
This looks good...
But I would actually set the bonuses to their correct values - then override the previous ones up the chain - that way the log looks cleaner and the code is easier to understand.
C.
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 11:32 am
by AndrewB
Actually if you name the continents in that example all the same, then they all will be combined. And it will be even cleaner probably?
Not
Continent 1
Continent 2
Continent 3
But just
Continent
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 1:24 pm
by Industrial Helix
AndrewB wrote:I think this way should work:
For example:
Conceptual model:
Continent 1
Colony A
Colony B
Colony C
Colony D
Required = 2 bonus = 1
Continent 2
Colony A
Colony B
Colony C
Colony D
Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)
Continent 3
Colony A
Colony B
Colony C
Colony D
Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)
There is another way as well, but it is not suited for every bonus structure:
Create a pairs combinations (as it is done in USApocalipse xml).
For example:
Bonus 1
Colony A
Colony B
Bonus = 1
Bonus 2
Colony A
Colony C
Bonus = 1
Bonus 3
Colony B
Colony C
Bonus = 1
In this case, if the player will hold all 3 colonies he will get 1+1+1 bonus.
Ok, But the colony's break down into smaller territories. Is there a way to group them territory x,y and z = colony and then colony 1, colony 2, colony 3 and coloney 4, hold two for a bonus of 3?
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 1:45 pm
by thenobodies80
- Code: Select all
<continent>
<name>2 colonies</name>
<bonus>3</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>2</required>
</continet>
<continent>
<name>3 colonies</name>
<bonus>4</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>3</required>
<overrides>
<override>2 colonies</override>
</overrides>
</continet>
<continent>
<name>4 colonies</name>
<bonus>5</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>4</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
</overrides>
</continet>
<continent>
<name>5 colonies</name>
<bonus>6</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>5</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
</overrides>
</continet>
<continent>
<name>6 colonies</name>
<bonus>7</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>6</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
</overrides>
</continet>
<continent>
<name>7 colonies</name>
<bonus>8</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>7</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
</overrides>
</continet>
<continent>
<name>8 colonies</name>
<bonus>9</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>8</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
<override>7 colonies</override>
</overrides>
</continet>
<continent>
<name>colony 1</name>
<bonus>0</bonus>
<components>
<territory>region 1</territory>
<territory>region 2</territory>
<territory>region 3</territory>
</components>
</continet>
<continent>
<name>colony 2</name>
<bonus>0</bonus>
<components>
<territory>region 4</territory>
<territory>region 5</territory>
<territory>region 6</territory>
</components>
</continet>
<continent>
<name>colony 3</name>
<bonus>0</bonus>
<components>
<territory>region 7</territory>
<territory>region 8</territory>
<territory>region 9</territory>
<territory>region 10</territory>
</components>
</continet>
<continent>
<name>colony 4</name>
<bonus>0</bonus>
<components>
<territory>region 11</territory>
<territory>region 12</territory>
<territory>region 13</territory>
</components>
</continet>
etc etc
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 2:06 pm
by Industrial Helix
Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.
Did not know I could do that.
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 2:09 pm
by AndrewB
Industrial Helix wrote:Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.
Did not know I could do that.
No, you cannot do that Helix. Shoot me a PM and I can help you with an XML, if u want me too.
Re: XML bonuses question

Posted:
Thu Oct 08, 2009 3:07 pm
by thenobodies80
AndrewB wrote:Industrial Helix wrote:Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.
Did not know I could do that.
No, you cannot do that Helix.Shoot me a PM and I can help you with an XML, if u want me too.
You right,bad typo (i used the territory tag instead of the continent tag)
But it can be done...
- Code: Select all
<continent>
<name>2 colonies</name>
<bonus>3</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>2</required>
</continet>
<continent>
<name>3 colonies</name>
<bonus>4</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>3</required>
<overrides>
<override>2 colonies</override>
</overrides>
</continet>
<continent>
<name>4 colonies</name>
<bonus>5</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>4</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
</overrides>
</continet>
<continent>
<name>5 colonies</name>
<bonus>6</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>5</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
</overrides>
</continet>
<continent>
<name>6 colonies</name>
<bonus>7</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>6</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
</overrides>
</continet>
<continent>
<name>7 colonies</name>
<bonus>8</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>7</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
</overrides>
</continet>
<continent>
<name>8 colonies</name>
<bonus>9</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>8</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
<override>7 colonies</override>
</overrides>
</continet>
<continent>
<name>colony 1</name>
<bonus>0</bonus>
<components>
<territory>region 1</territory>
<territory>region 2</territory>
<territory>region 3</territory>
</components>
</continet>
<continent>
<name>colony 2</name>
<bonus>0</bonus>
<components>
<territory>region 4</territory>
<territory>region 5</territory>
<territory>region 6</territory>
</components>
</continet>
<continent>
<name>colony 3</name>
<bonus>0</bonus>
<components>
<territory>region 7</territory>
<territory>region 8</territory>
<territory>region 9</territory>
<territory>region 10</territory>
</components>
</continet>
<continent>
<name>colony 4</name>
<bonus>0</bonus>
<components>
<territory>region 11</territory>
<territory>region 12</territory>
<territory>region 13</territory>
</components>
</continet>
etc etc
edit: public discussions on threads will help more people than a PM

Re: XML bonuses question

Posted:
Fri Oct 09, 2009 8:54 am
by yeti_c
AndrewB wrote:Actually if you name the continents in that example all the same, then they all will be combined. And it will be even cleaner probably?
Not
Continent 1
Continent 2
Continent 3
But just
Continent
Yes that would work - but makes the XML harder to understand and the bonuses harder to equate...
The overrides method makes it easier for the standard player to understand and cleaner in the logs.
C.
maximum bonuses?

Posted:
Thu Oct 29, 2009 10:35 am
by Industrial Helix
For my 13 colonies map, I'm looking at having 7,085 different bonuses based on the various combinations of the 13 colonies. Is this going to crash the game engine or whatever? Can I do this and not have to worry about something going catastrophically wrong?
Re: maximum bonuses?

Posted:
Thu Oct 29, 2009 11:16 am
by yeti_c
Industrial Helix wrote:For my 13 colonies map, I'm looking at having 7,085 different bonuses based on the various combinations of the 13 colonies. Is this going to crash the game engine or whatever? Can I do this and not have to worry about something going catastrophically wrong?
You need to code your XML better.
C.
Re: maximum bonuses?

Posted:
Thu Oct 29, 2009 2:23 pm
by Industrial Helix
I've talked to a few other people about it and there doesn't seem to be any other way than to make a boatload of bonuses.
Re: maximum bonuses?

Posted:
Thu Oct 29, 2009 3:25 pm
by thenobodies80
Helix if you use the super continents you will have less bonuses. Look my post here
http://www.conquerclub.com/forum/viewtopic.php?f=127&t=98509#p2245859.
You don't need to code all the combinations because the <continent> tag can be used instead of the <territory> one in the bonuses.
Code some supercontinents (2 colonies/3 colonies,etc),then use <override>.
You will have 7 bonuses for your groups of colonies (from 2 to 8 ), 13 for your colonies, 2 for ships
Total 22 bonuses.
Your xml will work and it will be smaller
Nobodies
Re: maximum bonuses?

Posted:
Thu Oct 29, 2009 3:56 pm
by Industrial Helix
Gotcha... i dunno how I missed that the first time. Thanks for being patient with me!
Re: maximum bonuses?

Posted:
Fri Oct 30, 2009 6:38 am
by yeti_c
viewtopic.php?f=127&t=98509Not sure how you missed it - it was in your own topic?!
C.
Re: XML bonuses question

Posted:
Fri Oct 30, 2009 9:44 am
by thenobodies80
Merged with your old topic.
[ Merged ]
Re: XML bonuses question - overrides

Posted:
Fri Apr 16, 2010 6:14 pm
by ManBungalow
I have a related XML issue. Having had a chat with MrBenn, I've come to the conclusion that there are two solutions to the problem I have. The map looks like this:
- Click image to enlarge.

I'm trying to create the bonus effect of +1 for every 2 green regions across the whole map. Number one is to use the bonus over-ride rule:
- Code: Select all
<continent>
<name>2 Green regions</name>
<bonus>1</bonus>
<components>
<territory>LIST</territory>
<territory>ALL</territory>
<territory>GREEN</territory>
<territory>REGIONS</territory>
<territory>HERE</territory>
</components>
<required>2</required>
</continent>
<continent>
<name>4 Green regions</name>
<bonus>2</bonus>
<components>
<territory>LIST</territory>
<territory>ALL</territory>
<territory>GREEN</territory>
<territory>REGIONS</territory>
<territory>HERE</territory>
</components>
<required>4</required>
<overrides>
<override>2 Green regions</override>
</overrides>
</continent>
This would mean copying the whole continent (112 regions) 56 times over (changing the name, bonus troops and regions required each time) and adding an extra bonus to the over-ride each time. That's fine with me, but it would make for a very long and presumably lag-inducing XML.
--
The alternative seems to be to use a Reinforcement rule of +1 per any 2 regions on the map and add negative bonuses to sets of non-green regions held. I'm not all in favour of this variation due to the questions raised by the negative bonuses.
--
Is there an alternate way of coding this and, if not, which way is "better" ?
Re: XML bonuses question - overrides

Posted:
Sat Apr 17, 2010 8:16 am
by ManBungalow
Using the override setup I will soon have just over 18,000 lines of XML purely to work out the +1 for 2 greens. This worries me. It seems very inefficient and will surely affect the quality of the system as a whole. Is this a concern for anyone else ?
Re: XML bonuses question - overrides

Posted:
Sat Apr 17, 2010 9:30 am
by natty dread
I can't see an alternative... Perhaps a gameplay change is in order. Say, a cap at 20 or 30 green territories.
Re: XML bonuses question - overrides

Posted:
Sat Apr 17, 2010 2:52 pm
by ender516
I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
Re: XML bonuses question - overrides

Posted:
Sat Apr 17, 2010 3:45 pm
by natty dread
ender516 wrote:I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
No... because you will need different "required" tags for each bonus. You can only define one required tag for one continent.
Re: XML bonuses question - overrides

Posted:
Sat Apr 17, 2010 10:29 pm
by chipv
If we had an XML update allowing reinforcement tags inside continents, this would do it. (Or even vice versa).
Re: XML bonuses question - overrides

Posted:
Sun Apr 18, 2010 1:15 am
by ender516
natty_dread wrote:ender516 wrote:I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
No... because you will need different "required" tags for each bonus. You can only define one required tag for one continent.
But the <required></required> tag is outside the <components></components> tag, while still being within the <continent></continent>. It might look something like this:
- Code: Select all
<continent>
<name>2 Green regions</name>
<bonus>1</bonus>
&GreenRegionComponents;
<required>2</required>
</continent>
<continent>
<name>4 Green regions</name>
<bonus>2</bonus>
&GreenRegionComponents;
<required>4</required>
<overrides>
<override>2 Green regions</override>
</overrides>
</continent>
<continent>
<name>6 Green regions</name>
<bonus>3</bonus>
&GreenRegionComponents;
<required>6</required>
<overrides>
<override>2 Green regions</override>
<override>4 Green regions</override>
</overrides>
</continent>
I won't attempt the entity definition here, since I'm not exactly sure of the syntax. This doesn't help reduce the number of continents or the increasing number of overrides in each one, but it should help some.
Say, what if each of those 56 continents just gave a bonus of 1 and there were no overrides, wouldn't that add up properly?
Re: XML bonuses question - overrides

Posted:
Sun Apr 18, 2010 5:33 am
by natty dread
Oh, so that's what you mean. Yeah, it could work, maybe. I'm not sure how the CC XML engine handles internal entities.
Say, what if each of those 56 continents just gave a bonus of 1 and there were no overrides, wouldn't that add up properly?
Yes, but it would look really awful in game log...