View Full Version : Tag requests


Pages : [1] 2

AIAndy
Feb 04, 2012, 08:30 AM
If you want to request any tags for the existing XML files, use this thread.
Describe the tag name and the behavior that you would like.
I will then copy them into the first post and we have some documentation as well once they are implemented.


Requested tags

Buildings:

<SpecialBuildingCommerceChanges>: This would be the same as <BuildingCommerceChanges>, except it would allow you to use a special building type, like SPECIALBUILDING_TEMPLE to grant a bonus to all Temples.

<SpecialBuildingHappinessChanges>: This would be the same as <BuildingHappinessChanges>, but like <SpecialBuildingCommerceChanges>, it would allow you to grant a bonus to all buildings using a special building type.

<SpecialistCommerceChanges>: This would let you add to the commerce production of a certain type of specialist. Similar to <SpecialistExtraCommerces>, except that you could modify one particular specialist instead of having to grant the same bonus to all of them.

<BonusCommerceChanges>: This would allow you to add a commerce yield to a particular bonus resources, like +1 science from all Wheat resources-- if this is even possible. I don't know if resources can have a commerce-type bonus attached the way they can have a health or happiness bonus.

Yes, I have a lot of building ideas that would like to be able to tweak a particular kind of commerce.

<BuildingHealthChanges>: I'm surprised this one doesn't exist already. Just like <BuildingHappinessChanges>, except for health, so it would change the health of all instances of a particular building in your civilization.

Two religion bonus tags. Both of these would apply regardless of what your state religion was, as long as you had one. They would not have to rely on <PrereqReligion> or <StateReligion> like <iStateReligionHappiness> seems to.

<iGlobalStateReligionHappiness>: +X happiness in all cities with your state religion.

<iStateReligionBuildingHappiness>: +X happiness from all buildings that require your state religion.

<ExtraFreeBuildings>. You can only do one building with <FreeBuilding>, so this would be a list tag that would allow more than one.

A tag that allows for say +:hammers: per population much like there is +:health: per population

<RouteMovementChanges>: a list of +X movement on a specific road

Units
<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<SpecialCargo2>WHATEVER</SpecialCargo2>
<DomainCargo>DOMAIN_AIR</DomainCargo>
<DomainCargo2>WHATEVER</DomainCargo2>
would mean that the unit could carry air units with the specialunit tag FIGHTER and land units with the specialunit tag UN.

A tag that hides units on the unit upgrade tree.

<PrereqBonusesAnd> -- No more needed, use TrainCondition

Promotion
<bCanMoveOceans>: Allows movement over oceans.
<bCanMoveIce>: Allows movement over ice.

Improvement
<bRequiresCoast>: Requires a plot next to a coast plot to be built.
<bNoAdjacent>: Can't be built right next to the same improvement.

AIAndy
Feb 04, 2012, 08:31 AM
Implemented Tags

Building
<GlobalBuildingExtraCommerces>: Changes the commerces of each instance of a building in your civilization.
<GlobalBuildingExtraCommerces>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_FORGE</BuildingClass>
<CommerceType>COMMERCE_CULTURE</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_GRANARY</BuildingClass>
<CommerceType>COMMERCE_RESEARCH</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
</GlobalBuildingExtraCommerces>

Sgtslick
Feb 04, 2012, 08:59 AM
whats a tag? :blush:

AIAndy
Feb 04, 2012, 09:28 AM
whats a tag? :blush:
Example: <bFirstStrikeImmune>

Hydromancerx
Feb 04, 2012, 05:03 PM
Glad you made this topic. I am surprised it was not made sooner.

Vokarya
Feb 04, 2012, 06:26 PM
I agree. I've compiled a list of the tags I would like to see. Most of these are straight mechanical additions to certain numbers, so I don't think they are too difficult, but I could be wrong. I copied the ones I posted in the Help Wanted thread, to put them all in one place. These are all tags for Civ4BuildingInfos.xml. (I love designing new Wonders.)

<BuildingCommerceChanges>: This would use <BuildingType> and <iCommerce> tags to allow you to increase the commerces of each instance of a building in your civilization.

<SpecialBuildingCommerceChanges>: This would be the same as <BuildingCommerceChanges>, except it would allow you to use a special building type, like SPECIALBUILDING_TEMPLE to grant a bonus to all Temples.

<SpecialBuildingHappinessChanges>: This would be the same as <BuildingHappinessChanges>, but like <SpecialBuildingCommerceChanges>, it would allow you to grant a bonus to all buildings using a special building type.

<SpecialistCommerceChanges>: This would let you add to the commerce production of a certain type of specialist. Similar to <SpecialistExtraCommerces>, except that you could modify one particular specialist instead of having to grant the same bonus to all of them.

<BonusCommerceChanges>: This would allow you to add a commerce yield to a particular bonus resources, like +1 science from all Wheat resources-- if this is even possible. I don't know if resources can have a commerce-type bonus attached the way they can have a health or happiness bonus.

Yes, I have a lot of building ideas that would like to be able to tweak a particular kind of commerce.

<BuildingHealthChanges>: I'm surprised this one doesn't exist already. Just like <BuildingHappinessChanges>, except for health, so it would change the health of all instances of a particular building in your civilization.

Two religion bonus tags. Both of these would apply regardless of what your state religion was, as long as you had one. They would not have to rely on <PrereqReligion> or <StateReligion> like <iStateReligionHappiness> seems to.

<iGlobalStateReligionHappiness>: +X happiness in all cities with your state religion.

<iStateReligionBuildingHappiness>: +X happiness from all buildings that require your state religion.

I think that's enough for the moment.

Koshling
Feb 04, 2012, 06:34 PM
I agree. I've compiled a list of the tags I would like to see. Most of these are straight mechanical additions to certain numbers, so I don't think they are too difficult, but I could be wrong. I copied the ones I posted in the Help Wanted thread, to put them all in one place.

<BuildingCommerceChanges>: This would use <BuildingType> and <iCommerce> tags to allow you to increase the commerces of each instance of a building in your civilization.

<SpecialBuildingCommerceChanges>: This would be the same as <BuildingCommerceChanges>, except it would allow you to use a special building type, like SPECIALBUILDING_TEMPLE to grant a bonus to all Temples.

<SpecialBuildingHappinessChanges>: This would be the same as <BuildingHappinessChanges>, but like <SpecialBuildingCommerceChanges>, it would allow you to grant a bonus to all buildings using a special building type.

<SpecialistCommerceChanges>: This would let you add to the commerce production of a certain type of specialist. Similar to <SpecialistExtraCommerces>, except that you could modify one particular specialist instead of having to grant the same bonus to all of them.

<BonusCommerceChanges>: This would allow you to add a commerce yield to a particular bonus resources, like +1 science from all Wheat resources-- if this is even possible. I don't know if resources can have a commerce-type bonus attached the way they can have a health or happiness bonus.

Yes, I have a lot of building ideas that would like to be able to tweak a particular kind of commerce.

<BuildingHealthChanges>: I'm surprised this one doesn't exist already. Just like <BuildingHappinessChanges>, except for health, so it would change the health of all instances of a particular building in your civilization.

Two religion bonus tags. Both of these would apply regardless of what your state religion was, as long as you had one. They would not have to rely on <PrereqReligion> or <StateReligion> like <iStateReligionHappiness> seems to.

<iGlobalStateReligionHappiness>: +X happiness in all cities with your state religion.

<iStateReligionBuildingHappiness>: +X happiness from all buildings that require your state religion.

I think that's enough for the moment.

One thing you need to clarify (please) is which entities you want these tags on. In all of the bove cases I assume you mean on buildings (?) , though some might be appropriate on civics or on events....

Vokarya
Feb 04, 2012, 06:49 PM
One thing you need to clarify (please) is which entities you want these tags on. In all of the bove cases I assume you mean on buildings (?) , though some might be appropriate on civics or on events....

These are all for buildings. I realized that after I posted and edited the post.

AIAndy
Feb 05, 2012, 06:05 AM
These are all for buildings. I realized that after I posted and edited the post.
Should the changes apply to the player or the team?

Sgtslick
Feb 05, 2012, 07:58 AM
Hey do u reckon agents or secret agents could be allowed them to bribe single units.
The unit would have to be alone in the tile. Couldn't be certain units. Would cost $$
This could also lead to promotions such as defensive promotions for units which make it 2x as expensive to bribe them, or spy promotions that make it cheaper and higher chance of success.

Civics could also influence the likelihood of success. Something like intolerant + nationalism means all units are immune. Something like Free market + coinage, 50% higher chance and 30% cheaper or something like this.

I think it would be a nice mechanic and would help builder style of play.
__________________

Vokarya
Feb 05, 2012, 08:01 AM
Should the changes apply to the player or the team?

I think these would all apply just to the player. I will admit I am unfamiliar with team play. Are there any building tags that apply to all team members?

AIAndy
Feb 05, 2012, 08:10 AM
I think these would all apply just to the player. I will admit I am unfamiliar with team play. Are there any building tags that apply to all team members?
Quite a lot of those tags mainly used in wonders are applied to all team members.
Like the yield or commerce changes for a building type in all cities.

Vokarya
Feb 05, 2012, 10:00 AM
Quite a lot of those tags mainly used in wonders are applied to all team members.
Like the yield or commerce changes for a building type in all cities.

OK, then. Most of these tags are variations on existing tags, so they should match the tags that inspired the new tags. Like this:

<BuildingCommerceChanges>, <SpecialBuildingCommerceChanges>, <SpecialBuildingHappinessChanges>, and <BuildingHealthChanges> should match <BuildingHappinessChanges>.

<SpecialistCommerceChanges> should match <SpecialistYieldChanges>.

<BonusCommerceChanges> should match <BonusYieldChanges>.

<iGlobalStateReligionHappiness> and <iStateReligionBuildingHappiness> should match <iGlobalHappiness>.

Will that work?

ls612
Feb 05, 2012, 03:32 PM
This isn't really a new tag request, but a request for an extension of an existing tag. I would like to be able to assign more than one type of DomainCargo and SpecialCargo to units.

Currently it looks like this:

<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<DomainCargo>DOMAIN_AIR</DomainCargo>

I'd like it to be something like this:

<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<SpecialCargo2>WHATEVER</SpecialCargo2>
<DomainCargo>DOMAIN_AIR</DomainCargo>
<DomainCargo2>WHATEVER</DomainCargo2>

If this is easy could you please make it?

Hydromancerx
Feb 07, 2012, 12:18 AM
@AIAndy

I don't know what to name it but could you make a tag that gives a building a requirement of X number of :culture: in a city in order to be built?

AIAndy
Feb 07, 2012, 02:49 AM
@AIAndy

I don't know what to name it but could you make a tag that gives a building a requirement of X number of :culture: in a city in order to be built?
Well, there is PrereqCultureLevel to do something similar or do you need a finer resolution?

AIAndy
Feb 07, 2012, 02:56 AM
This isn't really a new tag request, but a request for an extension of an existing tag. I would like to be able to assign more than one type of DomainCargo and SpecialCargo to units.

Currently it looks like this:

<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<DomainCargo>DOMAIN_AIR</DomainCargo>

I'd like it to be something like this:

<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<SpecialCargo2>WHATEVER</SpecialCargo2>
<DomainCargo>DOMAIN_AIR</DomainCargo>
<DomainCargo2>WHATEVER</DomainCargo2>

If this is easy could you please make it?
What exactly would be the behavior of a unit that has both assigned?

Hydromancerx
Feb 07, 2012, 05:52 AM
Well, there is PrereqCultureLevel to do something similar or do you need a finer resolution?

Oh their is? How do you write the code for it? Is it already used on a building?

AIAndy
Feb 07, 2012, 06:59 AM
Oh their is? How do you write the code for it? Is it already used on a building?
<PrereqCultureLevel>CULTURELEVEL_DEVELOPING</PrereqCultureLevel>
It references the city culture levels from CIV4CultureLevelInfo.xml.
Not sure if it is used for anything.

ls612
Feb 07, 2012, 03:28 PM
What exactly would be the behavior of a unit that has both assigned?

On the Help Wanted thread I discussed this and God-Emperor said that the current AI will put air units on a unit without the carrier AI, but with open air transport slots. This would mean the unit would get the same UnitAIs as the transport.

On the actual mechanics of the transport the icargo tag would be a combined pool, ie if it was 8 you could have 4 planes and 4 whatever, or 5 and 3, and so on.

The Specialcargo and Domain cargo would correspond to each other's numbers, ie in the following example

<SpecialCargo>SPECIALUNIT_FIGHTER</SpecialCargo>
<SpecialCargo2>SPECIALUNIT_UN</SpecialCargo2>
<DomainCargo>DOMAIN_AIR</DomainCargo>
<DomainCargo2>DOMAIN_LAND</DomainCargo2>

would mean that the unit could carry air units with the specialunit tag FIGHTER and land units with the specialunit tag UN. Hope that answers all of your questions.

Dancing Hoskuld
Feb 12, 2012, 10:18 PM
I have found a mod that will let explorers and up explore city ruins. Unfortunately their city ruins are not not an improvement like ours.

I have changed my mind about this.

Hydromancerx
Feb 12, 2012, 11:10 PM
Is there a tag that allows for say +:hammers: per population much like there is +:health: per population?

Vokarya
Feb 13, 2012, 10:14 AM
I had another idea for a building tag: <ExtraFreeBuildings>. You can only do one building with <FreeBuilding>, so this would be a list tag that would allow more than one. Like this:


<ExtraFreeBuildings>
<ExtraFreeBuilding>
<BuildingClass>BUILDINGCLASS_WALLS</BuildingClass>
</ExtraFreeBuilding>
<ExtraFreeBuilding>
<BuildingClass>BUILDINGCLASS_TTWATCH_TOWER</BuildingClass>
</ExtraFreeBuilding>
</ExtraFreeBuildings>


This would grant a free Walls and Watchtower to every city.

Micael
Feb 19, 2012, 04:24 PM
Hi,

Is it possible to have a tag for promotions that lets a ship cross ocean before astronomy? Similar to <bCanMovePeaks>, just <bCanMoveOceans> instead.

If it is possible, great. If not, that's okay and we'll just have to come up with something else for our Seafaring Trait.

- Micael

Koshling
Feb 19, 2012, 04:42 PM
Hi,

Is it possible to have a tag for promotions that lets a ship cross ocean before astronomy? Similar to <bCanMovePeaks>, just <bCanMoveOceans> instead.

If it is possible, great. If not, that's okay and we'll just have to come up with something else for our Seafaring Trait.

- Micael

It's possible, but it would be extremely powerful, since it would enable to tech trade much earlier potentially. So would need to be used very carefully (though deep ocean critters like giant squid would be a significant hinderance fir any substantial crossing in early units due to relative strength)

Hydromancerx
Feb 19, 2012, 11:35 PM
@AIAndy

Can you make a tag that hides units on the unit upgrade tree? I would like to apply them to the culture units only so the upgrade tree is easier to read, but I still want the culture units to be able to upgrade to other units.

AIAndy
Feb 20, 2012, 12:48 AM
Is there a tag that allows for say +:hammers: per population much like there is +:health: per population?
What would that apply to? Buildings?

Hydromancerx
Feb 20, 2012, 01:19 AM
What would that apply to? Buildings?

For instance the Aqueduct gives +0.15 :health: Per Citizen. I would like to do the same but with :hammers:.

Micael
Feb 20, 2012, 05:53 AM
It's possible, but it would be extremely powerful, since it would enable to tech trade much earlier potentially. So would need to be used very carefully (though deep ocean critters like giant squid would be a significant hinderance fir any substantial crossing in early units due to relative strength)

Yes, it would be quite powerful, but as you've pointed out there are many powerful creatures in the ocean in the early stages of the game which will simply rip ships apart (and so they should- everyone should fear the Kraken), and with the slow movement speed on a Galley, I doubt that anyone will Circumnavigate the globe or meet too many trading partners, especially on a larger map.

The whole idea behind it is for Civs who are mostly coastal, they will have learnt to cross the oceans earlier (e.g. like a Polynesia style civ). And there has been (limited) evidence of Ancient cultures interacting, and the vikings reaching America, and so on, so it makes sense Historically.

Is it also possible to have a <bCanMoveIce> for Land Units (it would enable them to walk over ice floats regardless of coast/ocean).

Koshling
Feb 20, 2012, 07:15 AM
Yes, it would be quite powerful, but as you've pointed out there are many powerful creatures in the ocean in the early stages of the game which will simply rip ships apart (and so they should- everyone should fear the Kraken), and with the slow movement speed on a Galley, I doubt that anyone will Circumnavigate the globe or meet too many trading partners, especially on a larger map.

The whole idea behind it is for Civs who are mostly coastal, they will have learnt to cross the oceans earlier (e.g. like a Polynesia style civ). And there has been (limited) evidence of Ancient cultures interacting, and the vikings reaching America, and so on, so it makes sense Historically.

Is it also possible to have a <bCanMoveIce> for Land Units (it would enable them to walk over ice floats regardless of coast/ocean).

Both of these are definately possible.

Micael
Feb 20, 2012, 09:22 AM
That's great news. Those two tags will let the custom promotions for Cultural Heritage work.

This is therefore my official request for the two tags:
<bCanMoveOceans> (allows ships to cross oceans without astronomy)
<bCanMoveIce> (allows land units to walk over ice, regardless of coast/ocean beneath).

- Micael

Koshling
Feb 20, 2012, 12:54 PM
I'm happy to do a few of these this (V22) cycle. We just need to prioritise. So, for starters, who of the requestors is confident they will make use of something they have asked for within the v22 cycle?

ls612
Feb 20, 2012, 12:58 PM
I'm happy to do a few of these this (V22) cycle. We just need to prioritise. So, for starters, who of the requestors is confident they will make use of something they have asked for within the v22 cycle?

I've already made the unit that wants to use multiple transport domains, I'd only have to change a couple lines of XML to add it once the tag change is made.

Micael
Feb 20, 2012, 01:18 PM
Since we're aiming to finish the ideas for Cultural Heritage by the v23 or v24 cycle (and then has to be implemented), the tags I've requested don't really need to get done straight away.

Vokarya
Feb 27, 2012, 09:27 AM
I'm happy to do a few of these this (V22) cycle. We just need to prioritise. So, for starters, who of the requestors is confident they will make use of something they have asked for within the v22 cycle?

I have at least five Wonder ideas that are waiting on the <BuildingExtraCommerces> tag for their complete implementation.

These are the ones that I know just need that XML tag:

Giverny (Monet's Garden): +4 culture from Art Gallery
Orient Express: +2 espionage from Railroad Station
Pleistocene Park: +5 gold and science from all Megafauna Trainers
Dinosaur Park: +10 science from Paleontology Lab
Monte Carlo: +4 culture from Casino

Koshling
Feb 27, 2012, 09:40 AM
I have at least five Wonder ideas that are waiting on the <BuildingExtraCommerces> tag for their complete implementation.

These are the ones that I know just need that XML tag:

Giverny (Monet's Garden): +4 culture from Art Gallery
Orient Express: +2 espionage from Railroad Station
Pleistocene Park: +5 gold and science from all Megafauna Trainers
Dinosaur Park: +10 science from Paleontology Lab
Monte Carlo: +4 culture from Casino


I'm a bit snowed under with performance issues and a week or so's worth of AI changes after that right now, but I should be able to do these then.

Note posts in another thread (think it was the SVN thread) about changes Hydro has made to the art gallery (subject to some discusion there, so possibly in flux), which might make the effect on Monet's Garden not quite what you want.

AIAndy
Feb 27, 2012, 10:08 AM
I've been busy with the extended property system so not a lot of tag work in the last time from me. I'll try to find the time to do that single tag at least in the next days.

Vokarya
Feb 27, 2012, 10:32 AM
I'm a bit snowed under with performance issues and a week or so's worth of AI changes after that right now, but I should be able to do these then.

Note posts in another thread (think it was the SVN thread) about changes Hydro has made to the art gallery (subject to some discusion there, so possibly in flux), which might make the effect on Monet's Garden not quite what you want.

OK. I did read the discussion of the Art Gallery. I have several other Wonder ideas for the art technologies, so maybe we can reduce the existing Art Gallery effects and then it won't be too strong as a generic building.

Nevets_
Mar 02, 2012, 01:38 PM
Koshling, in the SVN thread you mentioned tanneries going obsolete and losing access to leather, and Hydro said there was a backlog of factories to make. What if instead of having one building turn a single raw resource into a single finished good (like Carcass -> Tannery -> Leather, or Carcass -> Boneworker -> Bone) you added a multientry tag that would allow a single building to process any raw resources it has available into their appropriate finished goods. So a factory could produce Leather if it has access to carcasses, and medicine if it has access to chemicals, etc. This might help with the building bloat and avoid having a whole bunch of different "Modern _____" buildings.

Something like:


<ProcessedGoods>
<ProcessedGood>
<InputGood>RESOURCE_A</InputGood>
<OutputGood>RESOURCE_B</OutputGood>
</ProcessedGood>
<ProcessedGood>
<InputGood>RESOURCE_X</InputGood>
<OutputGood>RESOURCE_Y</OutputGood>
</ProcessedGood>
</ProcessedGoods>


So if the building has access to A, it produces B. If it has access to X, it produces Y. Access to A or X is not required to build the building, so you could pre-build it before you finish the mine/road/orchard/conquest you need to grab the resource, but it wouldn't do anything (besides giving base :science:/:gold:/etc.) until you get that resource.

Might be useful for some other kinds of buildings that would have 2 tiers of products, like a Potter's Hut that gives you Pottery +:health: with clay, but if you have fine clay you also get Chinaware +:health: + :).

Koshling
Mar 02, 2012, 01:55 PM
Koshling, in the SVN thread you mentioned tanneries going obsolete and losing access to leather, and Hydro said there was a backlog of factories to make. What if instead of having one building turn a single raw resource into a single finished good (like Carcass -> Tannery -> Leather, or Carcass -> Boneworker -> Bone) you added a multientry tag that would allow a single building to process any raw resources it has available into their appropriate finished goods. So a factory could produce Leather if it has access to carcasses, and medicine if it has access to chemicals, etc. This might help with the building bloat and avoid having a whole bunch of different "Modern _____" buildings.

Something like:


<ProcessedGoods>
<ProcessedGood>
<InputGood>RESOURCE_A</InputGood>
<OutputGood>RESOURCE_B</OutputGood>
</ProcessedGood>
<ProcessedGood>
<InputGood>RESOURCE_X</InputGood>
<OutputGood>RESOURCE_Y</OutputGood>
</ProcessedGood>
</ProcessedGoods>


So if the building has access to A, it produces B. If it has access to X, it produces Y. Access to A or X is not required to build the building, so you could pre-build it before you finish the mine/road/orchard/conquest you need to grab the resource, but it wouldn't do anything (besides giving base :science:/:gold:/etc.) until you get that resource.

Might be useful for some other kinds of buildings that would have 2 tiers of products, like a Potter's Hut that gives you Pottery +:health: with clay, but if you have fine clay you also get Chinaware +:health: + :).

This question would be better asked of Hydro, since mostly these are his buildings and resource lines. Technically what you suggest is probably feasible.

Dancing Hoskuld
Mar 02, 2012, 04:43 PM
I mentioned this before but did not give much detail.

1) Wild sea creatures are getting damage from terrain features ie reefs and coral whereas they should not.

2) Is it possible to reduce the damage received from terrain features based on technologies and or promotions. For example tech= astrolabe reduces chance of damage (or damage) by 50%. Promotion "Coastal Defense" reduces chance of damage (or damage) by 10%.

AIAndy
Mar 08, 2012, 02:22 AM
I have at least five Wonder ideas that are waiting on the <BuildingExtraCommerces> tag for their complete implementation.

These are the ones that I know just need that XML tag:

Giverny (Monet's Garden): +4 culture from Art Gallery
Orient Express: +2 espionage from Railroad Station
Pleistocene Park: +5 gold and science from all Megafauna Trainers
Dinosaur Park: +10 science from Paleontology Lab
Monte Carlo: +4 culture from Casino

I had a look into it but this tag is a rather difficult one. Especially I am unsure how this should be implemented to interact properly with the modifier recalculation.
So since I have very little time for modding at the moment I pass on this one.

Vokarya
Mar 08, 2012, 07:04 AM
I had a look into it but this tag is a rather difficult one. Especially I am unsure how this should be implemented to interact properly with the modifier recalculation.
So since I have very little time for modding at the moment I pass on this one.

OK. It can wait until someone has time to work on it properly. I think this is a huge area that is missing in the ability to code: you can adjust building commerces with events and technologies but not other buildings.

Koshling
Mar 08, 2012, 03:36 PM
OK. It can wait until someone has time to work on it properly. I think this is a huge area that is missing in the ability to code: you can adjust building commerces with events and technologies but not other buildings.

Ok, I've done this and it's now active in the latest SVN.

I only modified the core schema in assets/xml/buildings/C2C_CIV4BuildingsSchema.xml, so if you need it in a module be sure to update the schema copy there also. The extra schema element is:
<ElementType name="BuildingExtraCommerce" content="eltOnly">
<element type="BuildingClass"/>
<element type="CommerceType"/>
<element type="iExtraCommerce"/>
</ElementType>
<ElementType name="GlobalBuildingExtraCommerces" content="eltOnly">
<element type="BuildingExtraCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>


I just did a simplistic test, adding this to an existing building, and checking that when one is built it grants the culture/research effects on the building player's forges and granaries everywhere:
<GlobalBuildingExtraCommerces>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_FORGE</BuildingClass>
<CommerceType>COMMERCE_CULTURE</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_GRANARY</BuildingClass>
<CommerceType>COMMERCE_RESEARCH</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
</GlobalBuildingExtraCommerces>


Note - at least for now use of this tag should be restricted to wonders (national or great), because if you put it on a normal building then EACH one you build will grant the global effect!

Also note that I decided to call it 'GlobalBuildingExtraCommerces' not just 'BuildingExtraCommerces', to reflect the fact that its effect is in all the player's cities, not just the one the triggering building is built in.

I have updated the building hover text generation to take account of this new tag also, but not yet updated the AI to evaluate it (will do that once the Wonders are in - let me know)

platyping
Mar 08, 2012, 05:27 PM
Since you can do this, you might as well do it for ExtraYield, ExtraHappiness and ExtraHealth since these are all what python can do besides ExtraCommerce :D

Vokarya
Mar 09, 2012, 12:01 PM
Ok, I've done this and it's now active in the latest SVN.

I only modified the core schema in assets/xml/buildings/C2C_CIV4BuildingsSchema.xml, so if you need it in a module be sure to update the schema copy there also. The extra schema element is:
<ElementType name="BuildingExtraCommerce" content="eltOnly">
<element type="BuildingClass"/>
<element type="CommerceType"/>
<element type="iExtraCommerce"/>
</ElementType>
<ElementType name="GlobalBuildingExtraCommerces" content="eltOnly">
<element type="BuildingExtraCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>


I just did a simplistic test, adding this to an existing building, and checking that when one is built it grants the culture/research effects on the building player's forges and granaries everywhere:
<GlobalBuildingExtraCommerces>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_FORGE</BuildingClass>
<CommerceType>COMMERCE_CULTURE</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_GRANARY</BuildingClass>
<CommerceType>COMMERCE_RESEARCH</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
</GlobalBuildingExtraCommerces>


Note - at least for now use of this tag should be restricted to wonders (national or great), because if you put it on a normal building then EACH one you build will grant the global effect!

Also note that I decided to call it 'GlobalBuildingExtraCommerces' not just 'BuildingExtraCommerces', to reflect the fact that its effect is in all the player's cities, not just the one the triggering building is built in.

I have updated the building hover text generation to take account of this new tag also, but not yet updated the AI to evaluate it (will do that once the Wonders are in - let me know)

Thank you very, very much. I'm trying out my first Wonder with it now; looks like it's working great. I did notice a couple of minor graphical issues:

The commerce bonuses do not show up in the Civilopedia entry.
On the hovertext, could the commerce bonuses show up below the Wonder designation? I feel like that needs to be first.
Also, would it be possible to close up the space between the amount of commerce generated and the symbol? I don't think the Civilopedia puts spaces there whenever it has a number/symbol combination.


Here's a screenshot of a Wonder using this new tag. The TXT_KEY_FIRE_HANGER is a separate issue that I put in the v21 bugs thread.

Koshling
Mar 09, 2012, 12:04 PM
Thank you very, very much. I'm trying out my first Wonder with it now; looks like it's working great. I did notice a couple of minor graphical issues:

The commerce bonuses do not show up in the Civilopedia entry.
On the hovertext, could the commerce bonuses show up below the Wonder designation? I feel like that needs to be first.
Also, would it be possible to close up the space between the amount of commerce generated and the symbol? I don't think the Civilopedia puts spaces there whenever it has a number/symbol combination.


Here's a screenshot of a Wonder using this new tag. The TXT_KEY_FIRE_HANGER is a separate issue that I put in the v21 bugs thread.

Pedia - sure np
Vertical positioning on hover text - sure
Spacing - not sure - this is making use of a common routine used in other places also

Vokarya
Mar 09, 2012, 12:46 PM
Pedia - sure np
Vertical positioning on hover text - sure
Spacing - not sure - this is making use of a common routine used in other places also

OK, thanks. I was just asking if it could be done.

Baskedyt
Mar 10, 2012, 10:15 AM
I have three ideas for tags for promotions.

1. Would it be possible to make a Replace_promo tag?

Right now one can only make a promotion req another, but not replace it, like port replace the harbour building. And the musketman replace heavy pikeman.

I was thinking of making a system of weapons, armour and other equipment promotions. And I would like it so that, for example Iron weapons replace bronze weapons, and plate armour replaces chain mail, and so on.
Otherwise one unit can end up with all kinds of weapons.

2. The other is a Not_upgradeable (boolean) tag.
When tag value is true, the unit looses the promotion in question when it is upgraded. That way when you upgrade from let's say heavy pikeman to musketman, your pike weapon promotion and possible armour, does not follow along.
That way the equipment promotions does not pile up over time. Like now when you can have mech inf. units with bamboo armour :crazyeye:

3. The last one is a Cost_per_turn tag
Like you can have extra unit cost per turn, I would like to have the same options to promotions. Chain mail and steel swords is very expensive, and I would like to able to reflect that in the equipment promotions. And if it is not to hard, would it be possible to make it work with decimal values? (ex. 0.2:gold:)

I hope my ideas make sense :)

Hydromancerx
Mar 10, 2012, 04:16 PM
I was thinking of making a system of weapons, armour and other equipment promotions. And I would like it so that, for example Iron weapons replace bronze weapons, and plate armour replaces chain mail, and so on.
Otherwise one unit can end up with all kinds of weapons.


I have been wanting to do this exact thing. Its kind of weird when future units still have bamboo armor. Perhaps an obsolete tech could be applied too to existing units where their promotions won't work anymore.

ls612
Mar 10, 2012, 05:35 PM
I have been wanting to do this exact thing. Its kind of weird when future units still have bamboo armor. Perhaps an obsolete tech could be applied too to existing units where their promotions won't work anymore.

What? Didn't you know bamboo has extraordinary laser-dissapation properties? :D

BlueGenie
Mar 21, 2012, 01:40 PM
Hi. First post for me here. *smile*

AIAndy, is it possible to get a tag for improvements that makes the plot one wants to build it on require one side being coast? With other words <bRequiresCoastSide>.

Cheers

AIAndy
Mar 21, 2012, 04:15 PM
Hi. First post for me here. *smile*

AIAndy, is it possible to get a tag for improvements that makes the plot one wants to build it on require one side being coast? With other words <bRequiresCoastSide>.

Cheers
Yes, definitely possible.
I'll add it to the list.

Hydromancerx
Mar 21, 2012, 04:49 PM
@AIAndy

If its not already on your todo list, I request +/- crime per turn given to unit promotions for where units with a promotion that has that feature will generate +/- crime they standing for that turn.

ls612
Mar 21, 2012, 05:00 PM
@AIAndy

If its not already on your todo list, I request +/- crime per turn given to unit promotions for where units with a promotion that has that feature will generate +/- crime they standing for that turn.

Is this not already possible with what the Extended Property System already offers? I know that Units can now be given those modifiers, and the PromotionInfos XML uses the same schema as the UnitInfos XML, so I'd assume that functionality is already in place.

At any rate, I'm thinking I'll hold off until after the freeze is over and V22 is out before adding any crime mods to units, as Koshling has hinted that would require significant AI work.

Hydromancerx
Mar 21, 2012, 05:07 PM
If it is possible could someone show me how to add it to a promotion?

Koshling
Mar 21, 2012, 06:49 PM
Is this not already possible with what the Extended Property System already offers? I know that Units can now be given those modifiers, and the PromotionInfos XML uses the same schema as the UnitInfos XML, so I'd assume that functionality is already in place.

At any rate, I'm thinking I'll hold off until after the freeze is over and V22 is out before adding any crime mods to units, as Koshling has hinted that would require significant AI work.

They are not the same thing, so I'm unsure if aiandy added property manipulators to promotions or not ( but it shouldnt be hard if not).

In regard to the AI, units that act as crime reducers shouldn't be too hard to cope with (though it will need a bunch of new routines, so I would prefer not before v22). Units that act as crime sources, will be a lot harder to deal with, because they imply entirely new strategies whereby to deliberately spread crime to your enemies.

Hanny
Mar 21, 2012, 06:56 PM
@AIAndy

If its not already on your todo list, I request +/- crime per turn given to unit promotions for where units with a promotion that has that feature will generate +/- crime they standing for that turn.

Are you sure thata good method?, does it not require every unit to have an age in game play turns,so it can increase by 1, this sounds like a hugue drain on resources.

AIAndy
Mar 21, 2012, 07:35 PM
They are not the same thing, so I'm unsure if aiandy added property manipulators to promotions or not ( but it shouldnt be hard if not).
I have added property manipulators to most stuff including promotions, unit types, civics, traits, routes, improvements, features, resources, terrains, religions and corporations.
There is just a minor code change missing that makes the <GameObjectType> apply to non global property manipulators (I might go one step further and allow the RelationType tag for that as well). With that you can then have the property manipulator on the promotion not apply to the unit but to the city in which the unit is.

BlueGenie
Mar 22, 2012, 04:54 AM
For what does one use the bNoAdjacent tag, and how?

Cheers

AIAndy
Mar 22, 2012, 04:59 AM
For what does one use the bNoAdjacent tag, and how?

Cheers
It is a boolean tag that if true prevents that feature from being spawned on two adjacent plots (so there is always a plot without the feature in between).

BlueGenie
Mar 22, 2012, 05:00 AM
Only for features or can one use it for improvements too?

Cheers

AIAndy
Mar 22, 2012, 05:02 AM
Only for features or can one use it for improvements too?

Cheers
It is only implemented for features at the moment.

BlueGenie
Mar 22, 2012, 05:07 AM
I'd need something to separate Fishing Villages from each other, so they can't be placed right next to each other. Either if the bNoAdjacent tag can be extended to include improvements or if something else can be arranged, please?

Might be good for the Cottage line too, especially if they are "fixed" and made more viable than they are now as they can then be made good even as one can't spam them?

Cheers

Edit: Actually it would have to be a tag where I can specify several NoAdjacent, one for each level of the improvement.
Just let me know if I'm asking too much. *smile*
Oh, also need to know if this:
<PrereqTech>TECH_TRADE</PrereqTech>
<TechTypes>
<PrereqTech>TECH_SAILING</PrereqTech>
</TechTypes>
would work for an improvement?

Cheers

Hydromancerx
Mar 22, 2012, 02:21 PM
Is there a way to have code where a buildings gives a free building only to that city? In other words when you build one building you get 2 buildings?

Vokarya
Mar 23, 2012, 12:15 PM
This came up in my Wonders thread. Would it be possible to create a <BuildingMovementChanges> tag similar to <TechMovementChanges> to adjust the speed of moving on various routes? This tag would go on the building, not the route type.

Something like this:
<BuildingMovementChanges>
<BuildingMovementChange>
<RouteType>ROUTE_ROAD</RouteType>
<iMovementChange>-10</iMovementChange>
</BuildingMovementChange>
</BuildingMovementChanges>

This would give you +1 movement on roads if you built the building with this code. I would be using it on Wonders, but it could theoretically go on any building.

Hydromancerx
Apr 18, 2012, 01:29 AM
If there is not already one could a <PrereqAndBonuses> be added to units?

Right now you can have ...

<BonusType>BONUS_FRENCH</BonusType>
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>BONUS_STEEL</BonusType>
</PrereqBonuses>

Which comes out to French AND (Copper OR Iron OR Steel). But what if I want to have French AND Copper AND Iron AND Steel? I can only have French AND Copper at the most for and. Please make it so I can have more than just 2 ANDs.

Dancing Hoskuld
Apr 21, 2012, 04:58 PM
I think we need we need some terrain tags to indicate which multi-map they belong on. Resources and Features don't need them because they already link to terrains which means we can use the same resource or feature on any map already.

Which brings up the point of what maps are we intending to implement. If I am going to convert terrains from Mars Now and Song of the Moon 2 I need to define/identify them in someway for the correct map script to use the correct terrains.

AIAndy
Apr 21, 2012, 05:31 PM
I think we need we need some terrain tags to indicate which multi-map they belong on. Resources and Features don't need them because they already link to terrains which means we can use the same resource or feature on any map already.

Which brings up the point of what maps are we intending to implement. If I am going to convert terrains from Mars Now and Song of the Moon 2 I need to define/identify them in someway for the correct map script to use the correct terrains.
There is currently no generic terrain placement. All are kind of hard coded in the map scripts themselves.

ls612
Apr 22, 2012, 09:49 AM
There is currently no generic terrain placement. All are kind of hard coded in the map scripts themselves.

That brings up a very good question, and that is, How do we intend to generate multiple maps?

Currently, I can see two ways to go about it, but you may have other ideas. Mine are;

1. Make all maps generated by the same mapscript. If you select PW3 (for instance), then you would get a map with a PW3 Earth map, a PW3 Moon map, a PW3 Galactic Map, and so forth. This would however mean less flexibility, so all things being equal, I would prefer option 2.

2. Make 4 different mapscript selections in the game start area. This way, you could choose a PW3 Earth map, and then a unique Moon mapscript (craters or something), a unique Mars mapscript, and so on. I don't know if this one is possible, but if it is, then it would seem to me the best option.

What do you think of these, and do you have any other ideas for how to do this?

Stemer
Apr 22, 2012, 10:01 AM
What about choosing the mapscript for earth and the Galactic map, but having other planets/moons use a random mapscript?

AIAndy
Apr 22, 2012, 11:01 AM
That brings up a very good question, and that is, How do we intend to generate multiple maps?

Currently, I can see two ways to go about it, but you may have other ideas. Mine are;

1. Make all maps generated by the same mapscript. If you select PW3 (for instance), then you would get a map with a PW3 Earth map, a PW3 Moon map, a PW3 Galactic Map, and so forth. This would however mean less flexibility, so all things being equal, I would prefer option 2.

2. Make 4 different mapscript selections in the game start area. This way, you could choose a PW3 Earth map, and then a unique Moon mapscript (craters or something), a unique Mars mapscript, and so on. I don't know if this one is possible, but if it is, then it would seem to me the best option.

What do you think of these, and do you have any other ideas for how to do this?
PW3 and the other current map scripts are only suited to make earth maps. For the other maps you need different code.

And I'd say only generate the maps (and select whatever options we end up with) when they first come into play.

Hydromancerx
Apr 22, 2012, 11:10 AM
@AIAndy

So what do you think we should do for generating Moon and Mars maps? Should we used the ones from Mars Now and Song of the Moon 2? If so how do you apply a different map script to each of the multi-maps?

AIAndy
Apr 22, 2012, 11:25 AM
@AIAndy

So what do you think we should do for generating Moon and Mars maps? Should we used the ones from Mars Now and Song of the Moon 2? If so how do you apply a different map script to each of the multi-maps?
Well, there could be some in game UI that you can use to select the map script you want to use when it is time to generate the other maps.
But maybe we should continue that discussion in a more fitting thread.

ls612
Apr 22, 2012, 11:36 AM
Well, there could be some in game UI that you can use to select the map script you want to use when it is time to generate the other maps.
But maybe we should continue that discussion in a more fitting thread.

We can continue this discussion Here (http://forums.civfanatics.com/showthread.php?t=460023).

strategyonly
Apr 23, 2012, 06:11 AM
AIAndy:

Where can i get something like this done, or is there something like this already inplace for tags etc??


<CivilizationInfo>
<Type>CIVILIZATION_TUPI</Type>
<Leader>LEADER_TUPI_TRIBE</Leader>
<SpawnTech>TECH_ARCHERY</SpawnTech>
<NumberOfSpawnTech>2</NumberOfSpawnTech>
<SpawnChance>60</SpawnChance>
<IsBarbarianCiv>True</IsBarbarianCiv>
<StartAtCoast>False</StartAtCoast>
<TotalGold>25</TotalGold>
<TechPercent>15</TechPercent>
<DefaultShips>NONE</DefaultShips>
<NumberShipsPerCity>0</NumberShipsPerCity>
<NumberOfCities>1</NumberOfCities>
<StartX>-1</StartX>
<StartY>-1</StartY>
<NumWorkerPerCity>0</NumWorkerPerCity>
<CapitalCityUnit>UNIT_CUNHAMBEBE</CapitalCityUnit>
<NumCapitalUnit>1</NumCapitalUnit>
<DefaultCityDefender>UNIT_JAVELINEER</DefaultCityDefender>
<NumberCityDefendersPerCity>1</NumberCityDefendersPerCity>
<DefaultSecondUnit>UNIT_WARRIOR<DefaultSecondUnit>
<NumberSecondUnit>1</NumberSecondUnit>
</CivilizationInfo>

AIAndy
Apr 23, 2012, 06:48 AM
AIAndy:

Where can i get something like this done, or is there something like this already inplace for tags etc??


<CivilizationInfo>
<Type>CIVILIZATION_TUPI</Type>
<Leader>LEADER_TUPI_TRIBE</Leader>
<SpawnTech>TECH_ARCHERY</SpawnTech>
<NumberOfSpawnTech>2</NumberOfSpawnTech>
<SpawnChance>60</SpawnChance>
<IsBarbarianCiv>True</IsBarbarianCiv>
<StartAtCoast>False</StartAtCoast>
<TotalGold>25</TotalGold>
<TechPercent>15</TechPercent>
<DefaultShips>NONE</DefaultShips>
<NumberShipsPerCity>0</NumberShipsPerCity>
<NumberOfCities>1</NumberOfCities>
<StartX>-1</StartX>
<StartY>-1</StartY>
<NumWorkerPerCity>0</NumWorkerPerCity>
<CapitalCityUnit>UNIT_CUNHAMBEBE</CapitalCityUnit>
<NumCapitalUnit>1</NumCapitalUnit>
<DefaultCityDefender>UNIT_JAVELINEER</DefaultCityDefender>
<NumberCityDefendersPerCity>1</NumberCityDefendersPerCity>
<DefaultSecondUnit>UNIT_WARRIOR<DefaultSecondUnit>
<NumberSecondUnit>1</NumberSecondUnit>
</CivilizationInfo>
No, there is no system in place to spawn specific Civs at specific times in specific places.
Not sure if such a system even fits C2C in general.

Dancing Hoskuld
Apr 23, 2012, 06:55 AM
AIAndy:

Where can i get something like this done, or is there something like this already inplace for tags etc??


<CivilizationInfo>
<Type>CIVILIZATION_TUPI</Type>
<Leader>LEADER_TUPI_TRIBE</Leader>
<SpawnTech>TECH_ARCHERY</SpawnTech>
<NumberOfSpawnTech>2</NumberOfSpawnTech>
<SpawnChance>60</SpawnChance>
<IsBarbarianCiv>True</IsBarbarianCiv>
<StartAtCoast>False</StartAtCoast>
<TotalGold>25</TotalGold>
<TechPercent>15</TechPercent>
<DefaultShips>NONE</DefaultShips>
<NumberShipsPerCity>0</NumberShipsPerCity>
<NumberOfCities>1</NumberOfCities>
<StartX>-1</StartX>
<StartY>-1</StartY>
<NumWorkerPerCity>0</NumWorkerPerCity>
<CapitalCityUnit>UNIT_CUNHAMBEBE</CapitalCityUnit>
<NumCapitalUnit>1</NumCapitalUnit>
<DefaultCityDefender>UNIT_JAVELINEER</DefaultCityDefender>
<NumberCityDefendersPerCity>1</NumberCityDefendersPerCity>
<DefaultSecondUnit>UNIT_WARRIOR<DefaultSecondUnit>
<NumberSecondUnit>1</NumberSecondUnit>
</CivilizationInfo>

The "Spawn a Civ" mod only makes sense for scenarios. Is this what you were after when you asked me earlier, something for scenarios? Otherwise it does not make sense for C2C in general as we already have "Barbarian Civ" which basically does the same thing but random civs rather than specific nations at specific times and places.

BlueGenie
Apr 23, 2012, 11:06 AM
It makes sense from the Alien threat view.

Cheers

Dancing Hoskuld
Apr 28, 2012, 03:49 PM
For religions new tags:-

<StateReilionYields>
<StateReligionComerceChanges>
<StateReligionFreeXPs> - number of XP per unit combat type including all
<StateReligionFreePromotions> - free promotion per unit combat type including all


Many people complain that the benefits from a religion should only flow if it is your State Religion. These would at least let us try it out and see.

there is already a <StareReligion...> tag but that provides a boost to the city from all state religion buildings world wide.

Hydromancerx
May 08, 2012, 11:18 PM
If there is not already one could a <PrereqAndBonuses> be added to units?

Right now you can have ...

<BonusType>BONUS_FRENCH</BonusType>
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>BONUS_STEEL</BonusType>
</PrereqBonuses>

Which comes out to French AND (Copper OR Iron OR Steel). But what if I want to have French AND Copper AND Iron AND Steel? I can only have French AND Copper at the most for and. Please make it so I can have more than just 2 ANDs.

Please don't forget this. This tag is very important to implementing to units.

Hydromancerx
May 29, 2012, 03:57 PM
Can you make a no freshwater tag? One that if applied to a building would cancel out the freshwater in a city even if other buildings like wells provide it? I want to have a water pollution building that stops the freshwater if it gets too polluted.

ls612
May 29, 2012, 04:34 PM
Could we please have a tag added that would allow you to specify build rate bonuses for certain improvements? IE, so that a Combat Worker could have +25% construction bonus on forts and roads, and a -25% penalty on building other stuff? I need this to make the Armed Workers balanced and fit their niche.

CIVPlayer8
May 29, 2012, 07:52 PM
Sorry to tack on to someone's unending list, but I request we make some kind of tag that makes one civic require another to be active. Example: Military Vassalage requires Society: Feudal.

Hydromancerx
May 29, 2012, 10:33 PM
That's actually a good idea for a request CIVPlayer8. I second that request.

Thunderbrd
May 30, 2012, 12:47 AM
I'm currently practicing some tag making myself for my own projects. Each one is a major research for me to figure out then how to apply it in the code to make it do what its designed to. I'd LOVE to help with all of these requests but you're going to have to be very patient with me. The others are admittedly much more advanced in their programming skills! But with each success I get a little more capable overall. I'm loving some of these tag ideas and can see how each could be rather easily implemented (comparatively anyhow... each would still take quite a bit of time for me at the moment.)

So eventually, I'll come back to these requests and go all out to fulfill what you guys want to see... but I'm trying to sort out a few things of my own and having a lot of difficulty with the complexity of the combat/unit coding and how many places those tags show up in the code - its mind boggling!

Dancing Hoskuld
May 30, 2012, 02:26 AM
Sorry to tack on to someone's unending list, but I request we make some kind of tag that makes one civic require another to be active. Example: Military Vassalage requires Society: Feudal.

That's actually a good idea for a request CIVPlayer8. I second that request.

An interesting idea but how will you make it work
- with the User Interface Civics Screen it is going to mean much scrolling around
- when a new civic is available up pops a box asking if you want to convert to it. What if you can't?
- with the UN votes

CIVPlayer8
May 30, 2012, 03:18 PM
Maybe... If you try to start a revolution without the correct required civics, it would say "Sorry, requirements not met" and you would not be able to change civics unless you met those requirements. As for the UN... To be honest... I never really liked the idea of forcing you to change civics. Not all countries are a part of the UN, and making a country change from a dictatorship to a democracy is... Well... Unheard of. I suggest scrapping the UN force civic.

Koshling
May 30, 2012, 05:44 PM
Maybe... If you try to start a revolution without the correct required civics, it would say "Sorry, requirements not met" and you would not be able to change civics unless you met those requirements. As for the UN... To be honest... I never really liked the idea of forcing you to change civics. Not all countries are a part of the UN, and making a country change from a dictatorship to a democracy is... Well... Unheard of. I suggest scrapping the UN force civic.

The ai would need some rework to handle the concept of legal civic choices not being independent

Thunderbrd
May 30, 2012, 08:03 PM
I was sortof thinking that it'd be a one-time check... if you currently have adopted the qualifying civic, you can switch to the civic that requires it, but if you end up changing the qualifying civic, it would not enforce any such change to the civic with the prereq. This would mean its a condition only checked when attempting to adopt the civic with the prereq. Otherwise you'd have a lot of problematic programming elements coming up. Would this be a sufficient solution or would it throw off the concept we're aiming at?

Koshling
May 30, 2012, 08:47 PM
I was sortof thinking that it'd be a one-time check... if you currently have adopted the qualifying civic, you can switch to the civic that requires it, but if you end up changing the qualifying civic, it would not enforce any such change to the civic with the prereq. This would mean its a condition only checked when attempting to adopt the civic with the prereq. Otherwise you'd have a lot of problematic programming elements coming up. Would this be a sufficient solution or would it throw off the concept we're aiming at?

The AI doesn't look at changing single civics, it looks at the best civic in all categories at once as a set, so if it decided the best in category A was alpha and in category B was beTa, but alpha was only legal with the current choice in B (not beta) it would fail when it tried to change to it's new selection set. It would have to change to iterate a one at a time change until the overall set stabilized (which of course it might never do if the optimal choice in one category changes based on becoming legal after it chooses something else, which in turn becomes sub optimal when it makes that second change)

Thunderbrd
May 30, 2012, 08:50 PM
Yeah, I can see how that would be problematic for sure! It'd take a lot more evaluating to get the ai right on that sort of thing and without it, we'd have hangs for sure.

Hydromancerx
Jun 05, 2012, 09:36 PM
If there is not already one could a <PrereqAndBonuses> be added to units?

Right now you can have ...

<BonusType>BONUS_FRENCH</BonusType>
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>BONUS_STEEL</BonusType>
</PrereqBonuses>

Which comes out to French AND (Copper OR Iron OR Steel). But what if I want to have French AND Copper AND Iron AND Steel? I can only have French AND Copper at the most for and. Please make it so I can have more than just 2 ANDs.

So I was looking in Realism Inviticus and their code seems to work different from ours. IF you put ...

<BonusType>BONUS_COPPER</BonusType>
<PrereqBonuses>
<BonusType>BONUS_SILVER</BonusType>
<BonusType>BONUS_GOLD</BonusType>
</PrereqBonuses>

into C2C it will come out as ...

Copper AND (Silver OR Gold)

but in Realism Inviticus it comes out to ...

Copper AND Silver AND Gold

Could you please make code that allows for OR and AND. Thanks!

AIAndy
Jun 06, 2012, 01:49 AM
So I was looking in Realism Inviticus and their code seems to work different from ours. IF you put ...

<BonusType>BONUS_COPPER</BonusType>
<PrereqBonuses>
<BonusType>BONUS_SILVER</BonusType>
<BonusType>BONUS_GOLD</BonusType>
</PrereqBonuses>

into C2C it will come out as ...

Copper AND (Silver OR Gold)

but in Realism Inviticus it comes out to ...

Copper AND Silver AND Gold

Could you please make code that allows for OR and AND. Thanks!
The expression system will solve that for good once it is finished as it allows you to specify any combination of AND/OR/NOT and similar with resources/buildings/whatever.

Hydromancerx
Jun 21, 2012, 05:26 PM
Is the code in the expression system in the mod for this (resource A + B + C)? If so what code do I need to do?

AIAndy
Jun 21, 2012, 05:43 PM
Is the code in the expression system in the mod for this (resource A + B + C)? If so what code do I need to do?
Yes, but I still need to add a ConstructCondition/TrainCondition expression tag to buildings/units (should be done some time this weekend although with the restriction that the AI will not understand them properly yet) and add display capability to the expression system (so the mouseover will display a proper rendering of the expression requirement).
The code will then look like this:

<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_A</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_B</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_C</ID>
</Has>
</And>
</TrainCondition>


That also allows all kind of combinations like (A or B) and (C or D):

<TrainCondition>
<And>
<Or>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_A</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_B</ID>
</Has>
</Or>
<Or>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_C</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_D</ID>
</Has>
</Or>
</And>
</TrainCondition>

GiuseppeIII
Jun 21, 2012, 08:27 PM
Sorry to tack on to someone's unending list, but I request we make some kind of tag that makes one civic require another to be active. Example: Military Vassalage requires Society: Feudal.

Another tag for civics would be having a civic not be able to be activated if another one is

Koshling
Jun 21, 2012, 08:33 PM
Another tag for civics would be having a civic not be able to be activated if another one is

Neither of these are easy, because introducing dependencies between civic categories would invalidate the algorithm the AI uses to choose it's civics.

Hydromancerx
Jun 21, 2012, 09:36 PM
@AIAndy

What happens if you use the old system of <BonusType> and <PrereqBonuses> with the expression system? What will happen?

AIAndy
Jun 22, 2012, 12:41 AM
@AIAndy

What happens if you use the old system of <BonusType> and <PrereqBonuses> with the expression system? What will happen?
I don't quite get what you mean.
<BonusType> or <PrereqBonuses> have no meaning within an expression but they will still work at the places outside expressions where they work now.

Hydromancerx
Jun 22, 2012, 01:01 AM
I don't quite get what you mean.
<BonusType> or <PrereqBonuses> have no meaning within an expression but they will still work at the places outside expressions where they work now.

Lets say I put this code on a unit ....


<BonusType>BONUS_FRENCH</BonusType>
<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_IRON</BonusType>
<BonusType>BONUS_STEEL</BonusType>
</PrereqBonuses>
<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_BANANA</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_LEMON</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_APPLE</ID>
</Has>
</And>
</TrainCondition>


Would it require French AND (Copper OR Iron OR Steel) AND Bananas AND Lemons and Apples?

AIAndy
Jun 22, 2012, 01:27 AM
Would it require French AND (Copper OR Iron OR Steel) AND Bananas AND Lemons and Apples?
Correct.

Hydromancerx
Jun 22, 2012, 02:10 AM
Ok then what happens if i put ...


<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_SILVER</BonusType>
<BonusType>BONUS_GOLD</BonusType
</PrereqBonuses>
<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_SILVER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_GOLD</ID>
</Has>
</And>
</TrainCondition>


Will it be (Copper OR Silver OR Gold) or will it be Copper AND Silver AND Gold?

AIAndy
Jun 22, 2012, 02:24 AM
Ok then what happens if i put ...


<PrereqBonuses>
<BonusType>BONUS_COPPER</BonusType>
<BonusType>BONUS_SILVER</BonusType>
<BonusType>BONUS_GOLD</BonusType
</PrereqBonuses>
<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_SILVER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_GOLD</ID>
</Has>
</And>
</TrainCondition>


Will it be (Copper OR Silver OR Gold) or will it be Copper AND Silver AND Gold?
It is (Copper OR Silver OR Gold) AND (Copper AND Silver AND Gold) which is equivalent to Copper AND Silver AND Gold.
The reason is logic, there is no order of precedence.

ls612
Jun 22, 2012, 01:27 PM
@AIAndy (or anyone else who can help)
<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_SILVER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_GOLD</ID>
</Has>
</And>
</TrainCondition>

Are these tags actually in the code yet? I tried using them for a new Medivac Dropship, and got XML errors (see attached). I do have the latest schema, and have it named to ls612v5_CIV4UnitSchema.xml, so that should not be the issue.

AIAndy
Jun 22, 2012, 01:54 PM
@AIAndy (or anyone else who can help)


Are these tags actually in the code yet? I tried using them for a new Medivac Dropship, and got XML errors (see attached). I do have the latest schema, and have it named to ls612v5_CIV4UnitSchema.xml, so that should not be the issue.
No, not yet.
I quote myself from last page:
I still need to add a ConstructCondition/TrainCondition expression tag to buildings/units (should be done some time this weekend although with the restriction that the AI will not understand them properly yet) and add display capability to the expression system (so the mouseover will display a proper rendering of the expression requirement).

ls612
Jun 22, 2012, 01:58 PM
No, not yet.
I quote myself from last page:

Well, that would explain the load error. Thanks.

anunknownman
Jun 23, 2012, 05:57 AM
just wanted to ask: is <BonusCommerceChanges> a viable tag to put onto a building????

AIAndy
Jun 23, 2012, 08:26 AM
Well, that would explain the load error. Thanks.
Both ConstructCondition on building infos and TrainCondition on unit infos are in the newest SVN now.

strategyonly
Jun 23, 2012, 09:32 AM
Both ConstructCondition on building infos and TrainCondition on unit infos are in the newest SVN now.

Can you do me a favor then, and update your 1/2 posts so people can understand what all these tags do and how to use them, i get a bit overwhelmed looking at all this new information, sorry.:blush:

ls612
Jun 23, 2012, 10:24 AM
Both ConstructCondition on building infos and TrainCondition on unit infos are in the newest SVN now.

Cool, that will enable some nice craziness with the Galactic Era, as soon as the Upgrade tree gets fixed.

AIAndy
Jun 23, 2012, 12:14 PM
Can you do me a favor then, and update your 1/2 posts so people can understand what all these tags do and how to use them, i get a bit overwhelmed looking at all this new information, sorry.:blush:
I'll add a tutorial to the expression system thread.

Koshling
Jun 23, 2012, 12:26 PM
I'll add a tutorial to the expression system thread.

Would be best on the dder's info thread I think for the longer term

AIAndy
Jun 23, 2012, 01:02 PM
Would be best on the dder's info thread I think for the longer term
Can be referenced there then as usual.

strategyonly
Jun 23, 2012, 01:03 PM
Would be best on the dder's info thread I think for the longer term

Can be referenced there then as usual.

Great!!;)

CIVPlayer8
Jul 16, 2012, 05:37 PM
I request that Civics can give additional Yield/Commerce bonuses to buildings. For example, the civic Free Market would give +1 :commerce:and +1 :gold: to the "Supermarket" building. :)

AIAndy
Jul 16, 2012, 06:02 PM
I request that Civics can give additional Yield/Commerce bonuses to buildings. For example, the civic Free Market would give +1 :commerce:and +1 :gold: to the "Supermarket" building. :)
I think you can with "BuildingClassCommerceChanges"

CIVPlayer8
Jul 16, 2012, 06:08 PM
:hammer2: Forgot about the commerce, but is there one for yield?

AIAndy
Jul 17, 2012, 02:05 AM
:hammer2: Forgot about the commerce, but is there one for yield?
I don't see one so probably not.

Hydromancerx
Aug 03, 2012, 04:44 PM
@AIAndy (or anyone else who can help)

<TrainCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_SILVER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_GOLD</ID>
</Has>
</And>
</TrainCondition>

Are these tags actually in the code yet? I tried using them for a new Medivac Dropship, and got XML errors (see attached). I do have the latest schema, and have it named to ls612v5_CIV4UnitSchema.xml, so that should not be the issue.

These are in the code now right?

AIAndy
Aug 03, 2012, 07:00 PM
These are in the code now right?
Yes, they are.

Hydromancerx
Aug 04, 2012, 04:36 PM
@AIAndy

http://forums.civfanatics.com/attachment.php?attachmentid=328122&stc=1&d=1344119783

Could you have the new code show up in the Req section of the pedia with their images. Here you see a Conquistador that requires Spanish AND Firearms AND Sulphur AND Horse. Only the Sulphur shows above since its in the old code. Could you make the new code also shoe up there too.

Thanks!

AIAndy
Aug 04, 2012, 04:43 PM
@AIAndy

http://forums.civfanatics.com/attachment.php?attachmentid=328122&stc=1&d=1344119783

Could you have the new code show up in the Req section of the pedia with their images. Here you see a Conquistador that requires Spanish AND Firearms AND Sulphur AND Horse. Only the Sulphur shows above since its in the old code. Could you make the new code also shoe up there too.

Thanks!
That is non trivial considering that the expression can define quite complex combinations.

Dancing Hoskuld
Aug 10, 2012, 04:46 PM
If I can get the Mangroves feature working and if we want the Natural Wonders mod included we will need some new tags on features. The NW mod has most but is missing the equivalent to land next to sea and sea next to land. I think these both occur on buildings so the same name for the same thing would be good.

Mangroves need to be on swamp terrain next to tropical or temperate coast for example.

ls612
Aug 11, 2012, 08:02 AM
If I can get the Mangroves feature working and if we want the Natural Wonders mod included we will need some new tags on features. The NW mod has most but is missing the equivalent to land next to sea and sea next to land. I think these both occur on buildings so the same name for the same thing would be good.

Mangroves need to be on swamp terrain next to tropical or temperate coast for example.

Are these Natural wonders going to be closer to dacubz's Natural wonders or closer to Platyping's Natural Wonders?

Dancing Hoskuld
Aug 11, 2012, 04:37 PM
They are the same thing. Almost. They are both described in the XML, daxubz just ignores the XML while Platyping uses it just like map scripts do. So p's will only require XML to add and edit while d's require both XML and python.

Vokarya
Aug 16, 2012, 05:31 PM
This came up over in my Old Wonders - New Abilities thread. Could we get an <iGlobalRelationsChange> tag for buildings and events? This would be similar to what happens with civics that adjust relations.

For example, a building that grants +3 relations with all leaders would have this:
<iGlobalRelationsChange>3</iGlobalRelationsChange>

This would mean that we wouldn't need Python for Field of the Cloth of Gold and (I think) Taipei 101. Putting the relations tag in an XML would allow the AI to evaluate the effect.

We could also use a negative version as a drawback. The Manhattan Project could have
<iGlobalRelationsChange>-2</iGlobalRelationsChange>

and the builder would get -2 relations with all AI players just for building it. We don't need to have that, but I'm using it as an example.

Hydromancerx
Aug 16, 2012, 07:43 PM
That would be a cool tag. :goodjob:

Koshling
Aug 16, 2012, 07:45 PM
This came up over in my Old Wonders - New Abilities thread. Could we get an <iGlobalRelationsChange> tag for buildings and events? This would be similar to what happens with civics that adjust relations.

For example, a building that grants +3 relations with all leaders would have this:
<iGlobalRelationsChange>3</iGlobalRelationsChange>

This would mean that we wouldn't need Python for Field of the Cloth of Gold and (I think) Taipei 101. Putting the relations tag in an XML would allow the AI to evaluate the effect.

We could also use a negative version as a drawback. The Manhattan Project could have
<iGlobalRelationsChange>-2</iGlobalRelationsChange>

and the builder would get -2 relations with all AI players just for building it. We don't need to have that, but I'm using it as an example.

Good one for ls612 to have a go at. It's relatively self contained and simple, and once you've done one tag request, you pretty much learn most of what you need to know to most others.

Vokarya
Aug 16, 2012, 08:03 PM
Good one for ls612 to have a go at. It's relatively self contained and simple, and once you've done one tag request, you pretty much learn most of what you need to know to most others.

Great. If he can get that one to work, I have a few other tags to propose that are generally straight mathematical adjustments (like a multiplier effect to a Great Person mission, or bonus happiness from your State Religion regardless of which religion it is). But those aren't high priority.

ls612
Aug 17, 2012, 09:15 AM
Good one for ls612 to have a go at. It's relatively self contained and simple, and once you've done one tag request, you pretty much learn most of what you need to know to most others.

Good idea, I'll try that.

Edit: I've figured out all of the stuff to actually put the tag in the XML, but I can't find the function that figures out what the AI's relation to you is. What function is that?

IronClaymore
Aug 17, 2012, 10:58 AM
A mechanic I quite liked from Master of Mana (a FFH modmod) are the building tags that give yields or commerce to a city that has access to a resource, but then improves that bonus as you gain more resources.

It's actually quite a few tags, here's an example, from the (MoM) Bakery building:

<BonusYieldType>YIELD_FOOD</BonusYieldType>
<iInitialValue>100</iInitialValue>
<iPerBonusValue>50</iPerBonusValue>
<BonusesLinked>
<BonusLinked>
<BonusType>BONUS_WHEAT</BonusType>
<bLinked>1</bLinked>
</BonusLinked>
<BonusLinked>
<BonusType>BONUS_RICE</BonusType>
<bLinked>1</bLinked>
</BonusLinked>
<BonusLinked>
<BonusType>BONUS_CORN</BonusType>
<bLinked>1</bLinked>
</BonusLinked>
</BonusesLinked>

<BonusYieldType>YIELD_FOOD</BonusYieldType> says that the building provides food. <BonusCommerceType> can give gold, science, culture or espionage instead.
<iInitialValue>100</iInitialValue> means that, with access to at least one of the listed resources, the city gain +1 food.
<iPerBonusValue>50</iPerBonusValue> gives +0.5 food for every subsequent resource on the list that you gain.
<BonusesLinked> gives a list of all the resources that provide the bonus.
So, this bakery gives you 1 food if the city has access to any grain resource, and an extra half a food for every additional grain.

I think Master of Mana introduced this system to do away with corporations, because it's a very similar system (encourages the hoarding of resources and building more than one bonus building in your empire), except without all the tedious bother of building a damn executive, sending him to a city, then watching in helpless rage as the corporation fails to spread.

But perhaps this could work in C2C, with all its manufactured resources? For example, a bakery providing food for every grain and/or flour (produced by wheat/barley/corn farm buildings, not the improvements, though they require the improvements). A grocery/supermarket giving food and a touch of gold for every berries and fruit resource. Butchery giving food for every carcass. Sausage maker giving food for every raw meat. Sausage shop giving food for every sausage. Paleontology lab giving science for every fossils. Construction firm giving production for every wood and steel and cement. This sort of system would actually make it worthwhile building multiple pottery and glass factories, and using the great farmer to give a city a variety of different terrain resources to get access to the cross-resource buildings (all those crazy farms and hunting camps), rather than spamming wheat everywhere.

Thunderbrd
Aug 17, 2012, 04:05 PM
Not a bad idea but I won't be touching it... I avoid working with yields at the moment!

Koshling
Aug 17, 2012, 06:20 PM
Good idea, I'll try that.

Edit: I've figured out all of the stuff to actually put the tag in the XML, but I can't find the function that figures out what the AI's relation to you is. What function is that?

Not entirely sure what you mean by "the AI's relation to you". If you mean "how does the AI evaluate this tag" the the answer is CvPlayerAI::AI_civicValue() is where you need to add evaluation of this value.

ls612
Aug 17, 2012, 06:32 PM
Not entirely sure what you mean by "the AI's relation to you". If you mean "how does the AI evaluate this tag" the the answer is CvPlayerAI::AI_civicValue() is where you need to add evaluation of this value.

Wait, I thought that Vokarya was asking for a tag on a building that would modify your diplomatic relations with other civs if you built that building. I am stuck on the "finding if a building with a nonzero value of that tag exists, and if yes, changing the AI's relationship numbers accordingly". I'm not certain how that relates to civics.

Dancing Hoskuld
Aug 17, 2012, 06:34 PM
This came up over in my Old Wonders - New Abilities thread. Could we get an <iGlobalRelationsChange> tag for buildings and events? This would be similar to what happens with civics that adjust relations.

For example, a building that grants +3 relations with all leaders would have this:
<iGlobalRelationsChange>3</iGlobalRelationsChange>

This would mean that we wouldn't need Python for Field of the Cloth of Gold and (I think) Taipei 101. Putting the relations tag in an XML would allow the AI to evaluate the effect.

We could also use a negative version as a drawback. The Manhattan Project could have
<iGlobalRelationsChange>-2</iGlobalRelationsChange>

and the builder would get -2 relations with all AI players just for building it. We don't need to have that, but I'm using it as an example.

Not entirely sure what you mean by "the AI's relation to you". If you mean "how does the AI evaluate this tag" the the answer is CvPlayerAI::AI_civicValue() is where you need to add evaluation of this value.

I assume he is referring to the actual relationship value (attitude) between you and the AI nation. This would indeed be a great one and I have also asked for it before. In python you have to loop through adding/subtracting 1 and then checking the relationship again until you reach the desired result. If we knew how many 1's made a point of attitude it would be easier. ;)

Koshling
Aug 17, 2012, 06:44 PM
Wait, I thought that Vokarya was asking for a tag on a building that would modify your diplomatic relations with other civs if you built that building. I am stuck on the "finding if a building with a nonzero value of that tag exists, and if yes, changing the AI's relationship numbers accordingly". I'm not certain how that relates to civics.

Oh sorry, I thought it was a civic tag. In that case the routines you need are:

cvCity::processBuilding() which adds or removes the effect of that building (as defined by it's tags) when it is built, destroyed, disabled, re-enabled etc. For the AI to evaluate it you need to modify CvCityAI::buildingValueThresholdOriginal() (or something like that - this is from memory) and a sister routine, that does the same thing, but in a way that is much more efficient when you know that multiple queries for different aspects are going to be made (as happens during what to build evaluation). For now, don't worry about the sister routine, and I'll walk over with you how to update it after you do the easy one (which is the one with the name I was approximating/guessing at above)

ls612
Aug 18, 2012, 09:31 AM
Oh sorry, I thought it was a civic tag. In that case the routines you need are:

cvCity::processBuilding() which adds or removes the effect of that building (as defined by it's tags) when it is built, destroyed, disabled, re-enabled etc. For the AI to evaluate it you need to modify CvCityAI::buildingValueThresholdOriginal() (or something like that - this is from memory) and a sister routine, that does the same thing, but in a way that is much more efficient when you know that multiple queries for different aspects are going to be made (as happens during what to build evaluation). For now, don't worry about the sister routine, and I'll walk over with you how to update it after you do the easy one (which is the one with the name I was approximating/guessing at above)

I am having much trouble getting a building to affect a value on a player, as opposed to a value in a city. Here is what I have done so far, in pseudocode. I've made the following function to return what the change in AI diplomatic relations should be.

void CvCity::changeAIAttitude(int iChange)
{
for (int iPlayer = 0; iPlayer < MAX_CIV_PLAYERS; ++iPlayer)
{
if (!isHuman() && !isBarbarian() && isAlive())
{
int iI;
BuildingTypes eLoopBuilding;
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
if (eLoopBuilding != NO_BUILDING)
{
if (GC.getBuildingInfo(eLoopBuilding).getGlobalRelati onsModifier != 0)
{
return GC.getBuildingInfo(eLoopBuilding).getGlobalRelatio nsModifier();
}
else
{
return 0;
}
}
}
else
{
return 0
}
}
}


But I can't figure out how to use the value that that function returns. :( Am I doing this at all right, or am I totally on a wild goose chase?

Thunderbrd
Aug 19, 2012, 01:41 AM
Well, first of all, I'd add the value to the city first, that way you don't have to then cycle through all of the buildings in the city. This is done in the processBuilding function. I can explain more if you get stuck there.

Then go to CvPlayer and pick up the value from CvCity by looping through the cities and totaling up the value there. Then you can plug the modifier into the relations equation. (I say this but I haven't researched enough to be absolutely certain that foreign relations are taken care of in CvPlayer but I have reason to suspect they would be.)

Does this help any?

Koshling
Aug 19, 2012, 08:40 AM
I am having much trouble getting a building to affect a value on a player, as opposed to a value in a city. Here is what I have done so far, in pseudocode. I've made the following function to return what the change in AI diplomatic relations should be.

void CvCity::changeAIAttitude(int iChange)
{
for (int iPlayer = 0; iPlayer < MAX_CIV_PLAYERS; ++iPlayer)
{
if (!isHuman() && !isBarbarian() && isAlive())
{
int iI;
BuildingTypes eLoopBuilding;
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
if (eLoopBuilding != NO_BUILDING)
{
if (GC.getBuildingInfo(eLoopBuilding).getGlobalRelati onsModifier != 0)
{
return GC.getBuildingInfo(eLoopBuilding).getGlobalRelatio nsModifier();
}
else
{
return 0;
}
}
}
else
{
return 0
}
}
}


But I can't figure out how to use the value that that function returns. :( Am I doing this at all right, or am I totally on a wild goose chase?

There are a number of problems with this:

1) Naming - this method does NOT change the AI attituide, it just gets what the chnage due to buildings is, so yoyu definately shouldn't name it that way (sopmething like getBuildingAttitudeChange() would be more appropriate)

2) As written it calculates the same value in every city, whcuih is the value of all possible buildings since it doesn't check whetehr the city HAS each building before including its contribution. You need an 'if (getNumActiveBuilding(eLoopBuilding) > 0)' test in there inside the loop.

3) I know its only pseudocode so you'd pick this up when you tried to actually compile it, but don't loop over building classes, just loop over buildings directly (i.e. - eLoopBuilding should be you for loop variable)

4) To use it you'll proabbly need to add a loop over cities that calls it and adds up the contribution from each city, to CvPlayerAI::AI_getCivicAttitudeChange(PlayerTypes ePlayer) which currently works out the attitude change due to civics

BTW - it turns out that attitude handling is actually very unusual - almost all building effects are handled in processBuilding() (and almost all civic effects in doCivic()), but attitude calculations are doen totally differently, which is why the pattern for this one is a bit unusual.

ls612
Aug 19, 2012, 01:03 PM
There are a number of problems with this:

1) Naming - this method does NOT change the AI attituide, it just gets what the chnage due to buildings is, so yoyu definately shouldn't name it that way (sopmething like getBuildingAttitudeChange() would be more appropriate)

2) As written it calculates the same value in every city, whcuih is the value of all possible buildings since it doesn't check whetehr the city HAS each building before including its contribution. You need an 'if (getNumActiveBuilding(eLoopBuilding) > 0)' test in there inside the loop.

3) I know its only pseudocode so you'd pick this up when you tried to actually compile it, but don't loop over building classes, just loop over buildings directly (i.e. - eLoopBuilding should be you for loop variable)

4) To use it you'll proabbly need to add a loop over cities that calls it and adds up the contribution from each city, to CvPlayerAI::AI_getCivicAttitudeChange(PlayerTypes ePlayer) which currently works out the attitude change due to civics

BTW - it turns out that attitude handling is actually very unusual - almost all building effects are handled in processBuilding() (and almost all civic effects in doCivic()), but attitude calculations are doen totally differently, which is why the pattern for this one is a bit unusual.

So much for it being easy and self-contained. :mischief: I think that I will put this one to rest for a while, until I have more skills with the SDK stuff, and do simpler things for the time being.

Hydromancerx
Aug 21, 2012, 03:59 PM
JosEPh_II brought up an idea with the property system. Other properties like :science:, :health: or :hammers: that can be + or - at different techs. However properties like Crime, Pollution and Flammability we do not have these tags (that I know of).

Could you make tags that give +/- a property at a specific tech? Thanks in advance! :goodjob:

ls612
Aug 21, 2012, 04:00 PM
JosEPh_II brought up an idea with the property system. Other properties like :science:, :health: or :hammers: that can be + or - at different techs. However properties like Crime, Pollution and Flammability we do not have these tags (that I know of).

Could you make tags that give +/- a property at a specific tech? Thanks in advance! :goodjob:

As I said in the balance thread, I'll try after V26 is released.

AIAndy
Aug 22, 2012, 07:24 AM
JosEPh_II brought up an idea with the property system. Other properties like :science:, :health: or :hammers: that can be + or - at different techs. However properties like Crime, Pollution and Flammability we do not have these tags (that I know of).

Could you make tags that give +/- a property at a specific tech? Thanks in advance! :goodjob:
You can already do that for properties like crime and pollution.
There is an Active expression tag for property manipulators.
That condition is not rendered into help texts though so it might confuse people but this is possible:

<PropertyManipulators>
<PropertySource>
<PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
<PropertyType>PROPERTY_CRIME</PropertyType>
<iAmountPerTurn>-20</iAmountPerTurn>
<Active>
<Has>
<GOMType>GOM_TECH</GOMType>
<ID>TECH_MYSTICISM</ID>
</Has>
</Active>
</PropertySource>
</PropertyManipulators>

ls612
Aug 22, 2012, 09:07 AM
You can already do that for properties like crime and pollution.
There is an Active expression tag for property manipulators.
That condition is not rendered into help texts though so it might confuse people but this is possible:



I think he meant adding a property to a building with a tech (sort of like TechCommerceModifiers on buildings, but with properties). Unless you want to do it, I figure that adding a tag like that for properties will be similar enough to the TechCommerceModifiers in structure that I could probably do it.

AIAndy
Aug 23, 2012, 06:22 AM
I think he meant adding a property to a building with a tech (sort of like TechCommerceModifiers on buildings, but with properties). Unless you want to do it, I figure that adding a tag like that for properties will be similar enough to the TechCommerceModifiers in structure that I could probably do it.
That is what the XML I posted does. It is a property source on a building that is only active once you have a certain tech, similar to how the TechCommerceModifiers only add commerce once you have the tech.
Of course that method doesn't work for flammability because it is a static property so for that one a separate tag might be useful but only if it is needed.

Koshling
Aug 23, 2012, 06:24 AM
That is what the XML I posted does. It is a property source on a building that is only active once you have a certain tech, similar to how the TechCommerceModifiers only add commerce once you have the tech.
Of course that method doesn't work for flammability because it is a static property so for that one a separate tag might be useful but only if it is needed.

It needs evaluation AI adding for it though - pretty sure stuff that manifests through the expression system generically like this is overlooked by the AI currently isn't it?

AIAndy
Aug 23, 2012, 06:45 AM
It needs evaluation AI adding for it though - pretty sure stuff that manifests through the expression system generically like this is overlooked by the AI currently isn't it?
Yes, in this case the Active expression will be overlooked so the AI will assume that that property source is always active so it might value the building too high.

ls612
Aug 23, 2012, 08:51 AM
Yes, in this case the Active expression will be overlooked so the AI will assume that that property source is always active so it might value the building too high.

OK, I could take a look at the AI part of that then. Thanks. :goodjob:

Koshling
Aug 23, 2012, 10:29 AM
OK, I could take a look at the AI part of that then. Thanks. :goodjob:

Good luck with that. This is NOT a simple task.

ls612
Aug 23, 2012, 10:33 AM
Good luck with that. This is NOT a simple task.

Hm, maybe I'll pass on that then. In a perfect world, the AI would only ever see the result of any expression evaluations, but I think after looking a bit that that would involve a LOT of coding. :rolleyes:

Sgtslick
Aug 23, 2012, 11:18 PM
With
<Active>
<Has>
<GOMType>GOM_TECH</GOMType>
<ID>TECH_MYSTICISM</ID>
</Has>
</Active>

Can this be used in other tags in the traitinfos.xml?
Can it be used on other tags such as:
<iHealth>-3</iHealth>
<Active>
<Has>
<GOMType>GOM_TECH</GOMType>
<ID>TECH_MACHINERY</ID>
</Has>
</Active>

If so what other GOMtypes are there? Isn't there a thread on the expression system? Can't seem to find it.

AIAndy
Aug 24, 2012, 08:35 AM
Hm, maybe I'll pass on that then. In a perfect world, the AI would only ever see the result of any expression evaluations, but I think after looking a bit that that would involve a LOT of coding. :rolleyes:
One somewhat easy thing would be to evaluate the active expression at the moment when you evaluate what you want to build. Of course that means it won't consider what the building value might be in the future.

@Sgtslick: The Active tag is only implemented on property manipulators (there are some other expression tags though like TrainCondition). The expression tutorial can be found here (check the stickied Modder's Documentation thread): http://forums.civfanatics.com/showpost.php?p=11598257&postcount=27

The currently implemented GOMTypes are:
GOM_BUILDING,
GOM_PROMOTION,
GOM_TRAIT,
GOM_FEATURE,
GOM_OPTION,
GOM_TERRAIN,
GOM_GAMESPEED,
GOM_ROUTE,
GOM_BONUS,
GOM_UNITTYPE,
GOM_TECH,
GOM_CIVIC,
GOM_RELIGION,
GOM_CORPORATION,
GOM_IMPROVEMENT

ls612
Aug 24, 2012, 09:31 AM
One somewhat easy thing would be to evaluate the active expression at the moment when you evaluate what you want to build. Of course that means it won't consider what the building value might be in the future.

That's sort of what I meant by the AI only ever seeing the end-result of Expression evaluations. However, that will have to wait until after the Freeze (which I think we are now in).

Sgtslick
Aug 26, 2012, 08:26 PM
REQUEST: In the civ4cilivilizationschema.xml the <-Aforeness----!> or whatever it is which adds Bonus happiness change, can this be
can this be extended to include some others such as:

Ripped from DYNAMIC TRAITS mod civilization schema.
These in particular would be good. .


***** *****
<ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>

<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iAttitudeModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>
***** *****


<ElementType name="iCityDefenseBonus" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionGreatPeopleRateModifier" content="textOnly" dt:type="int"/>
<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iFreeExperience" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>
<ElementType name="iMilitaryProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iBaseFreeUnits" content="textOnly" dt:type="int"/>
<ElementType name="iBaseFreeMilitaryUnits" content="textOnly" dt:type="int"/>
<ElementType name="iFreeUnitsPopulationPercent" content="textOnly" dt:type="int"/>
<ElementType name="iFreeMilitaryUnitsPopulationPercent" content="textOnly" dt:type="int"/>
<ElementType name="iGoldPerUnit" content="textOnly" dt:type="int"/>
<ElementType name="iGoldPerMilitaryUnit" content="textOnly" dt:type="int"/>
<ElementType name="iHappyPerMilitaryUnit" content="textOnly" dt:type="int"/>
<ElementType name="bMilitaryFoodProduction" content="textOnly" dt:type="boolean"/>
<ElementType name="iLargestCityHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iFreeSpecialist" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iMaxConscript" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iNonStateReligionHappiness" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionUnitProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionBuildingProductionModifier" content="textOnly" dt:type="int"/>
<ElementType name="iStateReligionFreeExperience" content="textOnly" dt:type="int"/>
<ElementType name="iExpInBorderModifier" content="textOnly" dt:type="int"/>
<ElementType name="SpecialistType" content="textOnly"/>
<ElementType name="YieldModifiers" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="CapitalYieldModifiers" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="CapitalCommerceModifiers" content="eltOnly">
<element type="iCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistExtraCommerces" content="eltOnly">
<element type="iCommerce" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="YieldChanges" content="eltOnly">
<element type="iYield" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistCommerceChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="CommerceChanges"/>
</ElementType>
<ElementType name="SpecialistCommerceChanges" content="eltOnly">
<element type="SpecialistCommerceChange" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>
<ElementType name="SpecialistYieldChanges" content="eltOnly">
<element type="SpecialistYieldChange" minOccurs="0" maxOccurs="*"/>
</ElementType>


* oh and a question - when I put

PropertySourceType>PROPERTYSOURCE_ATTRIBUTE_CONSTANT</PropertySourceType>
<PropertyType>PROPERTY_CRIME</PropertyType>
<GameObjectType>GAMEOBJECT_CITY</GameObjectType>
<RelationType>RELATION_ASSOCIATED</RelationType>
<AttributeType>ATTRIBUTE_POPULATION</AttributeType>
<iAmountPerTurn>3</iAmountPerTurn>
<Active>
<Greater>
<PropertyType>PROPERTY_CRIME</PropertyType>
<Mult>
<AttributeType>ATTRIBUTE_POPULATION</AttributeType>
<Constant>10</Constant>
</Mult>
</Greater>
</Active>
in the traitinfo.xml it doesn't show up in the Civilopedia.

Sgtslick
Aug 29, 2012, 02:17 AM
Does anyone know how difficult this is to do? How long would it take etc? Can anyone help with this?

Thunderbrd
Aug 29, 2012, 08:35 AM
Let me get this straight, you were asking for all the tags listed there?

It could be done but it would take a lot of time. I'm immersed in a project already so if I was going to address it, it'd be quite a while before I could get to it. I may want those eventually anyhow though.

The second issue on the property source showing in the pedia is something I'd leave for AIAndy to address for now.

Sgtslick
Aug 29, 2012, 12:08 PM
What about just these? <ElementType name="SpecialistYieldChange" content="eltOnly">
<element type="SpecialistType"/>
<element type="YieldChanges"/>
</ElementType>

<ElementType name="iDistanceMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iNumCitiesMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iCorporationMaintenanceModifier" content="textOnly" dt:type="int"/>
<ElementType name="iWorkerSpeedModifier" content="textOnly" dt:type="int"/>
<ElementType name="iTradeRoutes" content="textOnly" dt:type="int"/>
<ElementType name="iWarWearinessModifier" content="textOnly" dt:type="int"/>
<ElementType name="iAttitudeModifier" content="textOnly" dt:type="int"/>
<ElementType name="iImprovementUpgradeRateModifier" content="textOnly" dt:type="int"/>

So its not as easy as it being done in one lazy afternoon? Also the dynamic trait dll or schema etc could be used as a reference, would this help?

Thunderbrd
Aug 30, 2012, 09:29 AM
Of course it would help to some extent. And no, that lazy afternoon would be more like a month or so, or more aggravated by the fact that these kinds of modifiers aren't really being employed from the Civilization selection angle which could take added setup to establish.

I manage to workup about 4-6 tags a week if nothing goes wrong or needs to be debugged or learned about how to implement along the way, working on it probably 50% of the time I'm not at work or sleeping.

But yeah, it'd be a bit faster with the reference dll. The problem here isn't setting up just the ability for storing and translating the info in those tags, its all the setup to make them do what they are supposed to do in the first place. Then the AI to give even a modicum of recognition for the ai players to use or at least avoid the pitfalls of these new effects... that really can get overwhelming and makes a programmer want to pick his battles.

However, I've been pondering your request and wondering what exactly you had in mind for it? You're asking for modifiers to go into place for the civilization selection themselves, where those selections are really intended to have little to no real impact right now. The eventual plan there may conflict a lot with what you have in mind, or may harmonize with it quite a bit. Either way, its obvious you're not planning something minor and with little impact. So I'm wondering what you want those modifiers for? If a new thread is appropriate for that discussion, by all means, lets talk ;)

Thunderbrd
Aug 30, 2012, 10:08 PM
I was thinking about your request, SgtSlick, and I began wondering if what would be easier to accomplish would be to create some alternative 'traits' that aren't intended to be tagged to leaders but rather to civilizations themselves. A few tags could probably create this effect and would cut down on the dll workload quite a bit rather than creating a whole list of tags such as that for the civilizations. They could then be granted to leaders as a 'free trait' based on the civilization they lead.

Sgtslick
Aug 31, 2012, 02:29 AM
Well that sounds like a tonne of work, 4-6 tag - minimum 1 week - 50% of your time not working/sleeping to finish. No way I would impose this sort of thing on anyone.

These tags are simply ripped out of the dynamic traits mod (civilization schema).

Currently the traits we have are limited in terms of what you can do. This is exaggerated a lot by the fact there are too many traits and not enough modifiers. Its difficult to try and flesh out each trait with positive/negative modifiers while keeping them all dissimilar. Already lots of ideas are repeated and its often just a case of varying the strength/combination.

This is the reason I was curious how much effort is required to expand on the modifiers that can be used.

Thunderbrd
Aug 31, 2012, 09:22 AM
AH... ok, so I get the point now. I had thought you wanted new tags for CIVILIZATIONS themselves that were much like ones already available for traits... now I see what you're wanting it for.

One thing we have going for us is the fact that most of those traits are being calculated where they would need to be from other modifier sources already so some of that should be easier than setting up a tag out of the blue. So... I think much of it could be done. It wouldn't be overnight, especially given that I've got to finish my current project here first. But in a month or two I could probably get back to this and see what I can do.

I do understand the frustration of wanting more to work with there. And yes, having the original source codes your discussing should make the job quite a bit easier. So if I was working on this I'd probably want to just do them all. With help from previous code I wouldn't think it'd take quite as long as they would normally take. Maybe one week could do it all.

Sgtslick
Aug 31, 2012, 02:25 PM
That would be outstanding! In my opinion if we had all these extra modifiers the trait system would be up to scratch and comparable to the rest of this A+ game :)

Vokarya
Sep 02, 2012, 02:37 PM
Here's another tag idea I had: enabling a particular civic on a building or wonder. I know there have been some complaints about my Rosetta Stone wonder, and I really don't want to lose the "feel" of the Stone. I would like to have the option to enable just one civic out of a category.

Right now, we have:
<CivicOption>CIVICOPTION_LANGUAGE</CivicOption>

which enables ALL Language Civics.

I was thinking we could have an <EnablesCivics> tag, which would allow you to specify a particular Civic that would be enabled by a building or Wonder. Something like this:

<EnablesCivics>
<Civic>CIVIC_EDUCATION_SPEAK</Civic>
</EnablesCivics>

and this would enable ONLY the Language Education civic. This tag would allow more than one civic to be enabled, with one set of <Civic></Civic> tags per civic.

Does this sound like a possibility?

ls612
Sep 02, 2012, 03:12 PM
Here's another tag idea I had: enabling a particular civic on a building or wonder. I know there have been some complaints about my Rosetta Stone wonder, and I really don't want to lose the "feel" of the Stone. I would like to have the option to enable just one civic out of a category.

Right now, we have:
<CivicOption>CIVICOPTION_LANGUAGE</CivicOption>

which enables ALL Language Civics.

I was thinking we could have an <EnablesCivics> tag, which would allow you to specify a particular Civic that would be enabled by a building or Wonder. Something like this:

<EnablesCivics>
<Civic>CIVIC_EDUCATION_SPEAK</Civic>
</EnablesCivics>

and this would enable ONLY the Language Education civic. This tag would allow more than one civic to be enabled, with one set of <Civic></Civic> tags per civic.

Does this sound like a possibility?

Mostly offtopic here, but there was a wonder in Civ III that did that, enabled all civics, and it was the absolute most OP building in the game. Ah, the memories. :)

Koshling
Sep 03, 2012, 12:44 PM
Here's another tag idea I had: enabling a particular civic on a building or wonder. I know there have been some complaints about my Rosetta Stone wonder, and I really don't want to lose the "feel" of the Stone. I would like to have the option to enable just one civic out of a category.

Right now, we have:
<CivicOption>CIVICOPTION_LANGUAGE</CivicOption>

which enables ALL Language Civics.

I was thinking we could have an <EnablesCivics> tag, which would allow you to specify a particular Civic that would be enabled by a building or Wonder. Something like this:

<EnablesCivics>
<Civic>CIVIC_EDUCATION_SPEAK</Civic>
</EnablesCivics>

and this would enable ONLY the Language Education civic. This tag would allow more than one civic to be enabled, with one set of <Civic></Civic> tags per civic.

Does this sound like a possibility?

Yes, should be pretty easy.

Hydromancerx
Sep 05, 2012, 01:36 PM
@AIAndy (Or someone who knows the answer)

What is the code for Buildings for resources that doesn't use the default? For example this is the old code ...


<Bonus>BONUS_CHARCOAL</Bonus>
<PrereqBonuses>
<Bonus>BONUS_COPPER</Bonus>
<Bonus>BONUS_TIN</Bonus>
<Bonus>BONUS_IRON</Bonus>
</PrereqBonuses>


How do I write it with the new code that AIAndy made for both AND and OR?

ls612
Sep 05, 2012, 03:24 PM
@AIAndy (Or someone who knows the answer)

What is the code for Buildings for resources that doesn't use the default? For example this is the old code ...


<Bonus>BONUS_CHARCOAL</Bonus>
<PrereqBonuses>
<Bonus>BONUS_COPPER</Bonus>
<Bonus>BONUS_TIN</Bonus>
<Bonus>BONUS_IRON</Bonus>
</PrereqBonuses>


How do I write it with the new code that AIAndy made for both AND and OR?

<ConstructCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_CHARCOAL</ID>
</Has>
</And>
<Or>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_IRON</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_TIN</ID>
</Has>
</Or>
</ConstructCondition>

I believe is how it works.

Hydromancerx
Sep 05, 2012, 03:27 PM
Thanks. I will go try that to see if it works. Since I want to have 7 OR requirements but the other system won't let it.

ls612
Sep 05, 2012, 03:29 PM
Thanks. I will go try that to see if it works. Since I want to have 7 OR requirements but the other system won't let it.

Koshling increased the GlobalDefine to allow 7, which I think may have been a mistake, but that's another issue. You should probably use the ConstructCondition tag for more prereqs.

Hydromancerx
Sep 05, 2012, 03:37 PM
Well I tried 7 and the 7th one will not show up in the last code. That's why i was asking. This also may be why people have been getting errors.

Also it should be ok to use both right? Such as ...

(Charcoal OR Coal) AND (Copper OR Tin OR Iron OR Lead OR Silver OR Gold OR Platinum)

where the first is the old code while the 2nd part is the new code. Right? OR will it go ...

Charcoal OR Coal OR Copper OR Tin OR Iron OR Lead OR Silver OR Gold OR Platinum

... despite having them in separate codes?

ls612
Sep 05, 2012, 03:39 PM
Well I tried 7 and the 7th one will not show up in the last code. That's why i was asking. This also may be why people have been getting errors.

Also it should be ok to use both right? Such as ...

(Charcoal OR Coal) AND (Copper OR Tin OR Iron OR Lead OR Silver OR Gold OR Platinum)



Yes, that should work fine.

Hydromancerx
Sep 05, 2012, 03:43 PM
@ls612

So I tried you code and I am getting this ...

http://forums.civfanatics.com/attachment.php?attachmentid=330608&stc=1&d=1346881413

(((((((Copper) OR Tin) OR Iron) OR Lead) OR Silver) OR Gold) OR Platinum)

Is this right?

ls612
Sep 05, 2012, 04:10 PM
@ls612

So I tried you code and I am getting this ...

http://forums.civfanatics.com/attachment.php?attachmentid=330608&stc=1&d=1346881413

(((((((Copper) OR Tin) OR Iron) OR Lead) OR Silver) OR Gold) OR Platinum)

Is this right?

Aside from the 5 extra parentheses, yes. :)

Thunderbrd
Sep 05, 2012, 07:52 PM
Should have an AND in there shouldn't it? Otherwise, good job on a fairly complex coding issue LS!

AIAndy
Sep 06, 2012, 02:36 PM
<ConstructCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_CHARCOAL</ID>
</Has>
</And>
<Or>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_IRON</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_TIN</ID>
</Has>
</Or>
</ConstructCondition>

I believe is how it works.
Slight error: There needs to be a single topmost tag. What you probably want is this:
<ConstructCondition>
<And>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_CHARCOAL</ID>
</Has>
<Or>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_COPPER</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_IRON</ID>
</Has>
<Has>
<GOMType>GOM_BONUS</GOMType>
<ID>BONUS_TIN</ID>
</Has>
</Or>
</And>
</ConstructCondition>

The help text generation for expression tags is currently a bit heavy on the parentheses and could use some improvements.

Nakkimunakas
Sep 08, 2012, 12:51 AM
If it's not too much work I would request these:

<IAGoldModifier> per turn generated :gold: for AI
<IAResearchModifier> per turn generated :science: for AI
<IABaseCommerceModifier> per turn generated :commerce: for AI
<IAProductionModifier> per turn generated :hammers: for AI

<PlayerGoldModifier> per turn generated :gold: for player
<PlayerResearchModifier> per turn generated :science: for player
<PlayerBaseCommerceModifier> per turn generated :commerce: for player
<PlayerProductionModifier> per turn generated :hammers: for player

These would allow more flexible difficulty givin AI and the player different values or if you think there is too much/little of one resource type, for example gold, you could adjust both AI and player values up or down.

Basicly these would be coefficients that would multiply the values(gold, production etc) cities generate per turn. For example default would be 1 and 1.5 would mean 50% more generated per turn than default value, 0.5 would mean 50% less.

Vokarya
Sep 09, 2012, 12:49 PM
I have another suggestion for four corporation building tags:

<iCorporationMaintenanceModifier>: +/-X% maintenance for Corporations in the city with this building.

<iGlobalCorporationMaintenanceModifier>: +/-X% maintenance for all Corporations in the same civilization.

<iCorporationProfitModifier>: +/-X% income from Corporate Headquarters in the city with this building.

<iGlobalCorporationProfitModifier>: +/-X% income from all Corporate Headquarters in the same civilization.

The first two tags are taken from the <iCorporationMaintenanceModifier> on civics, but civics apply to your whole civilization. So I thought we should have one tag for just the city that has the building and one tag for the civilization as a whole; the first tag would go on regular buildings, and the Global tag would go on Wonders. The profit tags are the natural flipside of the maintenance tags. All of the Headquarters have SPECIALBUILDING_CORPORATION_HQ, so that would be the easiest way to determine which buildings get the bonus.

Thunderbrd
Sep 09, 2012, 04:10 PM
Commerces and Yields are not my department at the moment... perhaps eventually.

Hydromancerx
Sep 16, 2012, 01:59 AM
@AIAndy & Koshling

Could one of you make a building tag that when on a building triggers it to be automatically built in the city when all its other requirements are met?

I would like to convert my houses to do this so you don't have to build them, they just build themselves. Note this is so they don't have to use a property trigger.

Koshling
Sep 16, 2012, 08:49 AM
@AIAndy & Koshling

Could one of you make a building tag that when on a building triggers it to be automatically built in the city when all its other requirements are met?

I would like to convert my houses to do this so you don't have to build them, they just build themselves. Note this is so they don't have to use a property trigger.

Would this work? :
<bIsAutoBuild>1</bIsAutoBuild>
Would build the blinding as soon as its requirements are met (well on start of first turn in which that is the case anyway - not part way through a turn). If so I can do that pretty easily later today I expect...

Hydromancerx
Sep 16, 2012, 01:21 PM
Awesome! That would be perfect! This would be very powerful too since if used with the city size limit tag we could have buildings auto build when they reach a specific city size.

Sgtslick
Sep 20, 2012, 03:24 AM
Less micro-managing 1-3 turn buildings would be fan-bloody-tanstic :D

Nimek
Nov 03, 2012, 03:13 AM
New tag request for buildings

<cityBuildingModifier> it should work similiar to techModifier add modifiers to building depending on current existing buildings in the city.

It effet should be visible in "actual effect" hover programmed by Affores.

Thanks to that tag city buildings will have influence on each other

Thunderbrd
Nov 03, 2012, 10:33 AM
New tag request for buildings

<cityBuildingModifier> it should work similiar to techModifier add modifiers to building depending on current existing buildings in the city.

It effet should be visible in "actual effect" hover programmed by Affores.

Thanks to that tag city buildings will have influence on each other

Request noted. I understand what you're asking for and can see the point. But this'd be a bit beyond me right now. I still avoid Commerces and such (and you'd need more than one. You'd need a SET of tags to achieve this I think...)

I also have little to no understanding of the programming involved in the 'actual effect' layout, or I'd have addressed a thing or two there myself.

Koshling
Nov 03, 2012, 10:40 AM
New tag request for buildings

<cityBuildingModifier> it should work similiar to techModifier add modifiers to building depending on current existing buildings in the city.

It effet should be visible in "actual effect" hover programmed by Affores.

Thanks to that tag city buildings will have influence on each other

I'm cautious about this because of the AI aspects. It makes the appropriate choice of building a much more complex problem (since you have a production modifier tree, a bit like the tech tree, which influences the optimal build order). As a result such a system would be likely to benefit the human player relative to the AI, and ultimately make the game easier (or slower if we devoted effort to AI work, which would almost certainly involve it having to run a deeper, and therefore more expensive, analysis).

Hydromancerx
Nov 03, 2012, 04:33 PM
*removed*

Nimek
Nov 04, 2012, 07:16 AM
I want to use this only for housing

I want to add some city management buildings (just several). They will add some bonuses from housing.

For AI i simply want to set AIvalue tag on 10. (because it is only several buildings 1 maybe two on each era)

I will make it as modmod so we will able to test that solution before (if we want it) it will be merged.

Nimek
Nov 09, 2012, 07:31 AM
Another request (maybe now it will be possible)

tag for resources
<isOnlyLocal> - boolean - default 0 - defines is resource will be available via trade route to other cities or it will be only available in city where produced.

I wan it for two reasons

1 make a difference bettwen makers hut vs factories - makers hut will produce only local resources. For factories the same resource will be global (now the difference is too small and unrealistic)

2 some resources will be only local before discovering some techs example fruits etc

Dancing Hoskuld
Nov 11, 2012, 02:39 PM
Another request (maybe now it will be possible)

tag for resources
<isOnlyLocal> - boolean - default 0 - defines is resource will be available via trade route to other cities or it will be only available in city where produced.

I wan it for two reasons

1 make a difference bettwen makers hut vs factories - makers hut will produce only local resources. For factories the same resource will be global (now the difference is too small and unrealistic)

2 some resources will be only local before discovering some techs example fruits etc

I have designed a way of doing this without the need for a tag which fits better with the flow of time and trade in the game, I am still working out the details but it looks like it will solve the problem that having many different types of food should provide more health in the early eras but have diminishing returns in the later eras. I want to put a polished suggestion up because my last suggestion, for the metals, never happened because it was not well enough explained by me.

Dancing Hoskuld
Nov 12, 2012, 03:18 PM
How difficult would it be to get a new vicinity tag on buildings, one that takes improvements rather than bonuses as the value?

AIAndy
Nov 12, 2012, 03:55 PM
How difficult would it be to get a new vicinity tag on buildings, one that takes improvements rather than bonuses as the value?
You can use an expression to get that effect.

Nimek
Nov 12, 2012, 03:59 PM
@AiAndy

Can you give code example for that (for windmill)

AIAndy
Nov 12, 2012, 04:07 PM
@AiAndy

Can you give code example for that (for windmill)

<ConstructCondition>
<Has>
<GOMType>GOM_IMPROVEMENT</GOMType>
<ID>IMPROVEMENT_WINDMILL</ID>
</Has>
</ConstructCondition>

CIVPlayer8
Nov 14, 2012, 03:58 PM
I have an idea for a tag for buildings. Basically, the amount of a resource you have increases the bonus of a building. So the "Gas Station" gives +3:hammers:, and +3:gold: I believe. What this tag will do, is so for every extra resource you have, you get another, smaller bonus. Gas Station (1 Oil Product) = +3 :hammers: and +3 :gold:. Gas Station (2 Oil Products) = +4 :hammers: and +4 :gold:. Gas Station (3 Oil Products) = +5 :hammers: and +5 :gold:. And so on and so forth. This can play into many things, notably, Slaves (as a resource) and Oil.

Hydromancerx
Nov 14, 2012, 05:56 PM
I have an idea for a tag for buildings. Basically, the amount of a resource you have increases the bonus of a building. So the "Gas Station" gives +3:hammers:, and +3:gold: I believe. What this tag will do, is so for every extra resource you have, you get another, smaller bonus. Gas Station (1 Oil Product) = +3 :hammers: and +3 :gold:. Gas Station (2 Oil Products) = +4 :hammers: and +4 :gold:. Gas Station (3 Oil Products) = +5 :hammers: and +5 :gold:. And so on and so forth. This can play into many things, notably, Slaves (as a resource) and Oil.

That's not a very good example. Having more oil products is not going to make your cars more productive or worth more. In fact the less oil there is the more expensive it gets.

CIVPlayer8
Nov 14, 2012, 09:20 PM
That's not a very good example. Having more oil products is not going to make your cars more productive or worth more. In fact the less oil there is the more expensive it gets.
The point was oil would be more widespread and cheaper, so more people have access to it, so more people are going places. Maybe a better example would be with a highway and Automobiles?

Nimek
Nov 15, 2012, 01:38 AM
Not good idea because we waiting for civ inoc mod where stockpiling resources will be implemented. We waiting to copy that solution.

In gameplay it will give huge empires even more bonus and AI is not prepared to use that feauture

CIVPlayer8
Nov 15, 2012, 03:02 PM
Not good idea because we waiting for civ inoc mod where stockpiling resources will be implemented. We waiting to copy that solution.

In gameplay it will give huge empires even more bonus and AI is not prepared to use that feauture

We're going with the Stockpile Mod? Awesome! Even better! Will the resources work similar to Civilization Colonization?

Nimek
Nov 15, 2012, 03:38 PM
@civplayer8

Yes we plan to add it but we havent found any mod/modcogmp that do it in right way.
We wait for Civ4 iNoc mod where that system will be implemented. If it will be good we will try to implement it to c2c. Maybe first try will be mod mod ;). Look at the inoc thread (creation i costumization forum) for more details

bill2505
Nov 15, 2012, 03:44 PM
Not good idea because we waiting for civ inoc mod where stockpiling resources will be implemented. We waiting to copy that solution.

In gameplay it will give huge empires even more bonus and AI is not prepared to use that feauture

not necessarily . one town has a mine which is very deap and gives as much gold for example as 2 other nations mines

CIVPlayer8
Nov 25, 2012, 10:46 AM
I think you can with "BuildingClassCommerceChanges"
Okay, I think I might be missing something, or I don't know. I asked this months ago, and now I'm searching for an example of this in the XML, but can't find it. Can someone tell me how you would code "BuildingClassCommerceChanges" ? Thank you. :confused:

CIVPlayer8
Dec 19, 2012, 09:06 PM
For buildings, I'm looking for a tag that affects the yields of specialists, on a city level. Currently, the only tag that does this, does so across ALL cities in your civ. I need this, to implement the "Emancipation" building. Could someone do this for me?

Thunderbrd
Dec 19, 2012, 11:32 PM
I believe thats one of the tags on my list already - Vokarya I think was wanting that. It won't be right away but yeah, soon.

ls612
Dec 20, 2012, 03:27 PM
For buildings, I'm looking for a tag that affects the yields of specialists, on a city level. Currently, the only tag that does this, does so across ALL cities in your civ. I need this, to implement the "Emancipation" building. Could someone do this for me?

On buildings? Then you would make it an auto-build building with those effects once the tag gets made.

Also, could you please post an outline of your plan for the Slavery civics in the Civics thread? (as well as outlines of other changes before you make them, that is very much appreciated).

strategyonly
Jun 13, 2013, 08:32 AM
:whew: I finally found this, about 6 pages back, anyways i need a NEW tag for FeaturesInfos:


<FeatureUpgrade>FEATURE_FOREST_NEW</FeatureUpgrade>

Schema info:
<ElementType name="FeatureUpgrade" content="textOnly"/>

<element type="FeatureUpgrade"/>

<element type="FeatureUpgrade"/>

FeatureUpgrade- If this improvement has a chance to turn into a feature.

Source Code in FfH2 from Kael here: http://forums.civfanatics.com/showpost.php?p=5817028&postcount=1 (about 1/3 of the page down)

(This is what was proposed?)from DH ???
The only solution I thought of was having a burnt forests (burnt_forest_n ... burnt_forest_0) where n was the number of turns on the slowest speed. Then put the correct burnt_forest_k for the game speed on the plot. Then every turn go throw every plot and if it has burnt_forest_i on it change it to burnt_forest_(i-1) and replace it with forest if it was burnt_forest_0.

Way to complicated for me, sorry, its better to have just 1 tag. . .

Thunderbrd
Jun 13, 2013, 12:53 PM
AIAndy has developed our multi-Feature feature. I'm going to suggest that this is probably in his realm so that it may be woven in with what he's already done without causing damage to either project.

Dancing Hoskuld
Jun 13, 2013, 02:05 PM
:whew: I finally found this, about 6 pages back, anyways i need a NEW tag for FeaturesInfos:


<FeatureUpgrade>FEATURE_FOREST_NEW</FeatureUpgrade>

Schema info:
<ElementType name="FeatureUpgrade" content="textOnly"/>

<element type="FeatureUpgrade"/>

<element type="FeatureUpgrade"/>

FeatureUpgrade- If this improvement has a chance to turn into a feature.

Source Code in FfH2 from Kael here: http://forums.civfanatics.com/showpost.php?p=5817028&postcount=1 (about 1/3 of the page down)

(This is what was proposed?)from DH ???
The only solution I thought of was having a burnt forests (burnt_forest_n ... burnt_forest_0) where n was the number of turns on the slowest speed. Then put the correct burnt_forest_k for the game speed on the plot. Then every turn go throw every plot and if it has burnt_forest_i on it change it to burnt_forest_(i-1) and replace it with forest if it was burnt_forest_0.

Way to complicated for me, sorry, its better to have just 1 tag. . .

If you are going to have a feature upgrade tag there will be problems. Although it will solve more problems that it causes.

We currently have a New Forest feature which upgrades to a Forest feature when worked for x turns. It is not working quite right at the moment. This means that the upgrade should require a number of turns.

We also need the dll to keep track of the upgrade time on the feature. We can live without the requirement that the plot be worked.

We need two tags
FeatureUpgrade
UpgradeTime


Having Forest becoming Ancient Forest in this way would be a bad idea.

strategyonly
Jun 13, 2013, 02:16 PM
We also need the dll to keep track of the upgrade time on the feature. We can live without the requirement that the plot be worked.

We need two tags
FeatureUpgrade
UpgradeTime


Having Forest becoming Ancient Forest in this way would be a bad idea.

You are correct, i was re-looking at FfH2 and that was right underneath it, i just overlooked it, so 2 tags pls.


<ElementType name="iUpgradeTime" content="textOnly" dt:type="int"/>

0100010
Jun 13, 2013, 06:16 PM
Is it possible for a building to have a requirement of a specific tile improvement in the city vicinity? If not can that be added? (with AND and OR support) And can the building be disabled if the improvement is lost?

Thunderbrd
Jun 15, 2013, 04:13 PM
Is it possible for a building to have a requirement of a specific tile improvement in the city vicinity? If not can that be added? (with AND and OR support) And can the building be disabled if the improvement is lost?

I believe we have something like this already don't we?

Dancing Hoskuld
Jun 15, 2013, 04:16 PM
We have features and resources but not improvement as far as I know. Eg we can't say needs a mine.

Thunderbrd
Jun 15, 2013, 04:32 PM
Ah... I haven't done anything with vicinities so I'm probably not the best qualified to address that one either. Yet. Soon perhaps... I've got a little project that sounds like it may relate to that so I MIGHT be able to fit this request in with that project.

Hydromancerx
Jun 22, 2013, 09:12 PM
Implemented Tags

Building
<GlobalBuildingExtraCommerces>: Changes the commerces of each instance of a building in your civilization.
<GlobalBuildingExtraCommerces>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_FORGE</BuildingClass>
<CommerceType>COMMERCE_CULTURE</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
<BuildingExtraCommerce>
<BuildingClass>BUILDINGCLASS_GRANARY</BuildingClass>
<CommerceType>COMMERCE_RESEARCH</CommerceType>
<iExtraCommerce>1</iExtraCommerce>
</BuildingExtraCommerce>
</GlobalBuildingExtraCommerces>

How do you have it for :gold:? Do you use "GOLD" or "WEALTH" or something else?

EDIT: The answer is "GOLD". I tested it out.

strategyonly
Jun 22, 2013, 09:52 PM
You are correct, i was re-looking at FfH2 and that was right underneath it, i just overlooked it, so 2 tags pls.

We need two tags
FeatureUpgrade
UpgradeTime


<ElementType name="iUpgradeTime" content="textOnly" dt:type="int"/>
<ElementType name="FeatureUpgrade" content="textOnly"/>

<element type="FeatureUpgrade"/>

<element type="FeatureUpgrade"/>


I am still waiting for this?? (2 tags)

Faustmouse
Jun 23, 2013, 01:09 AM
Hi!
I'm about to learn how to mod buildings in C2C to help Hydro and to create my own ones. ThereforeI could also use some Tags (please let me now if the Tagname is not good):

- iGlobalMaintenancePerPop: The value here should be multiplied with the total Pop of your empire.

- iMaintenancePerPop: The value here should be multiplied with the pop in the city.

- iFoodPerPop: The value here should be multiplied with the pop in the city. It is the food you GAIN.

- iCommercePerPop: The value here should be multiplied with the pop in the city. It is the Commerce you GAIN.

- iProductionPerPop: The value here should be multiplied with the pop in the city. It is the Production you GAIN.

- iIncomePerPop: The value here should be multiplied with the pop in the city. It is the Income you GAIN.

Koshling
Jun 23, 2013, 02:09 AM
Hi!
I'm about to learn how to mod buildings in C2C to help Hydro and to create my own ones. ThereforeI could also use some Tags (please let me now if the Tagname is not good):

- iGlobalMaintenancePerPop: The value here should be multiplied with the total Pop of your empire.

- iMaintenancePerPop: The value here should be multiplied with the pop in the city.

- iFoodPerPop: The value here should be multiplied with the pop in the city. It is the food you GAIN.

- iCommercePerPop: The value here should be multiplied with the pop in the city. It is the Commerce you GAIN.

- iProductionPerPop: The value here should be multiplied with the pop in the city. It is the Production you GAIN.

- iIncomePerPop: The value here should be multiplied with the pop in the city. It is the Income you GAIN.

Unless I. Is understand your intent, the first be would be better named iMaintenancePerGlobalPop since (I assume??) it's the maintenance in the city you build the building in multiplied by he pop of your entire civ, NOT maintenance added in every city.

Edit - if someone does take these tags on, don't forget you'll need new AI to handle them too (shouldn't be too hard though)

Thunderbrd
Jun 23, 2013, 04:32 AM
Hi!
I'm about to learn how to mod buildings in C2C to help Hydro and to create my own ones. ThereforeI could also use some Tags (please let me now if the Tagname is not good):

- iGlobalMaintenancePerPop: The value here should be multiplied with the total Pop of your empire.

- iMaintenancePerPop: The value here should be multiplied with the pop in the city.

- iFoodPerPop: The value here should be multiplied with the pop in the city. It is the food you GAIN.

- iCommercePerPop: The value here should be multiplied with the pop in the city. It is the Commerce you GAIN.

- iProductionPerPop: The value here should be multiplied with the pop in the city. It is the Production you GAIN.

- iIncomePerPop: The value here should be multiplied with the pop in the city. It is the Income you GAIN.
I'm not available much right now and will be struggling to get anything done at all for a bit so though I could do it, I'm not going to make any promises.

Interesting tags... I'd suggest if we do them that we make them more granular than mere integer limitations would allow. aka, make them a float (decimal) value. Even +1 Food per population could be waaaay OP because if it added up to +3 Food per pop you'd have a total of well... your people would no longer have need of food.

Koshling
Jun 23, 2013, 09:37 AM
I'm not available much right now and will be struggling to get anything done at all for a bit so though I could do it, I'm not going to make any promises.

Interesting tags... I'd suggest if we do them that we make them more granular than mere integer limitations would allow. aka, make them a float (decimal) value. Even +1 Food per population could be waaaay OP because if it added up to +3 Food per pop you'd have a total of well... your people would no longer have need of food.

Never use float if you can avoid it. Just 100ths should suffice in this case.

Thunderbrd
Jun 23, 2013, 12:09 PM
Just so I understand... in brief, what's the cause for concern? Is it slower to utilize somehow?

Koshling
Jun 24, 2013, 02:16 AM
Just so I understand... in brief, what's the cause for concern? Is it slower to utilize somehow?

Slower and more memory.

Thunderbrd
Jun 24, 2013, 02:24 AM
Ok. Will respect that then and keep things to ints.

God-Emperor
Jun 24, 2013, 01:46 PM
I don't think it's true that it takes up more memory since a single precision float is the size of a 32-bit integer, unless you would use 16-bit "short" integers instead. It also seems to me that throwing in the occasional floating point calculation could be faster rather than slower. Any CPU made in the last several years (newer being better at it) has a good chance of being able to process some integer instructions simultaneously with the floating point instructions which could, in an ideal situation, get you a few floating point operations essentially for free - they might actually add near 0 processing time if the operation is pretty simple since they are using the otherwise unused floating point units in the core as the integer units keep processing any available independent integer instructions.

Interestingly, on any recent Intel CPU it looks like a 32-bit floating point divide is actually faster than a 32-bit integer divide (this info is seems to be hard to come by - I looked at the "Intel® 64 and IA-32 Architectures Optimization Reference Manual", in appendix C); on any Intel processor back at least a couple of generations doing one divide for a pair of 32-bit integers (assuming they are already in registers) generally takes somewhere in the 14-25 clock cycle range (with a series of them you might get them through as fast as 8 cycles each) but it is apparently only about 6 clock cycles for 32-bit floating point numbers (or one every 5 cycles for a series of them) - it used to be slower for a floating point divide but it looks like that is no longer the case (apparently since the "Enhanced Core Architecture", Family 6 Model 17h, which may or may not be the "Core 2" CPU generation; before that it was 32 cycles rather than 6 for the floating point divide), although there may be latencies in other stages of the processing that this does not account for. Floating point adds are 3 clock cycles (and you can push another one into the multiplier every clock cycle) and multiplies are 5 (a series of them gets one started every 2 clock cycles), but with integers it is 1 for an add (and you can apparently start 3 at a time) and a multiply is 3 clock cycles (and you can start 1 per cycle). So in general the integer math is not all that much faster than the floating point math, especially if there is much division involved. And, of course, the CPU can do both at the same time.

All assuming there really is nothing else going on at the time that is already using the floating point units.

Koshling
Jun 25, 2013, 01:12 PM
I don't think it's true that it takes up more memory since a single precision float is the size of a 32-bit integer, unless you would use 16-bit "short" integers instead. It also seems to me that throwing in the occasional floating point calculation could be faster rather than slower. Any CPU made in the last several years (newer being better at it) has a good chance of being able to process some integer instructions simultaneously with the floating point instructions which could, in an ideal situation, get you a few floating point operations essentially for free - they might actually add near 0 processing time if the operation is pretty simple since they are using the otherwise unused floating point units in the core as the integer units keep processing any available independent integer instructions.

Interestingly, on any recent Intel CPU it looks like a 32-bit floating point divide is actually faster than a 32-bit integer divide (this info is seems to be hard to come by - I looked at the "Intel® 64 and IA-32 Architectures Optimization Reference Manual", in appendix C); on any Intel processor back at least a couple of generations doing one divide for a pair of 32-bit integers (assuming they are already in registers) generally takes somewhere in the 14-25 clock cycle range (with a series of them you might get them through as fast as 8 cycles each) but it is apparently only about 6 clock cycles for 32-bit floating point numbers (or one every 5 cycles for a series of them) - it used to be slower for a floating point divide but it looks like that is no longer the case (apparently since the "Enhanced Core Architecture", Family 6 Model 17h, which may or may not be the "Core 2" CPU generation; before that it was 32 cycles rather than 6 for the floating point divide), although there may be latencies in other stages of the processing that this does not account for. Floating point adds are 3 clock cycles (and you can push another one into the multiplier every clock cycle) and multiplies are 5 (a series of them gets one started every 2 clock cycles), but with integers it is 1 for an add (and you can apparently start 3 at a time) and a multiply is 3 clock cycles (and you can start 1 per cycle). So in general the integer math is not all that much faster than the floating point math, especially if there is much division involved. And, of course, the CPU can do both at the same time.

All assuming there really is nothing else going on at the time that is already using the floating point units.

Depends on the context somewhat, and also on compiler optimizations and how the compiler uses registers (bear in mind we're compiling with a complier from 2003). You're right on size though - I was thinking of double precision. I'd still stick with ints unless you NEED more range though, or you'll start finding you're hiding rounding errors that the use of floats causes you to not notice (things like where values get multiplied by various modifiers and then divided by powers of 100 to renormalize - the coding can be easier [aka sloppier] with floats, but really that's only because it hides the fact that you're effectively truncating things via rounding errors - in some ways an obvious overflow is better because it makes a bug easier to spot). There are always exceptions of course, and to some extent it's a matter of taste I guess.

Dancing Hoskuld
Jun 25, 2013, 02:16 PM
Could I have an ObsoleteTech tag on the buildsinfos in the unit folder. There is at least one urgent one, the plant new forest is a poor cousin to the terraform builds.

Thunderbrd
Jun 26, 2013, 08:23 AM
Could I have an ObsoleteTech tag on the buildsinfos in the unit folder. There is at least one urgent one, the plant new forest is a poor cousin to the terraform builds.

Shouldn't be too tough. I'll see what I can do when I catch a moment.

Hydromancerx
Jun 26, 2013, 02:01 PM
@Thunderbrd

Could you make a Building tag that can heal specific unit types. Such as a Siege Weapon Repair Workshop that only heals Siege Weapons in the city? Or a Repair Dock that only heals Boats in the city?

Also could you make a unit tag that works the same way? Meaning they can only heal specific unit types. Thus we could make Mechanics that heal only siege weapons, tanks, robots, etc. While the existing healers could heal melee, recon, mounted, etc.

Thanks!

Thunderbrd
Jun 26, 2013, 11:44 PM
You'll want that for promos as well of course. I'll try to fit that one in soon. We've talked about it for a while now.

Dancing Hoskuld
Jun 27, 2013, 06:10 PM
Do we have a tag on buildings that lets us change the happiness by religion eg -1 for Zoro and +1 for both Druid and MesoAmenrian? I thought we did but I can't see it in the building schema

Hydromancerx
Jun 27, 2013, 10:57 PM
Do we have a tag on buildings that lets us change the happiness by religion eg -1 for Zoro and +1 for both Druid and MesoAmenrian? I thought we did but I can't see it in the building schema

I seems to recall something too, but I can't find it either. So I don't know. :dunno:

Thunderbrd
Jun 27, 2013, 11:39 PM
hmm... not sure. I'd have to dig a bit. I take it none of our current buildings are using one eh?

Hydromancerx
Jul 16, 2013, 02:00 AM
Could someone make a building tag that combines these 3 types of tags into a new tag?


<FreeBonus>BONUS_ALCOHOL</FreeBonus>
<iNumFreeBonuses>1</iNumFreeBonuses>

<TechCommerceChanges>
<TechCommerceChange>
<PrereqTech>TECH_ASSEMBLY_LINE</PrereqTech>
<TechCommerce>
<iCommerce>3</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
</TechCommerce>
</TechCommerceChange>
</TechCommerceChanges>


So it would give say produce 3 Alcohol at Assembly Line Tech.

strategyonly
Jul 19, 2013, 05:50 AM
Still need a dll person to look into this and see if this is feasible, thx.

http://forums.civfanatics.com/showpost.php?p=12519982&postcount=206

Koshling
Jul 19, 2013, 02:48 PM
:whew: I finally found this, about 6 pages back, anyways i need a NEW tag for FeaturesInfos:


<FeatureUpgrade>FEATURE_FOREST_NEW</FeatureUpgrade>

Schema info:
<ElementType name="FeatureUpgrade" content="textOnly"/>

<element type="FeatureUpgrade"/>

<element type="FeatureUpgrade"/>

FeatureUpgrade- If this improvement has a chance to turn into a feature.

Source Code in FfH2 from Kael here: http://forums.civfanatics.com/showpost.php?p=5817028&postcount=1 (about 1/3 of the page down)

(This is what was proposed?)from DH ???
The only solution I thought of was having a burnt forests (burnt_forest_n ... burnt_forest_0) where n was the number of turns on the slowest speed. Then put the correct burnt_forest_k for the game speed on the plot. Then every turn go throw every plot and if it has burnt_forest_i on it change it to burnt_forest_(i-1) and replace it with forest if it was burnt_forest_0.

Way to complicated for me, sorry, its better to have just 1 tag. . .

It's certainly feasible, but if the improvement is on a plot that ALREADY has a feature what should happen? I assume just replace the existing feature? It could add a second one I guess, if the multi-feature stuff is active, but I don't think it is by default (is it?)

strategyonly
Jul 19, 2013, 03:08 PM
It's certainly feasible, but if the improvement is on a plot that ALREADY has a feature what should happen? I assume just replace the existing feature? It could add a second one I guess, if the multi-feature stuff is active, but I don't think it is by default (is it?)

No we have the coding possible for it NOT to have 2 features on the same plot, ie" Great Farmer. This code above is needed for CHOPPING of the forest(burnt) and to have that area then be re-placed by a NEW forest. (At least in theory)

Dancing Hoskuld
Jul 19, 2013, 04:49 PM
It's certainly feasible, but if the improvement is on a plot that ALREADY has a feature what should happen? I assume just replace the existing feature? It could add a second one I guess, if the multi-feature stuff is active, but I don't think it is by default (is it?)

We are asking for a feature upgrade similar to an improvement upgrade but not worked versions. Ie the upgrade happens only if the plot is not being worked and does not have an improvement on it. I think - I am only just having my first coffee at the moment.

For example: volcano burns down a forest leaving burnt forest feature on the plot. After a while this regenerates into new forest which becomes normal forest. Note I doubt we want it to become ancient forest.

Thunderbrd
Jul 20, 2013, 05:04 PM
No we have the coding possible for it NOT to have 2 features on the same plot, ie" Great Farmer. This code above is needed for CHOPPING of the forest(burnt) and to have that area then be re-placed by a NEW forest. (At least in theory)

The great farmer plants Bonuses, not features. At the moment we can only have one Bonus (resource) on a plot but Koshling had some great ideas about bonus groups and being able to have the ability to swap a bonus for another. Anyhow, just wanted to point out the difference as a Forest is a feature rather than a Bonus.

RidetheSpiral23
Aug 07, 2013, 06:51 PM
Anyone willing to add a tag to techs for yield changes to types of terrain?

Thunderbrd
Aug 07, 2013, 10:12 PM
Anyone willing to add a tag to techs for yield changes to types of terrain?

That's usually handled through improvements. If you could justify how this should NOT be handled with an adjustment to or further development on improvements, I'd be interested in hearing what you have in mind.

RidetheSpiral23
Aug 08, 2013, 10:12 AM
That's usually handled through improvements. If you could justify how this should NOT be handled with an adjustment to or further development on improvements, I'd be interested in hearing what you have in mind.

You're right that improvements handle that pretty well already and I will probably be doing some enhancements to improvements soon as well.

Basically my need for yield changes on tech is to better simulate certain technologies like gathering, fishing, etc. Basically terrain yields would begin lower than they do now. You research gathering, grasslands get +1 food. You research hand fishing, you get +1 food on water tiles.

Not sure if I am explaining well enough. The base purpose is to get away from early extreme unhealthiness to simulate difficulty of maintaining food supplies.

Dancing Hoskuld
Aug 08, 2013, 03:36 PM
@thunerbrd the tag for obsoleting improvements by tech, :blush: I am embarrassed to say that it turns out that it was not the improvement I needed it on but the build (the build infos file in XML/Units). The point is to stop workers building that improvement not to turn the improvement off as existing ones dhould still do their thing.:mischief:

Basically my need for yield changes on tech is to better simulate certain technologies like gathering, fishing, etc. Basically terrain yields would begin lower than they do now. You research gathering, grasslands get +1 food. You research hand fishing, you get +1 food on water tiles.

Not sure if I am explaining well enough. The base purpose is to get away from early extreme unhealthiness to simulate difficulty of maintaining food supplies.

Sounds like a good plan. More detailed than what I was going to suggest which was to do what RoM did and increase the amount of food a unit consumes a turn.

RidetheSpiral23
Aug 08, 2013, 04:29 PM
Sounds like a good plan. More detailed than what I was going to suggest which was to do what RoM did and increase the amount of food a unit consumes a turn.

Thank you. I always felt that the evolution of food production could be better expressed than through buildings alone. I was considering a plan to allow for the placement of "livestock" resources once the player has subdued one. Basically subdue a wild auroch and use it to build a cow breeder building. From there workers/gatherers could build a cow "grazer" tile improvement. As its worked by the city it will upgrade (also determined by tech) into rangeland, pasture, ranch etc. This could also be done with grains, fruits, and vegetables. Does that sound like something that would improve/make more fun the gameplay?

Faustmouse
Aug 08, 2013, 04:31 PM
Does that sound like something that would improve/make more fun the gameplay?

Yes! :goodjob:

Thunderbrd
Aug 08, 2013, 08:24 PM
You're right that improvements handle that pretty well already and I will probably be doing some enhancements to improvements soon as well.

Basically my need for yield changes on tech is to better simulate certain technologies like gathering, fishing, etc. Basically terrain yields would begin lower than they do now. You research gathering, grasslands get +1 food. You research hand fishing, you get +1 food on water tiles.

Not sure if I am explaining well enough. The base purpose is to get away from early extreme unhealthiness to simulate difficulty of maintaining food supplies.
Ah... so in other words, we turn down the base rates on tiles a bit and give these to compensate, thereby stretching the prehistoric era a bit. Sounds like something that could be really useful for civilizations developing the technologies to better use new 'dead' planets too.

Ok, but I can't say it will be the HIGHEST priority. This is not a simple request. Perhaps by the end of next cycle.

@thunerbrd the tag for obsoleting improvements by tech, :blush: I am embarrassed to say that it turns out that it was not the improvement I needed it on but the build (the build infos file in XML/Units). The point is to stop workers building that improvement not to turn the improvement off as existing ones dhould still do their thing.:mischief:
Well, that's good considering that I added a tag to obsolete Builds by tech as you requested. We already had improvement tech obsoletions didn't we?

Dancing Hoskuld
Aug 08, 2013, 11:07 PM
Well, that's good considering that I added a tag to obsolete Builds by tech as you requested. Oh, I must have misread. We already had improvement tech obsoletions didn't we?No only on resources as far as I can see.

Thunderbrd
Aug 08, 2013, 11:11 PM
I'm just glad what I did was actually what you wanted bud... was not a simple project and woulda been frustrating to find out I need to have done the other instead. lol

MrAzure
Oct 15, 2013, 04:53 PM
GOM_YIELDS
GOM_COMMERCE
So we can easily modified them in your property system, like have buildings require a certain amount of culture, espionage, food to be built.

Do you have other attributes besides Population?
I was wondering if we could have attributes for specific yields and commerce.

God-Emperor
Oct 15, 2013, 09:16 PM
The current attribute types for the expression system:
ATTRIBUTE_POPULATION
ATTRIBUTE_HEALTH
ATTRIBUTE_HAPPINESS

So no yields or commerces.

MrAzure
Dec 05, 2013, 02:00 PM
If possible:

MaxPopulation Max population the building can exist it at. if set at 5, the building obsoletes at Population 5. The reverse of PrereqPopulation.

Message: The at [city] has closed because your city is not rural anymore.


[B]ObsoleteCulture Max culture level the building it can exist at. The reverse of cultureLevel.

Message: The at [city] has closed because it is considered too barbaric by your citizens.


[B]MaxAngerRatio If the Anger-Happiness Ratio is exceed, the building obsoletes. Example is 1.2, if there is 20% more :mad: than :) it obsoletes.
Message: The at [city] has closed because the city has too many angry citizens.

[B]MaxUnhealthyRatio If the Anger-Happiness Ratio is exceed, the building obsoletes. Example is 1.2, if there is 20% more :cry: than :health: it obsoletes.
Message: The [building] at [city] has closed because the city has too many unhealthy citizens.

Faustmouse
Dec 05, 2013, 02:05 PM
For the latter two, the opposide tags would also be intersting: Need at least a :) to :mad: ratio of 1.2 to be build. And for :health: to :yuck:.