OutpostUniverse / OPHD

OutpostHD - Open source remake of Sierra On-Line's Outpost
BSD 3-Clause "New" or "Revised" License
106 stars 19 forks source link

Implement Crime #911

Open Brett208 opened 3 years ago

Brett208 commented 3 years ago

From @belgianguy

Nice work! Indeed it should then be written out:

  • What defines the game element of Crime? (Do other Structures 'emit' crime that the Police station then neutralizes?)
  • What causes Crime to rise and how do we define that? (Low Morale? Idle Workers? Low food?)
  • How is it represented in game? (As a counter? Low values is low crime, high values is high crime?)
  • What other game elements are affected by it? (Residential units transforming into Red Light Districts, ... )

How about blue-ish? Must take care not to be the same blue as the mouse tile selection highlight. About the iconography, perhaps a solid fill fits better with the others? Will OPHD also feature the DIRT structure? Then we might need to think of another "protection" icon.

From @ldicker83

Not too keen on the icon that's there. Here's one from the same set that can be included in the credits list that's in the data repository:

police

Put this one through the ringer so it's fully compressed and stripped of unnecessary metadata.

@ldicker83, have you recorded your thoughts on how to implement the police stations somewhere? I poked around the forum but didn't see anything obvious. Probably need to talk a bit before continuing to make sure this aligns with your vision.

I have not. Honestly I haven't given it a whole lot of thought yet so it's entirely up for debate. If I had to take a quick crack at it I'd say that some buildings 'emit' crime at a constant rate as @belgianguy suggested which can be affected by a difficulty modifier and adjusted based on current morale. Police would also affect that.

I'd recommend a separate task/issue to further the discussion.

See PR #910 or #904 for initial discussion. That PR implements a view of police station coverage and concept of police station affecting range.

belgianguy commented 3 years ago

I've reviewed all the resources of the original game in my possession, including the manual, and it seems a really underlit game element, I could only find the following:

So in a nutshell in the original game "Crime" just seems to be mainly a game element that manifests itself underground. It is "generated" by overcrowded residential units, so I suppose these accumulate crime points related to how much overcrowding is going on. If this goes on for certain turns, a threshold of crime points will be exceeded and this Resedential unit will turn into a Red Light District (the conversion does not happen the other way around.) So the Police buildings really only serve a purpose to keep this from happening, or curtailing where it can happen.

What I find hard to process is that the Police stations cover a radius, while overcrowding is a "global" game statistic (not radius limited). As such I expect a Police station to be only able to prevent/reduce the effect of accumulating crime points in an overcrowded Residence instances in its protection radius. Either by slowing the accumulation (Benevolent) or setting it to 0 (Hostile). So Residences not in the protection radius would accumulate crime points the fastest, of course the age in turns of the building will be a factor, as would be its exposure to overcrowding.

Other ideas (brain dump):

The stealing and sabotaging could also occur above ground, so that would give the above ground Police a purpose. I would also think that "Crime" would be more impactful than an attribute of Residential units, but how do we make that jive with the radius of Police buildings? If a global statistic, it needs a place in a report, as a number or a state (Low/Medium/High) If it can occur separately on a per-tile basis, we need to visualize it (show a balaclava icon above a structure?) I would perhaps also find extra "origins" for crime next to overcrowding, like low morale, low food, scientists as workers (which could just affect Morale too), too much idle workforces with nothing to do?

ldicker83 commented 3 years ago

So here's where I'd say that crime should be completely rethought and not based on how the original game did it. What you found about the original game is pretty much accurate -- it's poorly implemented and can easily lead to runaway problems where overcrowding gets worse and worse as more residential units turn into RLD's, etc. etc. etc.

I see this as a poor way of implementing crime.

What you're suggesting in your other ideas is how I'd sort of see it. Crime would work more like it does in city builders -- e.g., different buildings can contribute more toward crime rates. Morale affects the likelihood of crime being committed (e.g., lower morale higher crime, high morale lower crime, etc.). This would work as a sort of gradient across all structures with police structures operating to lower crime rates in their area of influence. Research can be used to improve the effectiveness of the police force including new robot designs, etc.

I'm thinking that it would be per-tile based on 'area of influence' of buildings with modifiers based on morale, education level, health levels and other factors (we're starting to get into more detailed parts of the simulation so now's the time to start thinking about what those other factors are). I think the icon you mentioned makes a lot of sense (have since pushed an icon to the data submodule)

Brett208 commented 3 years ago

OK, to try to summarize and condense the thoughts so far (and add a few of my own):

I think turning residences into red light districts is a bit of a hallmark in the original, but it sounds like maybe not so desired now.

Brett208 commented 3 years ago

A quick update. On my local machine I have buildings generating crime each turn. This gets aggregated into a mean crime rate that is displayed in the populate/morale section. I haven't implemented police stations reducing crime yet in their areas of influence yet.

MeanCrimeRate

The testing is being hampered a bit because my smelters seem to no longer be receiving minerals from the mines on the master branch. Not sure what broke it recently although I saw there were some other issues discussing truck route issues.

ldicker83 commented 3 years ago

Use Ctrl+F10 to add additional processed resources to your pool. Temporary 'cheat' for development purposes. Will look into the routing (especially if you can provide a save game where this is happening). There are times when you'd expect resources to move but it's not immediately obvious why, definitely something to be notified about or have some sort of explanation available (might be time to add alert icons over buildings that are idled/disabled due to resource/logistics problems).

Anyway, as for crime, that's an astonishingly high rate no? Those colonists are evil. What are some of the factors you've got going into it?

ldicker83 commented 3 years ago

@Brett208, I just merged #932 into master, see if that fixes the resource movement issue you were experiencing, I have a feeling this should solve it.

Brett208 commented 3 years ago

@ldicker83, it looks like something is still broken. I am now seeing the truck route and the smelter is storing raw materials, but it doesn't seem to be actually smelting any of the resources for use in game. Notice I have 60 metals in the smelter but it never increases the metals on the top left tooltip.

Metals Not Storing

For the crime rate, I was just increasing it by 10% per structure per turn to test it out. Unfortunately, I haven't worked on any real factors yet...

Today I updated the population panel to show a positive morale change if your mean crime rate is < 10% or a negative morale change if mean crime rate is > 70%. I just changed the population panel, but I don't think it actually affects morale. Guess that is probably next. Open to other numbers if 10% and 70% seem like the wrong percentages to choose. I just made it +/- 1 for simplicity. Maybe it should decrease morale more rapidly the higher above 70% mean crime rate your colony gets.

Crime Rate Affecting Morale
ldicker83 commented 3 years ago

I'm thinking 50% == -1 and then an additional -1 per 10% above that? Fairly punishing but that seems fairly realistic in terms of pissing off colonists.

I'll look back into resource movement, seems something is getting missed though it looked okay on my end.

Brett208 commented 3 years ago

Ok, looks like your recent pushes fixed the last issues I was seeing with resources. Thank you for fixing.

Just implemented the suggestion above to increase the rate of morale loss starting at 50%. I'll plan to push what I have this weekend to keep from getting too out of sync with the master branch. Some portions will be overly simplified still.

ldicker83 commented 3 years ago

It's an iterative process. I find myself often getting behind because I'm trying to find a complete solution when smaller iterative steps should be used. I think this is a good first step which can be refined later.

Brett208 commented 3 years ago

Some notes from PR #968:

Brett208 commented 3 years ago

Just a quick update. I am going to see how hard it is to add assault/murder and target this as the crime committed at residences. May also want to look at property defacement at parks that lowers overall morale if that sounds like a good idea.

I was thinking of trying to color more of the crime activities towards a rebel political faction than just unexplained crime. I think it plays more at the theme of Outpost. IE Political dissidents defaced the park. Or the rebel faction committed assault, an investigation is underway. Or food was pilfered from the Agridome, a group attempting to form a splinter colony is suspected.

ldicker83 commented 3 years ago

I like that idea.

When I first started building the game I was thinking that there wouldn't be a rebel colony, but I'm thinking that it could be something that happens if morale drops low enough for a long enough period or criminal activity is not kept in check for long enough. Can lead to a lot of resources and population splintering off into its own colony.

BUT, it would require some thought on the design-end on how the computer controlled player is handled. If I go this route I really don't want it to be super shitty like it was in the original game. I'd want it to actually make some sort of sense. Then the Trade Administration building would actually make sense as well as Monorail's for transport.

Anyway, I digress.

I'm game for adding flavor text like that. Maybe even have a dictionary of phrases that could be used.

Brett208 commented 2 years ago

There is still more work to do, but considering I haven't contributed since July, thought I would un-assign myself for now in case someone else wants to take a turn working on it.

ldicker83 commented 2 years ago

That's fair.

We've all sorta taken a break but it's time to ramp it up. :D Crime is ultimately not slated until v0.9.5 which will also implement difficulty. It's partially implemented here (I've noticed it pushing alerts as I test the game and it's actually quite interesting especially when I'm not cheating and resources suddenly disappear that I was really needing).

So good work so far!