The Outcome System

Pre v35 release a bug has been discovered in the Captives outcomes which I can't fix in the XML as far as I can see. The remove slavery etc needs to only be available in your cities. Currently it checks for the building in the city that the unit is in and that the city is friendly. This means that if you are in a city of a vassal, colony or nation you have open borders or better with and they have the building in that city your GP has the option to remove slavery.


You could try using a PlotCondition for the Outcome.
Code:
				<Action>
					<MissionType>MISSION_REMOVE_WV_CANNIBALISM</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_REMOVE_WV_CANNIBALISM</OutcomeType>
							<iChance>100</iChance>
							<PythonCallback>doRemoveWVCannibalism</PythonCallback>
							<PlotCondition>
								<Is>TAG_OWNED</Is>
							</PlotCondition>
						</Outcome>
					</ActionOutcomes>
				</Action>
 
Thanks, I'll try it out. Of course I now need to put it on almost all the missions I have done :D

Oh no, it is not on the mission outcome but every unit that uses that mission outcome. That is even worse to code!. Is it possible to use the same code on the actual outcome definition so it is used for all units?
 
At the moment you have to do it this way. The PlotCondition tag can be used for the whole Action or for every Outcome inside of ActionOutcomes.
 
bCity, bFriendly are on the Outcome definition. Looks like I made the assumption that made it your city. This means I am going to have to go through all the outcome actions and change them all.
 
Yes I am going to have to do this to 100% of the outcomes that are for missions in a city. :(

How do I do an "and" for when I already have a plot condition?
 
I may be able to research the implementation of the bFriendly tag there and adapt a new tag to make it much easier for you - then you can do a mass xml search and replace on notepad to replace the bFriendly tag use.

What you've got ahead is daunting.
 
Yes I am going to have to do this to 100% of the outcomes that are for missions in a city. :(

How do I do an "and" for when I already have a plot condition?
Code:
<PlotCondition>
  <And>
    <Whatever>You Already Have</Whatever>
    <Is>TAG_OWNED</Is>
  </And>
</PlotCondition>
 
Currently we have KillOutcomes and ActionOutcomes. Can we have a new set EncounterOutcomes?

In particular I am thinking of the Mine Warfare stuff when an non-friendly unit enters a plot with an armed mine or mine field in the plot.

The current python code hard codes the
  • chance of detonating the mine
  • the percentage damage done
this is done for each mine-unit pair. Some of it is done at the unit combat class level.

This may have applications elsewhere eg with criminals.
 
What other kinds of encounters would there be?

I'm thinking that given the move rule complexities and my familiarity with them in C2C, it would not be a bad idea to completely recode mines. I'm thinking in terms of a larger mechanism here that would include traps as well.

It would be nice to be able to specify:
  • What type of (trap) unit a particular unit can 'spawn'.(laying of trap)
  • How MANY trap units can be spawned/laid. (And would track against the laying unit)
  • What kinds of unitcombats the trap can effect and the compiling % modifier of that unitcombat setting off the trap. Example: A common landmine would only be triggered by Tracked, Wheeled or Foot Mobility units but Tracked unit would have something like a 70% likelihood of setting it off, a Wheeled may have a 50% likelihood, while a Foot unit a 25% chance. However, this would then be further modified by Group Volume and Size if SM is in play. Listed modifiers from those would be added in.
  • The effect of the trap could be damage but could also be an affliction. Example: a bear trap could not only do a little damage but could also inflict an affliction that immobilizes the unit until the affliction is overcome.
  • Promotions to enhance the types/amounts of traps that can be set. (Would play into equipment development) Perhaps even promotions that designate promotions to be added to the traps that the unit sets... promos for added invisibility value for example. Possibly promotions to add other afflictions, such as 'poisoned' bear traps.
  • If the trap would affect friend and foe alike or only foe.
  • Does the trap get removed after one triggering OR does it remain? Does it remain for a fixed number of triggers?

While this all may seem like it would be a lot to set up, from a coding perspective, so much of the groundwork has already been laid that it would be rather just extensions of previous projects. The placement of where to code this stuff, and the interactions, is very clear to me now after setting up stealth defenses. I'm not sure the python can pinpoint the same pre-battle placement without some work to give it a new entry point.

So the question becomes, what other types of encounters are you considering here?
 
Certainly not automatically, no, but it would fit into the plan to include that into the final stage of this version's AI development. That kind of AI work is already looming and would be easier to have this kind of thing in place BEFORE arranging those AIs rather than after.

I do admit though it would be rather interesting trying to consider how the AI could and should adapt in a generic fashion. However, one new AI type planned could almost take care of the majority of the defensive or reactive need already with little to no adjustment to the concept - a unit AI for the AI to check off that its primary stacks and cities have attempted to specialize a unit or more to make itself capable of expanding its visibility of each given type of invisibility. This will work for the core as well so that the AI will, for example, want a dog in each city with as enhanced visibility as it can achieve, as well as having a dog along with any major stack effort fulfilling the same role. With this AI in place, the defensive AI for traps would work right in since traps would be placed under unique invisibility types and thus if the AI can build a unit to see that kind of invisibility, it will do so and try to staff one in each city and major stack effort. So it would automatically be reacting to the need as the XML is added for new traps. With traps in play, a little adjustment to that particular AI's valuing of some trap specific (like clearing or moving values) xml tags would get more value for 'vision' AIs so it would assume that those units intended to find traps are also those that would be best at undoing them. If we follow that line of thinking in general then with design, the AI should adapt quite nicely.

Offensively... might take a new AI type entirely or some adaptation for the types that would generally be intended to make use of setting traps. Perhaps some traps themselves would need differing AItypes, not to establish new AI routines, but to give them something to define their 'use'. For example, a 'military trap' might include a land mine or naval mine and may be best to place along likely paths to valuable military targets (cities) or around forts. But a 'hunting trap' might be best to place where spawn points are located, or just outside them. There could be other types of course and we'd think of how to give the AI consideration on when and where to place them by each type on the trap unit itself.

@DH: how GOOD is the AI in regards to this?

Also: What would you prioritize? Realistic Culture Tags or Mines?
 
@DH: how GOOD is the AI in regards to this?

Also: What would you prioritize? Realistic Culture Tags or Mines?

Not sure as I have not played with it in a long while. It was mining its borders and sweeping for mines in enemy territory. I think it was building a mine sweeper for its stacks both land and sea. I am not sure how the AI will fit with C2C's.

Personally, I would prefer Realistic Culture Spread tags. I have attempted to get Mine warfare in three or four times so far.

We will need to something like a couple of UN Resolutions/Conventions one for mines and another for gas if/when we add gas. Although Conventions are only binding if you sign up to them unlike the resolutions. Signing would increase your relationship with others.
 
Not sure as I have not played with it in a long while. It was mining its borders and sweeping for mines in enemy territory. I think it was building a mine sweeper for its stacks both land and sea. I am not sure how the AI will fit with C2C's.

Personally, I would prefer Realistic Culture Spread tags. I have attempted to get Mine warfare in three or four times so far.

We will need to something like a couple of UN Resolutions/Conventions one for mines and another for gas if/when we add gas. Although Conventions are only binding if you sign up to them unlike the resolutions. Signing would increase your relationship with others.

Ok. Been thinking on the trap concept and really liking the concept as a whole but not sure I'd like it if it were overly direct which for C2C sounds like it may be with his original version. But I'm happy to look at Realistic Culture Spread tags first. I'll have to see what's taking place in the code for that and let you know what I think I can do with it.
 
Top Bottom