How does "Crime Rate" work.

Ogaburan

Warlord
Joined
Sep 11, 2008
Messages
211
Location
Laanisport
Greetings,
Awesome mod.
12 out of 10 stars.
Excellent work.

I recently came back to Civ4, last time I played was ROM, so some of the new concepts are... well... new to me.

First some feedback.
Im playing on Deity, Standard Map with Snail.
Im just about to discover sedentary life, and the -8 gold "bonus" from the muggings building is crippling me.
Even with taxes on 0% and maximizing gold in my (only) city I cant cover the defesit.
I have disbanded my workers and gathered, and even some of my units, but I still cant manage it because the building im building to fight crime lower my income even more.

Note that my starting position isn't the greatest money wise.
I used perfectworld2f and i like how the map looks like, dont get me wrong. Just bad luck and I enjoy a challenge.
The best I can do is 19 commerce, a merchant and 2 priests.
With all my tiles developed including Pigs, Horses, Grapes, Apples and Barley.
Such is my Empire! (Which is Nebu's Bablylon btw)
Extraordinarily poor.

Still I think I should be able to deal with "muggings".

Thematically speaking,
Im not even sure who or what they are mugging, im pretty sure my people need to have some kind of that "wealth" they keep on hearing about, to accommodate those "muggings".

Now to my questions.
How exactly is the crime rate calculated?
The in game information (cevopedia) does an extremely poor job at explaining how it works other then give some broad and vague notions at how it works.

The city screen is even less intuitive and makes no sense at all...
I have:
Constant Building Resource: -40/pt
General Property Resource:+68/pt
While my crime grows by 2.

What does the "General Property" even mean?
Why is my crime rate growing by just 2?
Why is my crime rate growing?
Is it because I am now working tiles who had crime "spill" into them?
(my pig farm has a value of 101 for example)
How exactly does the crime rate degrade into other tiles?

((I am also unaware of any wiki or centralized information place for me to search.
If such exists please, please point me in the right direction.))
 
Crime has a rubber-band-like pressure that applies a small tendency towards 0, but this only becomes significant if you are not near 0 and it is never large until it is too late. This is one of the many reasons the numbers don't usually add up. There is a contribution to crime for each population point. Another factor is that some can come in via trade routes, if you have any. And yet another is that it transfers to and from nearby plots. There are also units that can add crime, as well as those that can reduce it. It's like you have a leaky bucket which leaks more the more full it gets and the crime sources are adding the water to the bucket and the crime reducers are removing water from the bucket (except that it can go negative).

If you have built the buildings that produce crime, like the bandit's hideout, you can destroy them to remove their contribution if necessary. Control-A when you are in the city screen to bring up the dialog for that.

The cost of crime reducing buildings is generally smaller than the crimes they eliminate, once they do. But it can take a while to get your crime level low enough for the crime buildings to be removed. Don't forget to built those little buildings that do little but give 1 gold per turn.

If the other players are sending over their criminal units (thief, rogue, and such) and you don't have a canine unit or something similar then those units are invisible to you and there is nothing you can do about them. They can add a lot of crime to your city.

If you have built any criminal units yourself and are keeping them in your own territory then you are causing crime to yourself since they do not cause crime only for enemies, they add crime to wherever they are including your own cities and plots. Using them to spot enemy criminals is therefore a bad idea - your rogue sitting in your city to spot their rogue is probably no better than just letting their rogue into your city since they probably both cause the same amount of crime. Get your criminal units, if you have any, out of your territory.

The diffusion of crime between plots, and between cites and plots, is actually a bit complex. It is done as basically a percentage of the difference, but using integer math so it tends to be in "chunks".

By the way: by Sedentary Lifestyle you should have more than 1 city. You can make the Tribe unit at Tribalism and it acts like a settler.
 
This is one of the many reasons the numbers don't usually add up.
Well that baffles me tbh.
It is very harsh to have a convoluted game mechanic with such severe consequences.

If you have built the buildings that produce crime, like the bandit's hideout, you can destroy them to remove their contribution if necessary. Control-A when you are in the city screen to bring up the dialog for that.
Thanks for this advice!
I forgot/was not aware of the Ctrl-A option!

I have deleted both my crime providing buildings. The Bandit Hideout & the The fighting Pit.
The next turn I lost 13 crime.
Then next 4.
Yet from then on it seemed to stabilize (??) a turn losing 3 and the next gaining 3. Between 287 and 283.
It does seem to have a "hard value", and I would like to know what factors in to that value. To know to avoid it in my next games...

These numbers seem too arbitrary to me...
Its a god/managment game... I'd like at least the illusion of being in control of these values.

If the other players are sending over their criminal units (thief, rogue, and such) and you don't have a canine unit or something similar then those units are invisible to you and there is nothing you can do about them. They can add a lot of crime to your city.
I have dogs guarding my capital and my precious little resources, backed up by neanderthal enforcers... None of the criminals managed to live for long, and it seems the AI has stopped sending them. So im pretty confident im not inflenced by them anymore.

Even if i wanted to use criminals I wont be able to afford them, with the +1 gold per turn cost. The healer for example was the first unit to go when "the troubles" started...

The diffusion of crime between plots, and between cites and plots, is actually a bit complex. It is done as basically a percentage of the difference, but using integer math so it tends to be in "chunks".

Well... "chenks" are hardly the exact values i'd like to work with... :(
Dont get me wrong, I like the feature. I just think its mechanics need to be more transparent.

By the way: by Sedentary Lifestyle you should have more than 1 city. You can make the Tribe unit at Tribalism and it acts like a settler.
lol, im not that far gone. Im quite capable of understanding how to expand...
As I mentioned before im playing on a fairly small map, the standard one, and on diety with 8 starting nations and barbarian civs turned on. From the statistics I gather there are at least 13 civilizations now in play. Quite a crowded world, and i like it that way.
My starting position was not kind to me as well...
To the north I have the sea.
To the east the Portuguese.
To the west the Celts.
(both capitals are ~10 tiles from my capital)
To the south a salt desert, and past that the Inuits.
Im actually not doing so bad, both the Portugese and the Celts only have 2 cities.
And their 2nd cites are in awkward places I would not have built a city.

So i first need to raze those 2nd cities before I can actually expand, and for that I need to discover writing and hopefully stop fighting on 3 fronts. I am situated between 2 close neighbors who consider me their worst enemy...

I really do enjoy these small intimate games when im starting to learn a new mod.
Those are actually the few games I even tend to finnish, and i recommend you to give it a try!

Thanks for the quick response btw!
 
Crime is a dynamic equilibrium. It has:

  • Positive sources (population, crime-giving buildings, crime-giving units). Note that some of these are modified by difficulty level 0- in particular I think crime/population is, so at deity you have the most difficult possible set of sources
  • Negative sources (negative crime buildings, negative crime units)
  • Flows (acts locally as a source which is a percentage of the current level in the flow's source) - principally surrounding tiles, but also connected cities
  • Decay - always loses a fixed percentage of its value per turn (i.e. - decays towards zero - for crime the decay rate is 4%)

In most cases the direct sources and decay are the dominant factors, so the effect is that in on turn N you have C(N) crime then at turn N+1 that will change to:

C(N+1) = C(N)*decay + SUM(positive sources) - SUM(negative sources)

If the positive and negative sources are constant then the effect is to move towards an equilibrium level where the decay balances the inputs. Solving that equation leads to:

C(equilibrium) = (SUM(positive sources) - SUM(negative sources))/decay

With a decay rate of 4 % this means crime will reach equilibrium at about 25*<net source>

At deity you get 5 crime/pop/turn (it goes down by 0.5 per difficulty level), so in the absence of ANY buildings or units crime will stabilize at 125*<population>. One -5 crime building effectively counteracts 1 population.

Edit - in regard to your game, here are a few things to try:

1) Switch to chiefdom and build a chief's hut if you haven't already

2) Build the best punishment building if you find you need it (and on deity you likely will!) - probably crucifixion crosses at your point??

3) Switch between producing buildings/units and wealth if you have to. Especially if you have multiple cities try to rotate some wealth production between them at this period.

4) Beeline to masonry, at which point you'll be able to build Town Watchmen, who have negative crime modifiers
 
Thanks for the more technical breakdown... not sure understood it fully... but you gave me a much better understanding.

As for my game... i did have already all the buildings possible in order to fight crime, thats why i was surprised it got so much out of controll.

I ended up fighting fire with fire.
Capturing slaves and put them as the +10 labor setteled slave and periodically produce lesser wealth
To cover my costs...
Never did that befor and its surprisingly effective.
I will dart for masonry to check out the police units asap tho...

Thanks for the reply!
 
IMO, this is what needs to be improved:
Constant Building Resource: -40/pt
General Property Resource:+68/pt
While my crime grows by 2.

It needs to break down just like this:
Positive sources (population, crime-giving buildings, crime-giving units). Note that some of these are modified by difficulty level 0- in particular I think crime/population is, so at deity you have the most difficult possible set of sources
Negative sources (negative crime buildings, negative crime units)
Flows (acts locally as a source which is a percentage of the current level in the flow's source) - principally surrounding tiles, but also connected cities
Decay - always loses a fixed percentage of its value per turn (i.e. - decays towards zero - for crime the decay rate is 4%)
As a projection that clearly shows what we'll end up with the next round.
And then give a total projected gain or loss.

Now... if the 'flows' factors are impossible for the game to express like this because they become compiled later, then perhaps this would be better expressed as a 'what happened last round' panel.

He's right that this really needs to be made more transparent.

C(N+1) = C(N)*decay + SUM(positive sources) - SUM(negative sources)

If the positive and negative sources are constant then the effect is to move towards an equilibrium level where the decay balances the inputs. Solving that equation leads to:

C(equilibrium) = (SUM(positive sources) - SUM(negative sources))/decay

With a decay rate of 4 % this means crime will reach equilibrium at about 25*<net source>

At deity you get 5 crime/pop/turn (it goes down by 0.5 per difficulty level), so in the absence of ANY buildings or units crime will stabilize at 125*<population>. One -5 crime building effectively counteracts 1 population.
I needed to work this out and perhaps the following can break things down for those with a little less math presence such as myself...

"If the positive and negative sources are constant then the effect is to move towards an equilibrium level where the decay balances the inputs. Solving that equation leads to:

C(equilibrium) = (SUM(positive sources) - SUM(negative sources))/decay"
Ok, so lets fill out the equation... if you have the SUM of positive sources being nothing more than the population of 1 on Deity level being 5 crime, so the sum being 5. And no negative sources. And a 4% decay (would that plug in as .04 or as 4? We'll assume 4 for the moment.)

Then we come up with C(equilibrium) = 5/4ths. Lets add some digits here to represent that better and actually divide that out: 500/400. Now we get 1.25. So perhaps we need to multiply 100 by the first number to get 50000/400 (so that should suggest we're talking about 5 and .04 with the decimal adjusted by 2 places to the left(500/4).) So we multiply the positive and negative sources by 100 and leave the integerized '%' alone. Thus the equation would be:
C(equilibrium) = ((SUM(positive sources)*100) - (SUM(negative sources)*100))/decay

That would mean 5 * 100 = 500, 500 - 0*100(0) = 500, 500/4 = 125.


Cool... so if crime is at 5 right now in my city and there's a +5 source (my population) and no negative sources (and we have no 'flow' variables modifying the positive and negative source values), the equation to figure out how much crime I'll get would then follow:

C(N+1) = C(N)*decay + SUM(positive sources) - SUM(negative sources)

Which in this case would be:
Next Round's crime = 5*.04 (which would be: (5 * 4)/100) + 5 - 0.
This would calculate out to:

0 (.2 rounds down to 0) + 5 - 0= 5.

or perhaps I'm reading it wrong and its simply 5*4:
Next Round's crime = 5*4 + 5 - 0.
20 + 5 - 0 = 25.

Then the next round it'd be
20*4 + 5
80 + 5 = 85.

That doesn't seem right... maybe back to the first example:
Next Round's crime = 5*.04 (which would be: (5 * 4)/100) + 5 - 0.
This would calculate out to:

0 (.2 rounds down to 0) + 5 - 0= 5.
This time we'll assume we have gone from 0 to 5 this round.
0*.04 + 5 - 0 = 5.

Now we'll plug in some stronger numbers. We have 100 crime, 23 Positive and 12 negative:
100 * .04 + 23 - 12
4 + 11 = 44 - we just took a nose dive. That doesn't seem quite right either...

yeah I think I'm lost...
 
There had to be a mistake in the formula. I believe that it should've instead been this, since this one accounts for the decay as a loss of decay% instead of (100-decay)%.

C(N+1) = C(N) - C(N)*decay + SUM(positive sources) - SUM(negative sources)

For example with your values of 100, 23, and 12

100 - 100*.04 + 23 - 12
100 - 4 + 11 = 107
Which is clearly a perfectly reasonable value.

or with your values of 5, 5, 0
5 - 5*.04 + 5 - 0
5 - .2 + 5 = 9.8 (10)
Seems right again as the decay should be minimal at 5 crime so it gains the full +5.

Or with the values of ??,68,40 and going up by 2 from the first post
2+C(N)=C(N)*0.96 + 68 - 40
C(N)*0.04=26
C(N)~=650 crime
but that seem's a bit high as you suggested you had about 300 later.

In plain english without any kind of extra explanation that would be.
Every turn it goes down by 4% and then adds your crime plus and minus.
 
There had to be a mistake in the formula. I believe that it should've instead been this, since this one accounts for the decay as a loss of decay% instead of (100-decay)%.

C(N+1) = C(N) - C(N)*decay + SUM(positive sources) - SUM(negative sources)

For example with your values of 100, 23, and 12

100 - 100*.04 + 23 - 12
100 - 4 + 11 = 107
Which is clearly a perfectly reasonable value.

or with your values of 5, 5, 0
5 - 5*.04 + 5 - 0
5 - .2 + 5 = 9.8 (10)
Seems right again as the decay should be minimal at 5 crime so it gains the full +5.

Or with the values of ??,68,40 and going up by 2 from the first post
2+C(N)=C(N)*0.96 + 68 - 40
C(N)*0.04=26
C(N)~=650 crime
but that seem's a bit high as you suggested you had about 300 later.

In plain english without any kind of extra explanation that would be.
Every turn it goes down by 4% and then adds your crime plus and minus.

I was using 'decay' as shorthand for (1 - <decay percentage>/100), so 4% decay is:

C(N+1) = C(N) * (0.96)

taking account only the decay term. I didn't mean to imply that a 4% rate of decay meant you lobbed the number '4' in directly the replace 'decay' ;)

So with 5 crime from your 1 population starting at 0:

C(0) = 0
C(1) = 0*.96 + 5 = 5
C(2) = 5*0.96 + 5 = 9 (I think it rounds down)
C(3) = 10*0.96 + 5 = 14
C(4) = 14*0.96 + 5 = 19
C(5) = 19*0.96 + 5 = 23
...
C(N) = 125 (for some large N when we reach equilibrium)
C(N+1) = 125*0.96 + 5 = 125 (that's why it's equilibrium!)
...

Edit - in practice the equilibrium is a little higher due to the contributions from neighboring plots, which also come into equilibrium with the crime radiating outward from the city. This is a bit like calculating virtual particle interactions in Feynman diagrams! (which analogy you can safely ignore if you don't know what the hell I'm talking about). The net effect is to actually move equilibrium a bit further from 0 than you would naively calculate.
 
The player should be told that if you ignore crime, it could be fatal. They should be told that other people's 'camo' (invisible) units can enter your cities any time you're not at war with them, and camp there and there's nothing you can do about it.

They are already told which buildings and units raise and lower crime.

That's all they should be told. Understanding the calculations involved in it completely wrecks it. We don't play as gods, we are non-omniscient empire managers. Just like in 'real-life', we live in hope that if we build enough law enforcement buildings and units, we will bring crime under control. This turns out to be true. In other words, the system works ie. ain't broke and doesn't need any fixing.

Indeed it deserves a huge amount of praise and appreciation for working so well. On the list of 'things that need tweaking', it belongs pretty much right at the bottom.

(With all due respect for those who don't share these opinions...:p)
 
The idea isn't so much to tweak how it works as to tweak what it tells you.

In particular, I think it would be nice to display at least two more things:
1) the crime per population at the current difficulty level (not necessarily on the crime help pop-up, it could be somewhere else like the pop-up for hovering over top center area with the city name and population which currently shows things like the founding year for the city, but the crime pop-up would be a more obvious place to find it)
and
2) the actual expected decay amount at the current crime level (so you would actually see "Decay: -4", or something like that, when you are in the 100 to 124 range)

The first would explain where a lot of the crime is coming from that currently has no explanation. It might be mentioned somewhere in the 'pedia that there is some crime per population point, but does it say the exact value for each difficulty level? I don't remember seeing that in there, but have not looked in quite a while. The second would cover some of why it does not currently appear to add up to the actual change per turn that you get on most turns.

It would still not cover things that change the situation like new crime units moving into the city or its vicinity, or a trade route that switches to connecting you to a city with a higher or lower crime level the next time a turn is processed. But it would better cover the constants. Except it would also still not cover the diffusion to and from nearby plots or via trade routes and such, which is made even more peculiar due to the integer math used (so it does something like: the numbers round down to 0 for the amount to be transfered until suddenly it hits most or all of the adjacent plots rounding to a non-zero value at the same time and so transfers some to all of them on the same turn in a rather "chunky" multiple point shift instead of the more gradual diffusion which might be expected).

If a third thing to display were to be added, I'd suggest showing the total of all the diffusion to and from the city on the last turn processed. That would help make the numbers add up for what happened the last turn and although it would not enable you to predict exactly what the next turn will give, it would help.

Another thing that could be shown is the effect of traits. Some traits have thresholds which if passed can significantly alter the crime rate. It might be good to show what the threshold is and what the effects are when past the threshold, especially if you are currently past it. And then there is the effects of civics, some of which can alter the situation too. But traits and civics do mention the effects themselves so that information is available already, unlike for some of the other sources/sinks, so adding text for their effects is less important.
 
C(N+1) = C(N) - C(N)*decay + SUM(positive sources) - SUM(negative sources)
Since the system was designed to be able to deal with more complex sources it actually tries to do this:
C(N+1) = C(N) - C(N+0.5)*decay + SUM(positive sources) - SUM(negative sources)
where C(N+0.5) = (CPredict(N+1) + C(N)) / 2
and CPredict(N+1) is calculated like the formula in the quote.
 
That's all they should be told. Understanding the calculations involved in it completely wrecks it. We don't play as gods, we are non-omniscient empire managers. Just like in 'real-life', we live in hope that if we build enough law enforcement buildings and units, we will bring crime under control. This turns out to be true.

I couldn't disagree with you more.

A. In my opinion it does not "completely wrecks it".
Imagine city growth was handled this way, so you only had a vague idea when a city might grow or not.
Or income, having only a rough estimation of your income per turn.
That might make for an interesting game, but not a Civilization game.
This game is most definitely about understanding and manipulating values.

B. Just like in 'real-life', we live in hope - ??
So much fail in so little .

Real life? Whats real got to do with a game.
Even simulations have a set of rules they follow, and this isn't a sandboxy-open-ended type of game. It has clearly defined "Victory Conditions".
Instead of "hoping" your actions might lead you to victory... you should make deliberate and calculated actions to put you on the path of victory.
Are you voting or going to church?
No... your playing a game... leave "hope" out of it.

I wonder how you play chess...
"I sure hope he wont eat my queen if I put her in range of his bishop" :mischief:

But even if you ARE addressing real life...
By your mindset and logic:
A major of a small town of 200 people might...
Hire 5 policeman, hoping they will stop all crime.
Hire 500 policeman, hoping he will stop crime.

Even if he isn't dumb, and adjusts based on results. He either wasted taxpayer money, on redundant positions, Or let crime roam free because he was understaffed.
Im pretty sure he would like to do some "homework" before deciding on the number of police he actually wants to hire. Something other then "Hope".
I mean...The more money left in the treasury. The more he can embezzle. :goodjob:

C.
In other words, the system works ie. ain't broke and doesn't need any fixing.

Indeed it deserves a huge amount of praise and appreciation for working so well. On the list of 'things that need tweaking', it belongs pretty much right at the bottom.

(With all due respect for those who don't share these opinions...:p)
Where in my post do you see I say its broken or needs tweaking?
You can start showing respect by reading people posts.

Saying something is hard to understand does not mean it does not work.
Civ4 can pride itself on its easy to understand UI, it was made by firaxis and not paradox at the end of the day.
You do not need the games manual to be able to play it...
And I just hope the "slick"-user-friendly UI will translate to this mod.

Was asking for translucency, not a tweak or overhaul.

----
Since the system was designed to be able to deal with more complex sources it actually tries to do this:
C(N+1) = C(N) - C(N+0.5)*decay + SUM(positive sources) - SUM(negative sources)
where C(N+0.5) = (CPredict(N+1) + C(N)) / 2
and CPredict(N+1) is calculated like the formula in the quote.

Thanks!
This is more or less what I was asking.
((Also thanks to Koshling, for a "hard number" example))

@God-Emperor
Couldn't agree with you more. lol.

It seems to be quite a complex game mechanic. One not easily displayed in a way that will make sense.
At a glance.
From what i understand too many factors will influence it, and its basically a "trust us, its this much" kind of value.
But more in-game info is needed, to help players deal with it efficiently. (not by prayer and hope)

I'll add to my OP, that im somewhat of a veteran player that took a long break from the game. I might not be the best, but can certainly hold my own against the AI on deity without reloading every second.

So, dare I say it... that if I find it somewhat difficult to understand (from purely in game). Quite a few other people will have problems with it.
It wasn't a big leap for me to build dogs and put them on patrol, to check if im influenced by the enemy.
But once i did that... and built all the prehistoric buildings that help fight crime...
Considering my initial instinct is to go for early writing for obvious reasons and not for early masonry for a police-force...
Im pretty much left with values I do not understand and need to come to the forums to ask about them.

Regardless,
As is stands, unless your obsessed and will sit with a pda near you...
Or are carefree enough just to "hope" the problem away.
"OH look at that, a random building that cripples my economy just popped up." :mischief:
Lets hope it goes away...

De facto,
Its pretty much like trying to predict the weather based on how it was "yesterday".


"Normal" Civ math is something like this:
"I have 300 hammers, so i can build 1 200 hammer building and 2 50 hammer buildings".
Which seems to be the extent of the math a player needs to actually do.

In that spirit, I believe current decay should be displayed.
Like God-Emperor suggested.
 
Wow! while reading this thread my head hit the keyboard! I fell asleep!

JosEPh :old: :sleep:
 
:bump:
This may be the thread that contains the most concise efforts to explain the property system calculations. It's tough to follow but at least it lays it out for those who can follow the math.

This may be a good thread to link players to in the Player's Documentation thread. Or some kind of summation of it anyhow.
 
Top Bottom