Slaves, Hostages and Prisoners of War

@Dancing Hoskuld

Could you have something where you could get money from them by ransoming them back to their homeland. Or at least pretend to random them off? Meaning you get gold but the nation they are from do not get their unit back.

Ransoming back is one of the things I am going to add. I have not seen much evidence for it before the middle ages. I would probably put it on or about the Heraldry tech. It would also give you a small diplomatic boost with the nation. Not barbarians though.
 
So I was thinking about the Slavery Civic idea and I came up with these
Slavery
-None: no effect
-Foreign Slaves: Ability to capture, buy, sell, and keep slaves. Settled Slaves give -1 :food: +2 :Hammers:, +1 :gold:
-Indentured Servitude: Unlimited Slave Specialists, +1:mad:, -5% Crime, per a slave specialist (to emulate criminals becoming enslaved under this form), Captured Slaves remain, but can only be purchased and sold, and give the same effects as foreign slavery.
-Manumission: Gradual conversion of captured slaves to citizens, minor instability
-Emancipation: All Captured Slaves immediately become citizens, Massive Instability gain in every city per slave freed in that city, +1 :) in all cities, +2 :mad: In foreign cities with slaves. Chance for nearby slaves to attempt to migrate and attempt to become citizens. (Probably an event with the option to accept them, support them, or send them back with appropriate gains and costs)
-Robotic Slavery: Allows the construction of robotic workers which can be settled like captured slaves, gives +5 :hammers: per a slave, removes :food: penalties, -2 :gold: per a slave, and no slave specialists, Slaves add to instability with the ability to become a full robot uprising if left unchecked.
-Clone Slavery: allows the construction of cloned slaves, settled slaves give +3 :hammers: +1 :gold: -2 :food:, +.10 :mad: Per slave
 
Before V29 is released I think I need to look into how the AI is handling captives, and see if it needs work urgently, since they are a fairly significant factor now. Does anyone happen to have a save game where a lot of captives have been generated and it' likely the AI has a bunch, which I can look at...?
 
Before V29 is released I think I need to look into how the AI is handling captives, and see if it needs work urgently, since they are a fairly significant factor now. Does anyone happen to have a save game where a lot of captives have been generated and it' likely the AI has a bunch, which I can look at...?

Here you go, this is from like 1st or 2nd of march though keep in mind, revision was probably from that day.
 

Attachments

  • Yagan BC-7725.rar
    791.6 KB · Views: 58
@DH - Ok, having looked at Sgtslick's save, the current AI for them is just about as inappropriate as it possibly can be. Both types currently have a default AI of UNITAI_WORKER. That means that they will try to do what workers do - since neither can perform any plot improvements or create routes they will always fail to find anything. At that point they will attempt to retreat to the nearest city. When they get there they still won't find anything to do (workers cannot build buildings so it doesn't check that, and similarly for outcome missions). At that point they will be scrapped.

For now I recommend you change them all to UNITAI_SUBDUED_ANIMAL, since that does approximately the right thing (not quite, because it doesn't really cope well with defense 0 units, but apart from that aspect). It will at least check for outcome missions, check for builds, and choose whichever looks best, including searching for the best city to perform them in.

Having said that, the AI still needs some work (I think the subdued animal AI is fine to use [might not be the best name, but if you think about the role of subdued animals, it's actually pretty similar to the role of captives]) as follows:
  1. Enhance to cope with defenseless units (get escorts as necessary and so on)
  2. Outcome evaluation only works for outcome types we used to have, and in particular outcomes that are mediated through events are not noticed by the current outcome value routine in CvOutcome [so the increase population one will have 0 value and never be executed)

Also, I noticed when looking at the XML that UNIT_CAPTIVE_CIVILIAN has a population increase outcome (settling in the city) which is mediated through EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE. However EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE is no defined! So this outcome will never do anything (for the AI or anyone else)
 
@DH - Ok, having looked at Sgtslick's save, the current AI for them is just about as inappropriate as it possibly can be. Both types currently have a default AI of UNITAI_WORKER. That means that they will try to do what workers do - since neither can perform any plot improvements or create routes they will always fail to find anything. At that point they will attempt to retreat to the nearest city. When they get there they still won't find anything to do (workers cannot build buildings so it doesn't check that, and similarly for outcome missions). At that point they will be scrapped.

For now I recommend you change them all to UNITAI_SUBDUED_ANIMAL, since that does approximately the right thing (not quite, because it doesn't really cope well with defense 0 units, but apart from that aspect). It will at least check for outcome missions, check for builds, and choose whichever looks best, including searching for the best city to perform them in.

Having said that, the AI still needs some work (I think the subdued animal AI is fine to use [might not be the best name, but if you think about the role of subdued animals, it's actually pretty similar to the role of captives]) as follows:
  1. Enhance to cope with defenseless units (get escorts as necessary and so on)
  2. Outcome evaluation only works for outcome types we used to have, and in particular outcomes that are mediated through events are not noticed by the current outcome value routine in CvOutcome [so the increase population one will have 0 value and never be executed)

Also, I noticed when looking at the XML that UNIT_CAPTIVE_CIVILIAN has a population increase outcome (settling in the city) which is mediated through EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE. However EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE is no defined! So this outcome will never do anything (for the AI or anyone else)

You must be using an older version or something

1) They can do work. Or at least the Captive- Military/Neanderthal can, it gets used up. I am thinking of restricting them from building routes. This is not the best use of them.

2) the event trigger should be EVENTTRIGGER_ADD_ONE_POPULATION not EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE which maybe a typo but neither are working and adding the population even though the text messages is saying they do :(

Dang, I am going to be late for the Dr.
 
You must be using an older version or something

1) They can do work. Or at least the Captive- Military/Neanderthal can, it gets used up. I am thinking of restricting them from building routes. This is not the best use of them.

2) the event trigger should be EVENTTRIGGER_ADD_ONE_POPULATION not EVENTTRIGGER_ADD_ONE_POPULATION_CAPTIVE which maybe a typo but neither are working and adding the population even though the text messages is saying they do :(

Dang, I am going to be late for the Dr.

Ok, for those that can do work I guess I can modify the worker AI to also look for construct and outcome opportunities, but any that cannot (the civilians?) would be much better on UNITAI_SUBDUED_ANIMAL (at least it would prevent them wasting lots of time going through all the worker routines looking for work that cannot possibly be there).

Also, the unit upgrades are a bit problematic - the AI has no concept of upgrading a unit in such a way that it's AI type changes across the upgrade (so 'workers' that can upgrade into non-worker units are not handled). Again I can add a routine specifically for this if need be (I'm guessing it will be).

Subject to correcting the spelling I can't see why the outcome would not work, but if it doesn't that's something you'll need to engage AIAndy on.

I'll work on the assumption that captive military can always perform worker builds (except routing maybe) and will remain on UNITAI_WORKER, and that captive civilians will change to UNITAI_SUBDUED_ANIMAL. Let me know if that seems wrong to you...
 
Ok, for those that can do work I guess I can modify the worker AI to also look for construct and outcome opportunities, but any that cannot (the civilians?) would be much better on UNITAI_SUBDUED_ANIMAL (at least it would prevent them wasting lots of time going through all the worker routines looking for work that cannot possibly be there).

Also, the unit upgrades are a bit problematic - the AI has no concept of upgrading a unit in such a way that it's AI type changes across the upgrade (so 'workers' that can upgrade into non-worker units are not handled). Again I can add a routine specifically for this if need be (I'm guessing it will be).

Subject to correcting the spelling I can't see why the outcome would not work, but if it doesn't that's something you'll need to engage AIAndy on.

I'll work on the assumption that captive military can always perform worker builds (except routing maybe) and will remain on UNITAI_WORKER, and that captive civilians will change to UNITAI_SUBDUED_ANIMAL. Let me know if that seems wrong to you...

Can't units have multiple Unit AI? Maybe having multiple unit AIs would solve some of the problems. How does the AI currently handle subdued animals that can upgrade to units with a different AI?

The Immigrant AI, written in python, uses the same join city as population outcome. It has default Unit AI as worker with secondary AI as settle. It may be possible to convert that AI to special "Immigrant" class and use that. It will be needed for some of the other units I want to make.

If that is the case I could make
Captive- Military/Neanderthal have primary AI of subdued animal with secondary AI's of Melee, Archer and Worker.

Captive - Citizen have primary AI of subdued animal and a secondary AI of "Immigrant".​
 
Can't units have multiple Unit AI? Maybe having multiple unit AIs would solve some of the problems. How does the AI currently handle subdued animals that can upgrade to units with a different AI?

The Immigrant AI, written in python, uses the same join city as population outcome. It has default Unit AI as worker with secondary AI as settle. It may be possible to convert that AI to special "Immigrant" class and use that. It will be needed for some of the other units I want to make.

If that is the case I could make
Captive- Military/Neanderthal have primary AI of subdued animal with secondary AI's of Melee, Archer and Worker.

Captive - Citizen have primary AI of subdued animal and a secondary AI of "Immigrant".​

No, units cannot have multiple unit AIs. They can support multiple unit AIs, which means that individual units can be instantiated with any of the ones it supports. However, once instantiated it just uses the one it gets. It is also possible to switch a unit between supported units AIs, but at no time can it be executin g more than one, and upgrade currently never makes any change th ethe unit ai the unit has before it upgrades (though if necessary that could be changed so that if it upgrades to a unit that does not support the original ai type it gets the default ai type of the unit upgraded to - such a system would probably work here I think(?))
 
So you are saying that subdue animals has not been working fully, since some units can upgrade to military units?

With some of the ideas Johny Smith has been throwing around and my preference to get rid of the Great Farmer I would want some subdued animals to place resources on the map - more AI.
 
So you are saying that subdue animals has not been working fully, since some units can upgrade to military units?

With some of the ideas Johny Smith has been throwing around and my preference to get rid of the Great Farmer I would want some subdued animals to place resources on the map - more AI.

If they are peaceable on the map I would say remove the herds they can build, and I think placing resources on the map would be more balanced then building herds in cities.
 
Hydro,

can you pls make a btn for the Animal Assisted worker, its the one with the mule, currently there are two of them, anyways, thx.

No because I plan to either replace or have that removed with a Dog worker as well as the other animal workers that have faster work on different terrain types. For more info PM Thunderbrd.
 
So you are saying that subdue animals has not been working fully, since some units can upgrade to military units?

With some of the ideas Johny Smith has been throwing around and my preference to get rid of the Great Farmer I would want some subdued animals to place resources on the map - more AI.

I would expect not. I hadn't realized the situation already exists (subdued wolves of course!), but I doubt it works for the AI (though the other options will including the building creation).

Assuming you think my suggestion would be ok (force AI change on upgrade if target unit doesn't support the starting AI type [currently that will prevent upgrade I think]) I'll go ahead and do I (and test it on a subdued wolf as proof of concept).

Are you ok with changing the captive civilian to the subdued_animal AI? (I'll adjust the worker AI to check for outcomes and building/hurries anyway for the captive military, but it's just that the overhead of checking all the worker options for a unit that can never perform them that I want to get rid of for the civilians)

Edit - I have looked into the (existing) subdued animal case (tested with a subdued dire wolf), and the AI cannot perform these upgrades. Fixing it will actually be a substantial change, but I'll get to work on it today. As well as needing some DLL enhancement (which I'll do) the XML is also flawed currently and needs changing (I assume DH will want to do this since it's all in his mod, although we could default that too in the DLL if preferred [see below]). Specifically all the subdued animals apart from one (the subdued wolf, which is fine) are entirely missing their <UnitAIs> sections. They specify a default AI of UNITAI_SUBDUED_ANIMAL, but do not list the AIs they support (which should [for ANY unit]) always at least include its default AI. The subdued wolf (only so far as I can see) has:
Code:
			<UnitAIs>
				<UnitAI>
					<UnitAIType>UNITAI_SUBDUED_ANIMAL</UnitAIType>
					<bUnitAI>1</bUnitAI>
				</UnitAI>
			</UnitAIs>
which is what all the rest need too.

@DH - I could modify the DLL to always add the specified default AI into the supported AI list for any unit. That would save you having to change any XML and somewhat future-proof us - would you like me to do that?
 
Two sugestions

1 Capitives should be more rare. In meele faight no-one have time to take prisoners.
2 captives shouldn't be upgradable to units. If my prisoner will get weapon he will fight against me not with me.
(captives should be use to speedup units build to simulate prisoners drafting like in Rome.)

Now with 2 war is simplest ever. From city conquer you get free defender's. Very stupid...
 
Two sugestions

1 Capitives should be more rare. In meele faight no-one have time to take prisoners.
2 captives shouldn't be upgradable to units. If my prisoner will get weapon he will fight against me not with me.
(captives should be use to speedup units build to simulate prisoners drafting like in Rome.)

Now with 2 war is simplest ever. From city conquer you get free defender's. Very stupid...

1) I wonder how Rome got all those ex soldiers for the arenas if they did not take them in battle? If your enemy is running mercenaries civic then the units are mercenaries and more likely to surrender rather than get killed.

2) Why not if they were mercenaries. They will fight for those that pay and feed them. Even barbarians may.

3) Captives do speed up building. In fact someone complained that they do it too much with the Military captive being able to finish many of the normal buildings in one turn.
 
@DH

If above arguments didn't konwince you at all please play few turns at war with capitives and fell how much it spoils gameplay.
 
I do have to adjust the probabilities. Oops.. I just saw that the chance of capture when in a city was +30% which is way to high.
 
Top Bottom