Let's talk about what's going on with the Law Units

Ok, so seeing that there was some intent confusion at riot police and police cars seems to have been the main issue. After a very thorough review, I've changed a few things about some buildings and LE units.

Removing the force obsoletes becomes a major problem - I now clearly recall having tried that before and it was disastrous for reasons explained in previous posts. However, I can see how with the riot police upgrading to police cars, there becomes a clear problem. The obsoletion of the sherrif's office was too early as well. Not the unit, but the office. The unit, somewhat. Anyhow, adjustments have been made.

If we continue to have trouble, I will be happy to consider easing up on obsoletion rules further.

The Police Precinct requiring the Police Station rather than replacing it, and requiring so many other buildings (much as it made sense) was also a major problem. Major. It now replaces the police station.
 
Not sure if you realize it or not but your update to the LE buildings and units produces some xml errors.
Edit: Something about building class, I would include a screenshot but my computer has an issue with print screen for some reason.
 
Last edited:
In regards to specialized units/cities:
I just noticed that having unspecialized workers grants +1 xp to LE, and thus able to get a high level LE units. even so, I had to get a level 10 (82 xp) LE for the quality up promotion. The car is still only 40 base, but with the bonuses it should be able to somewhat contend with 52 robbers. (I originally expected LE to be considered combatants instead of civilians).

Joseph, this is an indication on why, in general, the idea of building in a single place is correct. I tend to focus all my cities on growth/economy beside The Big 3 which tend to go about army/LE/wonders as needed. I do build some LE units on the greater cities when needed, but that's only when they are large enough so a LE unit is as good as just another building.

In regards to xp/turn while investigating: I have a thug in my capital. One car (sleuth 3) is investigating, while the rest of the LE are fighting crime. The car seem to ge about 0.05XP/turn or something along these lines, while the rest get 0. This rate is not much better than nothing, as we are talking about 20 turns/xp at the best case, and you tend to build LE units with around the needed xp for promotions.
 
When that production center is training criminals to go into its own cities right on the heels of the LE units it's building to maintain itself, you can see how it can't keep up. The stronger that center is, the worse it is for the AI when it's being used to defeat itself.
This is a problem from making Criminals too attractive and too strong.

But this also is a sidestep from the real problem of using Specialization by constricting LE builds to 1 City. I totally disagree with this concept. It does not matter that it may be your preferred way of playing. It is a handicap to the AI period. No amount of "rationalization" can refute this obvious flaw.

@Raledon

No, this is Bad design, period. And it is forcing the AI to play in 1 way only. Players Do Not yet have this forced on them. I would never play that way either as a human player. Way too restrictive. We give Multiple Options to the player on How they can play, as many options as possible. But we've turned around and handcuffed the AI because of T-brd's design decision to force the AI to be restricted. And this decision was never shared either. Until now. This is bad. The evidence is clear to see. If you will open your eyes. No, I totally disagree over this concept in All phases of game play from this mod. Just so happens that Crime is the subject exposing this fallacy.

EDIT: I can not balance something this inherently broken. And I do believe you will not be able to code a proper solution. Not that you wont try. But I believe you can't fix, by coding, a sub optimal design flaw. No one can.
 
Last edited:
@JosEPh_II
I'm not familiar with the implementation of the AI, so I will talk as a player:
When I make a new city, I usually want it to focus on growth. Regardless of the role the city will take in the future, it will need at least some food and production buildings to be useful. In order to help it reach that state, I may use food and production merchants to directly hasten the growth, as well as LE units to delay the need for -crime buildings (I assume you use a couple of LE as guard+crime control on new cities, too).
In later stages of the city, I may decide whether I want to build LE units in the city, or build in my production centers and send them over.
In the classic era for example, when I didn't have many important buildings I wanted to construct, I let the cities construct themselves. Now after I took over another quarter of the continent, I use my big cities to build LE units for the conquered cities, instead of constructing them there.

I assume the AI attempts to weigh the 3 options: build in the city that needs the LE, build LE somewhere else and send them over, or send existing LE from other places. Saying that the second option is incorrect by design, is a flawed reasoning, as we already reached an agreement it can be good (otherwise we can just delete the food/production merchants as well, right?).
In regards to weighs (which of the 3 options is better), there may be room for improvement. I believe Tbrd exaggerated when he said "only one city". It may also be that there is a flaw with the code/weigh/logic that indeed causes only one city to do so (when the AI should use multiple), but that is not an issue with the design.

In regards to forcing the AI to play in one way, you always do so, unless you construct a learning AI. I doubt any of us wish to invest the time needed to turn the AI into a learning machine. The major alternative is constructing multiple strategies, which usually affect how likely it wants to go to war, expand and so on.
 
I'm not familiar with the implementation of the AI,
I assume the AI attempts to weigh the 3 options: build in the city that needs the LE, build LE somewhere else and send them over, or send existing LE from other places.

Negates nothing I've posted. Your assumption would be a usual "Normal" AI decision tree, But T-brd coded that out by making the AI only use 1 City for LE production when that same city has Multiple pulls for Other production as well. But since you stated you are "not familiar with implementation of the AI" the rest is irrelevant to the main problem.
 
A definite downside of the "1 LE-building city" is that this city cannot use these hammers on something else. If you have your strongest city build a lot of LE units, there are a lot of hammers this city could be using for e.g. buildings (including NW, WW, Projects). Also, with the buildup promotions (and XP coming from civics) you might not even need the additional promotions.

OTOH there is the "you are on your own until you're useful" approach where the new city just gets a little help for developing new resources (if it was founded for that reason), and then develops itself - slowly, but without bothering the rest of the empire too much. The more powerful cities either construct their own buildings (and get a few more NW / WW that way), or get to found more new cities. I don't think one approach is better than the other, but if the AI always prefers one of them that might be exploitable.
 
Negates nothing I've posted. Your assumption would be a usual "Normal" AI decision tree, But T-brd coded that out by making the AI only use 1 City for LE production when that same city has Multiple pulls for Other production as well. But since you stated you are "not familiar with implementation of the AI" the rest is irrelevant to the main problem.
I've spoken according to what Tbrd said. I'm really not sure why you insist it uses 1 city, when Tbrd said
I'm overstating it to say ONLY one city can train LE units.
. It's clear that the imagined implementation is a lot closer to what I stated than what you understood. If the implementation acts as you say (always only one city), it differs from the expected result, and would most likely should be treated as a bug.
 
At the moment, the AI only uses one city to build its LE units, with some effort to make the cities build their own if they are on a different continent.

From the horses mouth.
 
But T-brd coded that out by making the AI only use 1 City for LE production
This is wrong in several ways:
1. The AI, when evaluating which city should train a unit, use the same code regardless of the unit type in question.
2. Koshling made the code as it is today and it was nicknamed the unit brokering system. Why did you assume that TB changed anything regarding this?

3. The AI may choose to train units in any city, but will tend to do so in large cities that are close to the place that needs the unit. When deciding where to train a unit for a particular city it considers the time it will take to produce and move the unit to where it is needed as well as factoring in the experience a unit get from the producing city.
Other factors like the current build queue for a city may also weigh in, an ideal city may have bigger priorities than producing units for another city, so a less ideal city (that provide less exp or use more turns to deliver the requested unit) may take the job instead.
Again, however, cities that are not on the same landmass as the primary unit training center should be attempting to train their own and the system takes into account the distance, speed of training, and quality of the resulting units, and other current demands on that city's build queue to determine what the best city to train LE units for a particular destination will be. I'm overstating it to say ONLY one city can train LE units.
@Thunderbrd: How much weight does one additional exp point have in the current AI evaluation for unit production contracting?
Seen in light or compared to the amount of time it takes to produce and move the unit to the city that issued the contract.
I'm curious because it may be that the AI over-evaluates the importance of a small exp difference making the other factors in the evaluation almost mute, especially if the exp difference is bigger.
 
Last edited:
This is wrong, the AI may choose to build law enforcement units (LE) in multiple cities but will tend to do so in large cities that are close to the place that needs LE's. When deciding where to build a LE for a particular city it considers the time it will take to produce and move the unit to where it is needed as well as factoring in the experience a unit get from the producing city. Other factors like the current build queue for a city may also weigh in, a large city may have bigger priorities than producing LE units for a newly settled city so a smaller city in the vicinity, that provide less exp, could take the job instead.
Wrong or not I quoted what the Head C++ Modder posted. His words not mine. So take it up with him and stop picking at me.
 
How much weight does one additional exp point have in the current AI evaluation for unit production contracting?
Seen in light or compared to the amount of time it takes to produce and move the unit to the city that issued the contract.
I'm curious because it may be that the AI over-evaluates the importance of a small exp difference making the other factors in the evaluation almost mute, especially if the exp difference is bigger.
I'm not sure. It's all very complex and hard to follow. Contrary to Joe's presumption, I'm using the method that all unit needs use in the AI, not just for LE units. It was programmed by Koshling and I can follow a lot of it but there are points, like how exactly it chooses what city to train the units it's calling for, that I don't fully understand. What I DO understand about it is that it will pick the best city for the nation to provide for the need when the need has been identified. I also understand how to plug into the system.

Joe... calm down. Seriously. You really don't know what you're talking about here. I make a few general statements that are a little exaggerated and you're hanging on to them like they are legal declarations. The AI is doing what any wise player would do, managing its nation as a nation rather than the vanilla manner which manages each city as if its on its own and has no big brothers that can already do, much faster and more effectively, some of the things it would need to do for itself. If you understood the difference this makes you'd also understand that there's simply no comparison in terms of benefit between the original system and this brokerage method.
 
I'm not sure. It's all very complex and hard to follow. Contrary to Joe's presumption, I'm using the method that all unit needs use in the AI, not just for LE units. It was programmed by Koshling and I can follow a lot of it but there are points, like how exactly it chooses what city to train the units it's calling for, that I don't fully understand. What I DO understand about it is that it will pick the best city for the nation to provide for the need when the need has been identified. I also understand how to plug into the system.
Ok, I would like to discuss its finer details if you one day examine that code closer. ^^
 
Joe... calm down. Seriously. You really don't know what you're talking about here. I make a few general statements that are a little exaggerated and you're hanging on to them like they are legal declarations.
I quoted what you said. I don't read minds. Perhaps it is your propensity for being verbose that is the reason for the quote. The End.
 
Ok, I would like to discuss its finer details if you one day examine that code closer. ^^
That would probably be good someday yes but the more I work with it the more I understand it. The thing is, it really is hard to follow. It tosses certain bits of data into a status and that status is picked up in other places at later stages in processing so it's very hard to follow step by step. It also uses flagging systems which employ bit masking and I'm really useless at grasping how that works exactly. There are certain spots where I know there are some less than ideal behaviors in the system and when I get more into the military AI I'll have to understand some of those factors more. I've been able to implement some recent adaptations that have advanced the system so that it doesn't try to employ criminals for civilian tasks at least.
 
I quoted what you said. I don't read minds. Perhaps it is your propensity for being verbose that is the reason for the quote. The End.
You didn't read the clarification posts I made later apparently.

Also, I believe the brokerage system does take distance and production time and other items in the queue into account so it's probably a little overstretching to say that the units are all made out of the same city. It's a complex evaluation process and Koshling actually built a lot of that out in a generic system I'm tapping into.

What I meant was simply that generally speaking, the AI will strongly favor a particular city for its units. Sometimes cities WILL try to train their own but when they do it's usually out of desperation because the primary training city can't keep up. This will often happen when we seed a complete collapse scenario because the primary training city has been reduced to a city of rubble like everything else.
 
Last edited:
You didn't read the clarification posts I made later apparently.
Probably so, since I don't like being inferred to as a liar. And I'm awfully tired of this whole thing. I'm done for the day.
 
Probably so, since I don't like being inferred to as a liar. And I'm awfully tired of this whole thing. I'm done for the day.
Who called you a liar? I simply said you were taking me too literally.
 
Top Bottom