911 Operator

911 Operator

36 ratings
Modifying City Map Data For Corrections or Convenience
By Boten Red Wolf
The ability to download and play in nearly any city in the world is pretty cool. However, the technology behind it isn't perfect, and if you're playing in your home town, that can be immensely frustrating to see. Here's a quick rundown on modifying the game's automatically-generated data to match realistic locations, layouts, and road behaviors. This is very much a work in progress, and any feedback is welcome.
   
Award
Favorite
Favorited
Unfavorite
Step 1: Download City, Find The Data Files
Note: As of writing and last update, I have yet to try this on my Linux machine to find the location of these files. Also, I do not have a Mac to try this on, so if someone does and knows the location of described files, please let me know and I will edit accordingly.

Note 2: I noticed we now have a workshop. Once I figure out how to appropriately package and upload stuff, I can present my modified Madison to my fellow players.



Downloading Your City

If you have already played on the city you wish to modify, you may scroll down until you get to the section on finding the data files. For those who have not played on a random or custom city yet, the process is fairly simple. Go into the Free Play menu and search for your chosen city's name. Be aware there may be many choices depending on the popularity of the name. As you can see here, when I searched for Madison, I got quite the list:



Now I know roughly the population of my Madison as well as the fact that it's the only one I didn't see in the list elsewhere, so I got it the first time around.

Once you make it to the management screen, where you can choose what personnel and equipment go with which teams, etc. you have made it far enough for the game to create the required files. I would still advise you to play through a tour of duty or three just to see how it plays and if locations, addresses, etc. are correct or how far off they might be. While Madison wasn't too bad, there are a few locations of normal medical clinics that show up as hospitals, some incorrectly placed and/or missing police departments, one missing fire department, and once played, not exactly a small amount of one-way streets that are being driven the wrong way (although for Madison, that's not exactly a rarity, we've too many as it is).



The large cluster of hospitals in the upper left are in reality only one hospital complex (read: one emergency room), and the one near the police department in the center of the map is not even a hospital, but simply a medical clinic. Down by the southern fire department, a police department should lie a block north. Without attempting to identify all the one-way streets that exist on the isthmus, the prior list are a few things I want to change to make Madison in game feel more like the real Madison. You should do the same...
Good...
Now that you have an idea of what you want to do, it's time to do it.



Finding the Data Files

In Windows, the game's main data will be in your Steam Library folder. However, none of the files we are after are in there. The files we are after are located in the game's saved data folder, which is deep inside your user's %APPDATA% directory (seriously, just put %APPDATA% into the "Run" box (Win + R), and that will come up). Once in %APPDATA%, go into LocalLow -> JutsuGames -> 911 Operator. You should see something very much like this:



All of the files we're concerned with editing are going to be inside of the "Maps" folder:



See the nice uniform scheme here? There's the XML files, which contain all the map's locations, road definitions, routing information, intersections, one-way tags, and waaaaay down at the bottom, definitions for public services, parks, bridges, and buildings; and then there's the PNG files, which are your background images/maps. You can either open a PNG to see the map and ensure you've got the right UID (number/code) for your city, or you can open the XML files until you see the correct city's data in the first big block.

Once you've got that UID, go back up a directory to the main "911 Operator" location, and enter "FreeGames", and delete the file in here with the same UID.

I consider the above a critical step, as in my experience, locations may not update correctly if this isn't done before and after any modification of the city's XML file. This file is also your savegame file, so back it up, but there are no guarantees on whether it will work after modifying the city data XML file.

However...


Another user, holger, has discovered and commented the following:

Another thing, to use old savegames:
- disable old savegame (likely done by changing the file name)
- start game with revised city map
- go to step where units can buy, a new savegame is create (management screen)
- close the game
- than copy/replace in the XML-file from "new" savegame to "old" savegame:
- all between <infrastructure> and </infrastructure> (just this section)
- disable new savegame and enable old (revised) savegame (renaming again)
- than you can play the revised map with the value of old savegame

Thanks again to holger for figuing that one out for us...


Now comes the fun part. Open up the city's XML file (remember, that would be the one in the "Maps" folder) in your text or code editor of choice. Using one that color codes files based on their language/syntax makes things easier. I use Sublime Text 3, but its up to you if you want to. Please support the developer of it if you do, it's a fantastic piece of software.



Once you have it open and can see the sheer massive size of what we're about to get into, feel free to crack open a cold [insert beverage of choice here] and get ready for step 2.
Step 2: "Decoding" The Contents
987 KB of pure text...

Holy s--t. That's a huge file.

Yes. It is. I want to break down what I'm fairly confident are rough definitions of the verious blocks and tag types first:

Blocks:
<city> <tags> ... ... </city>
This block contains basically metadata about the city: the name, country and state/province/region, population, and other info. Not sure what anything outside of the names and the node tag do, so I'd avoid messing with them unless you're experimenting like me.

<waynodes no="####" pbottom=[latitude] pleft=[longitude] pright=[longitude] ptop=[latitude] road_level="#">
This single line defines a few things:
The "no" variable defines the total number of node blocks. If you're not creating or removing nodes/node blocks, do not modify this.
The "p{bottom,left,right,top}" variables define the playable area. At the time of writing, I have not tried modifying these values to reduce or enlarge the play area, but it may be possible.
The "road_level" variable does something, but I haven't discovered quite what yet.

<node id="####" lat="##.#######" lon="##.#######" nb="#"> <conn cost="24" tag=""[optional] to /> ... </node>
Each of these blocks contains information about a specific node, used in navigation and locating things. These are important, and in themselves, are very likely correct. They are referred to later by other blocks using their id="" variable. Don't modify these unless you're experimenting, this can very easily break your city. Keep a backup if you do mess with these blocks.
The "node id" variable is referred to by blocks later on in the file. Do not change this value.
The "lat" and "lon" variables are that node's geographical latitude and longitude coordinates, respectively.
The "tag" variable seems to only reflect defining one-way "ow" streets, as i haven't seen other tags used yet.
Do not change these values unless discrepancies cause major navigational issues (not likely at all).


<way id="####" l="##" n="Street Name" no="##"> <nd id="####"/> ... </way>
Each of these blocks denotes either a street or a section of street if the style, direction, or other navigational criteria changes.
The "way id" variable defines the unique number of that street, as identified by the game engine. This is referred to by some other blocks for navigation purposes. Do not change this value.
The "l" variable (it's a lower case 'L') has a function not yet discovered by me, although I feel it may have something to do with the size/capacity or speed grade of a road, or whether calls are eligible to be dispatched to said road.
The "n" variable is a name of the street and can contain spaces and such to give the user/player a readable street name. This can safely be edited as one sees fit.
The "no" variable defines how many points/tags are listed inside the block.
The <nd id=""> tags identify an ordered list of specific points (see "node" blocks above) that make up a street. Used in navigation, only edit the order of these if there are problems with vehicles cutting corners, skipping sections, or similar misbehavior. Adding, removing, or moving node id's is beyond the scope of this guide in its current version.

<pois groups="#"> <group no="#" type="[police/fire/hospital/etc.]"> <poi id="####" lat="##.#######" lon="##.#######" name="Entity Name" wayid="###"/> ... ... </pois>
The pois block defines "POI's" or Points of Interest, such as police and fire, hospitals, banks, and small/large buildings, among others. The group sub-block inside of the pois block defines each type of poi and each specific entity of each type.
The "groups" variable inside of the pois defining tag is the total number of group types. This is likely static and shouldn't be changed.
The "no" variable inside of the group sub-block is the number of entities in that category. If you remove or create your own PD/FD/Hospital/etc., don't forget to change this to reflect that change.
The "type" variable inside the group sub-block is the type of entities that are inside that sub-block. This is static. Do not change it. Find the "type" category that most closely resembles the entity you are changing, adding, or removing.
The "id", "lat", "lon", and "name" variables are the same as they have previously been defined in other blocks.
The "wayid" variable defines the street on which the entity resides. Set this appropriately if you move or create new entities, otherwise navigation issues may arise and/or starting points may not be assigned properly.


Does your brain hurt yet? Yeah, mine too. Now we get to check real-world locations against the map data the game pulls in at download time...
Step 3: Confirming Correct Locations and Combining Data
Things get a little easier here.

Anything that you've noticed is incorrectly placed, located, or identifed, needs to have it's absolute location identified. I prefer to do it with the same system the game pulls this data from, which is https://www.openstreetmap.org.

In my example here, the "Central District Station" is the downtown precinct location for Madison Police Department. The game, however, incorrectly placed it (albeit ONLY) a block away, at the unnamed location with the same icon, which happens to be the County Sheriff's office.


Even this small miscalculation drove me slightly nuts because, well, who knows. However, that small example makes a good one to use in this case, as only two variables actually need to end up being changed, but I will note any others that might need to be changed for most cases.

To move the location of the downtown PD, I right clicked on the "Central District Station" icon and clicked on "Show Address". When the panel on the left updated, it showed some coordinates there. Coordinates are almost exclusively listed in the order of LAT, LON. They are also done so here, so copying them over in the correct order shouldn't be an issue.

Okay, now the fun part. Go back to the city's XML file and scroll down to the very bottom. Roll back up slowly until you hit the piece you're looking for. In my case it would be Central PD. I just changed the lat and lon variables to match the lat/lon shown in OSM since the sheriff's office and Central PD are basically on the same road. Technically central is on South Carroll St. but for the sake of it being a game and not wanting to screw around with wayid's and nodes, I did it the easy way. If you move an entity such that it is on a different road, simply use your editor's search or find function to find the road it is on, and change the entitiy's wayid value to match. The process is identical whether the entity is a police department, fire station, hospital, bridge, or building of any type.
Step 4: Testing and Tweaking
Pro tip: you don't need to close out of the game to test changes to the file.

Just back out to the main menu, delete the city's file in the FreeGames directory, make sure your modified XML is saved, and re-open the city in the Free Play menu. When you get to management mode and the deployment screen, you'll notice the effects of your changes if the entity in question was a PD/FD/Hospital.

Play a tour of duty or three to see if the changes stuck properly and that vehicles can get in and out correctly as well as navigate the areas correctly. If not, go back and tweak things. To keep yourself from getting confused with the whole "crap, which change did I make that did that?!" thing, just change one thing at a time until you get it right. Since you can do it while in game (alt-tab works just fine on my machines), the time between changes can be rather low.


Playing a Broadcastify (or real) scanner feed in the background can assist with ambiance as well as make things more difficult when you have multiple things going on such as a real dispatch going over the air on Broadcastify and an incoming 911 call in-game.


Hopefully this at least got you started on modifying and cleaning up some custom/random cities for you all. Feel free to ask any questions you might have or post any feedback regarding the procedures or if you have any information that can be useful or productive for myself or other prospective modders.

Also don't forget to thank or otherwise show appreciation to a first responder in your area, this game is only a tiny glimpse into the absolute chaos they get to go through on a daily basis... or the munchies they may get while on duty.
28 Comments
wickedmystic13 3 Mar, 2019 @ 9:24am 
I would be so happy with just a way to move the centre of the map
MightyOwl 8 Dec, 2018 @ 2:35am 
I believe maps are a defined size. So while you may be able to move them (somehow?), I think it would then cut off the other half of the city instead.
Boten Red Wolf  [author] 8 Dec, 2018 @ 12:42am 
@askavian - It did the same for me, cutting off most of the east side and ALL of the west side neighborhoods. I'm not sure if you can search using a ZIP/Postal code or some similar smaller-zone identifier when pulling map data. It's been so long since I've done anything with this game that I don't think I could help too much other than that.

Best of luck!
askavian 7 Dec, 2018 @ 2:25pm 
Hi

Thank you for the guide. That helped me a lot!

Do you know how I can make the map bigger?

In my hometown the game allways cuts of half of the city.

Best
ZZZ Mommy ASMR Enjoyer 27 Aug, 2017 @ 1:03pm 
in my town the mcdonalds was a hospital and the YMCA was a hospital as wll as a nurseing home
Kamen Cider 17 Aug, 2017 @ 5:02am 
The first non-call mod (or DLC) needs to be about this kind of map repair.
MightyOwl 28 May, 2017 @ 4:14pm 
Great guide, certainly a favourite but not sure if I'll ever want to do this. I imagine the uploading will work out of the editor like calls? (Mind you, how does language uploading work?)

I've read a lot of post around here and I know there are plans for a map and a scenario (I believe this is just the random calls you see on the map, not ones were people actually ring you up) section on the workshop. Has anyone seen a date for this or not? (Just wondering, if not that's cool I don't mind waiting!)
Usher  [developer] 9 May, 2017 @ 4:55pm 
POI id is not really necessary, neither the node connection - the unit will get as close as possible.

If you place your poi too far off the road, then you need a new node and the connection.
connections are needed both ways, so first you need a new node - increment both the ID and the number of nodes in nodes header, then make "conn" elements in both the new node and the existing, closes one.
Mind that you also need to increment the number connections indicator in the old node header (nb="1" to "2" etc)

way editing is not necessary again.
Boten Red Wolf  [author] 7 May, 2017 @ 8:26am 
Motor Head, I think it's more like HEX-ML... this is insane. lol howdy neighbor! I'll take what we've got now, up in the 60's. Perfect driving weather. Warm enough for windows down, but cool enough to keep the car from running warm.

Glad it worked out for ya as well as it did. My first attempt at bootleg reverse engineering something and it kinda worked.
Lone Wolf 7 May, 2017 @ 5:27am 
@Boten Red Wolf This is awesome. Added all the other Fire Dept's to the map and they seem to work great. Now all I need to do is earn enough money equip them all.

Expanding the map on the other hand is a whole nother can of worms but I'll play with that later since I just got the game and have spent more time editing than playing. You should see how many xml files are in my recycle bin lol. Thanks again!