The Outcome System

It is always when I get around to trying to add something that I find I need something different to what is available.:mischief:

While converting Capt_Blondbeard's Barbarian Envoy mod to outcomes I realised that it

1) can only occur in a barbarian city

2) the probability of the events is modified by the population

3) one result has a number of units joining you as tribute, not just one

4) one result has a random amount of gold paid to you as tribute.
This of course reminded me that the WLBO mod gooddy hut/village also needs its missions limited to a feature as does Kathy's Explore City Ruins.

So can the mission/outcome

1) be limited to only barbarian cities or to a feature such as goody_village (to be added) or city_ruins.

2)call some python code
OR
If city based have a probability (set) based on the population EG
rand value <= 28-2*pop gives outcome 1
28-2*pop < rand value <= 28-2*pop + 20 gives outcome 2
28-2*pop + 20 < rand value <= 28-2*pop + 40 gives outcome 3
else gives outcome 4



...or why not have as a posible outcome an EVENTRIGGER. Then use all the (existing) event mechanisms to do what you want...?
 
...or why not have as a posible outcome an EVENTRIGGER. Then use all the (existing) event mechanisms to do what you want...?

Sounds like an excellent solution for the actual outcome. The limit on where it can occur would still need to be in the mission or outcome system still since we are talking about a button on the UI screen for the humans.

Not sure what to do about the AI players. The Barbarian Envoy mod is about getting a barb city to join you or pay tribute (in money or troops) but may backfire. The part of the WLBO mod is about the village left after you explore a goody hut. Incorporating that is much more ambitious and will require the property system as well.;)

I am only working on the Barbarian Envoy in the background.

Edit I am a bit dim this morning, after a late night, and there is no coffee:eek: but I can't see how to achieve what I want with events. As I said I am a bit dim this morning. So I will look at it again later.
 
Sounds like an excellent solution for the actual outcome. The limit on where it can occur would still need to be in the mission or outcome system still since we are talking about a button on the UI screen for the humans.
Well, the event trigger also defines conditions and the check if an outcome is possible could also include calls to some of the event trigger canTrigger functions.
 
Sounds like an excellent solution for the actual outcome. The limit on where it can occur would still need to be in the mission or outcome system still since we are talking about a button on the UI screen for the humans.

Not sure what to do about the AI players. The Barbarian Envoy mod is about getting a barb city to join you or pay tribute (in money or troops) but may backfire. The part of the WLBO mod is about the village left after you explore a goody hut. Incorporating that is much more ambitious and will require the property system as well.;)

I am only working on the Barbarian Envoy in the background.

Edit I am a bit dim this morning, after a late night, and there is no coffee:eek: but I can't see how to achieve what I want with events. As I said I am a bit dim this morning. So I will look at it again later.

The downside of using an outcome to trigger an event is, as you mention, AI evaluation. Simplest thing (for such complex outcomes that need this much flexibility) is just to resort to an AIWeight on the outcome and hand-tune them. So long as these outcomes are not available on units that have a ton of other different choices of different kinds we'd have to compare against, that shouldn't be too bad.
 
So if I use events the button will appear active for the unit anywhere and pressing it in the wrong place will give the message "You can't do that here." or maybe "I can't do that Dave!". Not very friendly.:mischief:

Oh, well back to the old method of putting it all in CvmainInterface.py which is easier but means the AI doesn't know about it at all, in this case.
 
So if I use events the button will appear active for the unit anywhere and pressing it in the wrong place will give the message "You can't do that here." or maybe "I can't do that Dave!". Not very friendly.:mischief:

Oh, well back to the old method of putting it all in CvmainInterface.py which is easier but means the AI doesn't know about it at all, in this case.

When I suggsted this I hadn't taken in all 4 of your points in the post that it was originally a reply to. This suggestion doesn't help constrain the triggering conditions - it was the other 3 points you made (which were all about the nature of the outcome) I was meaning this as a solution to.
 
When I suggsted this I hadn't taken in all 4 of your points in the post that it was originally a reply to. This suggestion doesn't help constrain the triggering conditions - it was the other 3 points you made (which were all about the nature of the outcome) I was meaning this as a solution to.

As far as I can see I would need one event trigger for each population of the city and a random number to give the actual event. IE I can't see where to adjust the random number to give the event based on the population of the city.

OK I can see where to call the python that does the work. That may work, I give it a try.

EditSo I need
1) some way to identify a barbarian city. Would bCity=1 and bNeutralTerritory=1 work?

2) A way to call an event trigger​
 
As far as I can see I would need one event trigger for each population of the city and a random number to give the actual event. IE I can't see where to adjust the random number to give the event based on the population of the city.

OK I can see where to call the python that does the work. That may work, I give it a try.

EditSo I need
1) some way to identify a barbarian city. Would bCity=1 and bNeutralTerritory=1 work?

2) A way to call an event trigger​
The idea was like this:
An outcome can specify an event trigger (not yet, but I can implement it). The isPossible of the outcome would then in addition to the usual conditions for outcomes call at least some of the canTrigger stuff of the event trigger. The action only appears if there is a possible outcome in the action outcome list and if it specifies and event trigger it will only be possible if the event trigger can trigger.
If the outcome is executed, it will then also trigger the associated event which can among other things also have Python code (although it might be useful to have a separate Python callback for outcomes so you don't always have to go via events).

In regards to population influencing outcome chance, that is something I can add.

EDIT: Btw, Barbarian cities are not neutral territory, they are barbarian territory, which is hostile. I can add a tag there.
 
AIAndy. I created a variable SUBDUE_ANIMAL_AUTO_GOTO_CITY in the A_New_Dawn_GlobalDrfines.XML file to make autobeam an option.

Then tried to use it in the unit infos file outcomes
Code:
			<KillOutcomes>
				<Outcome>
					<OutcomeType>OUTCOME_SUBDUE</OutcomeType>
					<iChance>10</iChance>
					<UnitType>UNIT_SUBDUED_AARDVARK</UnitType>
					<bUnitToCity>SUBDUE_ANIMAL_AUTO_GOTO_CITY</bUnitToCity>
				</Outcome>

but I get the error as shown in the attachment.
 

Attachments

  • outcome_err.jpg
    outcome_err.jpg
    22 KB · Views: 58
AIAndy. I created a variable SUBDUE_ANIMAL_AUTO_GOTO_CITY in the A_New_Dawn_GlobalDrfines.XML file to make autobeam an option.

Then tried to use it in the unit infos file outcomes
Code:
			<KillOutcomes>
				<Outcome>
					<OutcomeType>OUTCOME_SUBDUE</OutcomeType>
					<iChance>10</iChance>
					<UnitType>UNIT_SUBDUED_AARDVARK</UnitType>
					<bUnitToCity>SUBDUE_ANIMAL_AUTO_GOTO_CITY</bUnitToCity>
				</Outcome>

but I get the error as shown in the attachment.
Unfortunately that kind of thing currently only works if it is specifically considered in the XML reading code and the schema.

But thinking about it, since global defines are actually read first, it should be possible to add that behavior to all tags. So if it is the expected int or bool, then use it, otherwise consider it as a global define name and look up the int or bool there.
 
Unfortunately that kind of thing currently only works if it is specifically considered in the XML reading code and the schema.

But thinking about it, since global defines are actually read first, it should be possible to add that behavior to all tags. So if it is the expected int or bool, then use it, otherwise consider it as a global define name and look up the int or bool there.

OK! I just thought I could do a quick option since when I introduced autobeaming back to a city for captured animals I got two responses one at each end of the spectrum. With it optional I could keep both happy.:D
 
OK! I just thought I could do a quick option since when I introduced autobeaming back to a city for captured animals I got two responses one at each end of the spectrum. With it optional I could keep both happy.:D

I'm coming round to it. I sort of feel it's a bit easy-mode, but it's also fantastically useful on certain maps (England on GEM with hunters in Africa and Asia in pre-history lol). This is both a pro and a con argument at the same time (I benefitted HUGELY from it, but it's WAY unrealistic)
 
I'm coming round to it. I sort of feel it's a bit easy-mode, but it's also fantastically useful on certain maps (England on GEM with hunters in Africa and Asia in pre-history lol). This is both a pro and a con argument at the same time (I benefitted HUGELY from it, but it's WAY unrealistic)

I introduced it because the AI was did not seem to take the animals back to cities and use them. They just stayed in stacks with the hunter even when adjcent to their own cultural borders.

I like it for fish but not for land animals.
 
I introduced it because the AI was did not seem to take the animals back to cities and use them. They just stayed in stacks with the hunter even when adjcent to their own cultural borders.

I like it for fish but not for land animals.
That part is better fixed in the AI code. It stacks up on purpose to protect the animals which I think is only dissolved once they are in cultural territory (and not right next to it).
 
The problem was that I watched a hunter move along their border to get more animals without dropping of the ones it already had. :(

BTW, I have looked further into what I would need in the outcome system to get the Barbarian Envoy to use it. You suggested an event but I keep avoiding understanding them. So that should be my next task, not adding frogs to the animals.
 
The problem was that I watched a hunter move along their border to get more animals without dropping of the ones it already had. :(

BTW, I have looked further into what I would need in the outcome system to get the Barbarian Envoy to use it. You suggested an event but I keep avoiding understanding them. So that should be my next task, not adding frogs to the animals.
Yes, an event triggered by an outcome but I have not gotten around yet to implement it (I was really low on free time the last two weeks).
 
The problem was that I watched a hunter move along their border to get more animals without dropping of the ones it already had. :(

BTW, I have looked further into what I would need in the outcome system to get the Barbarian Envoy to use it. You suggested an event but I keep avoiding understanding them. So that should be my next task, not adding frogs to the animals.

I think it's set to return to a city and drop off the ones it's protecting when it has 5
 
Yes, an event triggered by an outcome but I have not gotten around yet to implement it (I was really low on free time the last two weeks).
Event triggering from outcomes is implemented now. You can also have outcome types restricted to barbarian territory and population dependent chance.
 
Back
Top Bottom