The Outcome System

I have asked before but is it possible to have an outcome tag to identify an improvement or feature that needs to be on the plot for the outcome to happen.

Needed for
  • Diplomacy with Indigenous Peoples
  • Exploration of ruins by explorers and adventurers
  • Exploration of shipwrecks.
 
I have asked before but is it possible to have an outcome tag to identify an improvement or feature that needs to be on the plot for the outcome to happen.

Needed for
  • Diplomacy with Indigenous Peoples
  • Exploration of ruins by explorers and adventurers
  • Exploration of shipwrecks.
Yes, but unfortunately my time for modding is very limited at the moment.
I preferably want to get that done with the expression system I am working on.
 
Hi, I am back working on this:mischief: and need some way to specify the mission can only happen when the unit is on the indigenous people improvement. Any chance? :)
 
Hi, I am back working on this:mischief: and need some way to specify the mission can only happen when the unit is on the indigenous people improvement. Any chance? :)
Best would be to use the expression system here now to specify when it should be active. I'll add that but I won't get around to it until probably next Tuesday or so (as I am gone for the weekend and my local code version already has all the changes for caches so I need to finish that at the same time).
 
@AIAndy currently I have a number of outcome missions for subdue animals which are the same for almost all subdued animal. Is it possible to have defaults and overrides instead?

Example is the following code that appears in the Unit Infos file for most subdued animals in the actions area
Code:
				<Action>
					<MissionType>MISSION_RECORD_TALE_ORAL</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_RECORD_TALE_ORAL1</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>1</iYield>
							</Yields>
							<Commerces>
								<iCommerce>0</iCommerce>
								<iCommerce>0</iCommerce>
								<iCommerce>1</iCommerce>
								<iCommerce>0</iCommerce>
							</Commerces>
						</Outcome>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_RECORD_TALE_ORAL2</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>2</iYield>
							</Yields>
							<Commerces>
								<iCommerce>0</iCommerce>
								<iCommerce>0</iCommerce>
								<iCommerce>5</iCommerce>
								<iCommerce>0</iCommerce>
							</Commerces>
						</Outcome>
					</ActionOutcomes>
				</Action>
				<Action>
					<MissionType>MISSION_ANIMAL_STUDY</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_STUDY1</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>2</iYield>
							</Yields>
						</Outcome>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_STUDY2</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>5</iYield>
							</Yields>
						</Outcome>
					</ActionOutcomes>
				</Action>
 
@AIAndy currently I have a number of outcome missions for subdue animals which are the same for almost all subdued animal. Is it possible to have defaults and overrides instead?

Example is the following code that appears in the Unit Infos file for most subdued animals in the actions area
Code:
				<Action>
					<MissionType>MISSION_RECORD_TALE_ORAL</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_RECORD_TALE_ORAL1</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>1</iYield>
							</Yields>
							<Commerces>
								<iCommerce>0</iCommerce>
								<iCommerce>0</iCommerce>
								<iCommerce>1</iCommerce>
								<iCommerce>0</iCommerce>
							</Commerces>
						</Outcome>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_RECORD_TALE_ORAL2</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>2</iYield>
							</Yields>
							<Commerces>
								<iCommerce>0</iCommerce>
								<iCommerce>0</iCommerce>
								<iCommerce>5</iCommerce>
								<iCommerce>0</iCommerce>
							</Commerces>
						</Outcome>
					</ActionOutcomes>
				</Action>
				<Action>
					<MissionType>MISSION_ANIMAL_STUDY</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_STUDY1</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>2</iYield>
							</Yields>
						</Outcome>
						<Outcome>
							<OutcomeType>OUTCOME_ANIMAL_STUDY2</OutcomeType>
							<iChance>100</iChance>
							<Yields>
								<iYield>0</iYield>
								<iYield>0</iYield>
								<iYield>5</iYield>
							</Yields>
						</Outcome>
					</ActionOutcomes>
				</Action>
Hmm, you mean define default chances, yields and commerces in the outcome type? So you just specify the outcome type and it will use the defaults for that type if you don't override?
 
Hmm, you mean define default chances, yields and commerces in the outcome type? So you just specify the outcome type and it will use the defaults for that type if you don't override?

Yes exactly. It has just been suggested that I adjust the returns for those outcomes which means I need to do it for each animal and that leaves a lot of room for making mistakes. ;)
 
It was really ironic that you guys were posting in here as I was trying to read up on this section to get an idea of what we can/cannot do with these right now.

I get this strong indication this is a wonderful tool overall that can be used for... for just about anything!

But we haven't gotten much of an explanation of what or how to go about getting it to do anything more than create combat results. I'd really like to see this explained in detail from the top down and show us what we can (and specifically what we cannot) do with all this.

Had I understood this better I might've been able to work with this amazing structure for the curing missions as you had insinuated I probably should've done. And with a lot of planning in the works for the Nomadic Start, I'd like to really get a full picture on this.

I suppose I could look at some of the xml, but I figure I'm not going to get a full understanding that way.

The idea that these missions could be tied to events and thus pretty much able to accomplish ANYTHING that way is pretty cool in and of itself, but yeah, how would you work the ai on that? Can these missions be referred to in the dll as part of what an ai routine could seek to initiate under certain conditions? Would I be wrong in presuming it would simply take updating the enums file in the dll to be able to access them like any other mission?

Outside of that, I take it we're developing this out somewhat as we go in terms of: function is needed, thus function is programmed and eventually we should have enough to cover nearly any scenario? Where's a nicely documented list of all of the functions we currently allow here then?

The format on how to make things work here could do for a lot of explanation as well.

I'm not just asking for me but also for future modders who could make great use of this amazing mechanism!
 
I am tying missions to events for all the diplomatic stuff. The one problem I am having is that some missions are defined in the dll and I can't change that. If a unit can give a culture boost, as defined by the XML values, then it must be a Great Artist and get the GA's version of a cultural boost, ie remove all anarchy turns. The only way around it is to remove those values from the XML, I suppose, and put them in the outcome but then how do I pass the info to the event.
 
It was really ironic that you guys were posting in here as I was trying to read up on this section to get an idea of what we can/cannot do with these right now.

I get this strong indication this is a wonderful tool overall that can be used for... for just about anything!

But we haven't gotten much of an explanation of what or how to go about getting it to do anything more than create combat results. I'd really like to see this explained in detail from the top down and show us what we can (and specifically what we cannot) do with all this.
I guess I should write a tutorial on it.

Had I understood this better I might've been able to work with this amazing structure for the curing missions as you had insinuated I probably should've done. And with a lot of planning in the works for the Nomadic Start, I'd like to really get a full picture on this.

I suppose I could look at some of the xml, but I figure I'm not going to get a full understanding that way.

The idea that these missions could be tied to events and thus pretty much able to accomplish ANYTHING that way is pretty cool in and of itself, but yeah, how would you work the ai on that?
There is some evaluation of outcomes for the AI but that only includes some of the features, mainly those that are already used in missions for subdued animals and that is also the only part of the AI code that it uses that evaluation.

Can these missions be referred to in the dll as part of what an ai routine could seek to initiate under certain conditions? Would I be wrong in presuming it would simply take updating the enums file in the dll to be able to access them like any other mission?
Eh, I see you already added some there. Preferably remove them again.
All behind the last in the enum should be considered outcome missions and referring to a specific one should be avoided (but can be done with the usual name resolution). That is not a very nice solution either but better than updating that enum every time you add an outcome mission.
So in short: Hard coded missions are all at the start of the main mission file, outcome missions are behind it and in modular code.

Outside of that, I take it we're developing this out somewhat as we go in terms of: function is needed, thus function is programmed and eventually we should have enough to cover nearly any scenario? Where's a nicely documented list of all of the functions we currently allow here then?
Well, yes, I originally made the outcome system specifically for animal kill outcomes and it got later extended to outcome missions.
The documentation is limited to what is in this thread at the moment so yes, I'll write a tutorial/reference.
 
Eh, I see you already added some there. Preferably remove them again.
All behind the last in the enum should be considered outcome missions and referring to a specific one should be avoided (but can be done with the usual name resolution). That is not a very nice solution either but better than updating that enum every time you add an outcome mission.
So in short: Hard coded missions are all at the start of the main mission file, outcome missions are behind it and in modular code.
I included those in fear that if I did not, I'd screw up the enumeration by adding the hard coded mission I was adding. So I can still just leave those off then without it causing trouble?
 
I included those in fear that if I did not, I'd screw up the enumeration by adding the hard coded mission I was adding. So I can still just leave those off then without it causing trouble?
Well, the order needs to be the same in the mission XML as it is in the enum but in both cases the hard coded missions should be before the outcome missions.
 
That won't cause any trouble for savegame compatibility then? Cool... good to know. So I'll try to remember to go back and reorder things this weekend.
 
That won't cause any trouble for savegame compatibility then? Cool... good to know. So I'll try to remember to go back and reorder things this weekend.
Oh, well, I didn't think about that. Both the order queue and the mission queue can store missions and they are not currently remapped so it will mix the missions there if the order is changed.
So I guess to keep savegame compatibility leave the order as it is.
 
Oh, well, I didn't think about that. Both the order queue and the mission queue can store missions and they are not currently remapped so it will mix the missions there if the order is changed.
So I guess to keep savegame compatibility leave the order as it is.

We should probably add remapping of this type. It's pretty mechanical to do.
 
@AIAndy:

I have some questions regarding the Outcome System.

1. Is it possible to put an Outcome on a building right now? IE, if you have a building in a city you can trigger the outcome by pressing a button?

2. Is it possible to give Outcomes cooldowns?

3. How is it currently possible to choose targets for an Outcome? Would it be possible to select a city from a list as a target for an Outcome triggered by a building?

I ask this because I'm thinking about how to implement Cyberwarfare in C2C, and using the Outcome system seems like the idea that would require the least work. To get my initial ideas to work I'd at least need those three things to be possible.
 
@AIAndy:

I have some questions regarding the Outcome System.

1. Is it possible to put an Outcome on a building right now? IE, if you have a building in a city you can trigger the outcome by pressing a button?
No, outcomes always expect a unit to be the source.

2. Is it possible to give Outcomes cooldowns?
Yes, indirectly. If you want a cooldown on an outcome mission (and I think we talk about outcome missions here) you add a energy/cooldown/whatever property that has a limited constant source and then you give the outcome mission a property cost.

3. How is it currently possible to choose targets for an Outcome? Would it be possible to select a city from a list as a target for an Outcome triggered by a building?
No target selection at the moment.

I ask this because I'm thinking about how to implement Cyberwarfare in C2C, and using the Outcome system seems like the idea that would require the least work. To get my initial ideas to work I'd at least need those three things to be possible.
If buildings get abilities, some new UI should be added to the city screen separately from the unit controls that there are now.
And I also think this would deserve a serious extension of the system with entirely new parts. I would suggest that we go towards adding effects, both one time effects and lasting effects. Currently we have a lot of split parts that have effects: Buildings, civics, traits, promotions, .... There is a lot of code copying in between those parts to apply same effects.
So I would say adding a new system that is about effects with scaling, stacking behavior, triggering addition and removal (so you can also have temporary effects) and outcomes that can apply effects.

Buildings are already used as ways to apply effects but they have neither scaling nor stacking behavior.
 
If buildings get abilities, some new UI should be added to the city screen separately from the unit controls that there are now.
And I also think this would deserve a serious extension of the system with entirely new parts. I would suggest that we go towards adding effects, both one time effects and lasting effects. Currently we have a lot of split parts that have effects: Buildings, civics, traits, promotions, .... There is a lot of code copying in between those parts to apply same effects.
So I would say adding a new system that is about effects with scaling, stacking behavior, triggering addition and removal (so you can also have temporary effects) and outcomes that can apply effects.

Buildings are already used as ways to apply effects but they have neither scaling nor stacking behavior.

So what you are saying is that it would require a good amount of work to support, right? Because what you are suggesting is something that has been on my mind for a while now, adding effects (as special buildings now, but if we want to create an Effects object class that's fine too). So this could be used to replace the Pests, Crime, and Pollution buildings is what you are saying?

Also, would this be something you could work on in the V28 cycle?
 
So what you are saying is that it would require a good amount of work to support, right? Because what you are suggesting is something that has been on my mind for a while now, adding effects (as special buildings now, but if we want to create an Effects object class that's fine too). So this could be used to replace the Pests, Crime, and Pollution buildings is what you are saying?
I don't think there is a need to replace that part as it works well as it is but it would be good to have the framework to do temporary effects or effects that scale with some budget or similar things and also have more options for one time effects for outcomes.

Also, would this be something you could work on in the V28 cycle?
I can do that but I still have very little time at the moment so I am unsure how fast this will progress.
 
Back
Top Bottom