Team Projects Committed

What we eventually want to end up with is the whole capture mechanism outside Python and inside the XML using outcomes. Similar to the way we do the animals, but I don't want a bunch of outcomes on every unit. It would be better if it could be done at a higher level.
Well, you can have both kill outcomes and outcome missions on unit combat types.
 
Well, you can have both kill outcomes and outcome missions on unit combat types.

However the probability comes fro those tags or more exactly
chance = captureProbabilityTotal() - captureResistanceTotal()​
it would be nice if this appeared in the XML as some reference or other rather than having to call Python to calculate it. I would be able to get rid of a whole module:mischief:
 
What is the default values if no value is provided?
That's something I did not define (zero on each of my tags though, so I guess the answer is zero.)

The tags ARE XML tags as explained.

The only part that bugs me still is wondering how it can be used to help with the citizen slaves capturing. Let me know what you want there so that you can build the 'capture resistance total' for the city generically rather than, as it is now, only something that can be derived for the unit.
 
@DH: I'm currently adding:
Code:
int localCitizenCaptureResistance() const;
to CyCity so that you can get a Capture Resistance modifier to citizens for the python code. I'm not sure what you want to establish as the BASE chance of capture for each population point so I'm leaving that in your hands.

This should be available and exposed to python on my next update.
 
@DH: I'm currently adding:
Code:
int localCitizenCaptureResistance() const;
to CyCity so that you can get a Capture Resistance modifier to citizens for the python code. I'm not sure what you want to establish as the BASE chance of capture for each population point so I'm leaving that in your hands.

This should be available and exposed to python on my next update.

Currently we only look at the citizens when a city is abandoned. This will be useful when we get to add in the refugees as a razed city will produce captured citizens and/or refugees on a two pop produces 1 unit with a size 1 city having a 50% chance of producing a unit. If I had a refugee unit (and Refugee Camp improvement graphics) I could implement this now. I would need to do some AI work on the refugee, which would mostly act like an immigrant, but may put a "Refugee Camp" improvement on the map or join an Indigenous People community.
 
Razed cities are already producing captured citizens. This is how I get them in my games right now. I figured this exposed line might be able to then interact with the unit's capture ability that took the city (against a base % chance per population in the razed city) and perhaps a chance that the 1 pop drop that normally occurs when capturing a city may instead be non-lethally converted into a captured citizen rather than a true full loss.

Also, footnote: I don't think the 1 captive per 2 population is quite working - seems to only ever produce just the one citizen but I could be wrong since I mostly only ever capture smaller barb cities and that could be twisting my perception a bit. The display message that's given when this happens is bugged where it states how many citizens have been captured so that doesn't help.

Otherwise, if you're wanting that to be a more simple process for now that's fine and you can use this new exposed function at your leisure for further mechanisms to come.
 
I have tried to use the capture tags (NationalCaptureProbabilityModifier etc). They are not on the current building schema nor the gameinfo schema! Silly me I forgot the i at the beginning of the tag name.:blush:
 
  • Team Project 3: Capture Mechanics tags
    I suggested to do these for DH so he could weave the tag applications into the python that controls the mechanism. I did not convert the capturing code into the dll so these tags, reported by the dll to python from CyUnit:

    int captureProbabilityTotal(); which gets the total probability of the unit's capture ability as compiled from all sources onto the specific unit.

    and

    int captureResistanceTotal(); which gets the total resistance capability of the unit.

    Once plugged into the python, this will put XML in full control of determining the odds of capture.

I tried using these in the Python but I get a message saying that the instance of the unit does not have such a method. Did you expose to python the method on the class Unit or the instance of the unit that is involved?
 
int CyUnit::captureProbabilityTotal()
{
return m_pUnit ? m_pUnit->captureProbabilityTotal() : -1;
}

int CyUnit::captureResistanceTotal()
{
return m_pUnit ? m_pUnit->captureResistanceTotal() : -1;
}
@AIAndy: Do we need to report in more ways than just this?
 
Ah... thanks. I go off the templates of examples I can find and it seems those predating me have done a lot of setting up in CyUnit but then not taking that step in CyUnitInterface. ugh...

Alright, I'll have this done by the end of the day (gotta run to work right now).
 
Back
Top Bottom