Mafia: Definitive Edition

Mafia: Definitive Edition

43 ratings
Increased draw distance and traffic density
By Jelly Doughnut
One of the first things I noticed after roaming around the city for a while was how small the amount of pedestrians and cars on the street was and how awful the draw distance is, causing all sorts of pop-in issues.

Well It seems this can be fixed by editing an XML file on the game directory and increasing the spawn rate and distance values.
2
   
Award
Favorite
Favorited
Unfavorite
Instructions
  • First, locate the game folder directory (typically at: \Program Files (x86)\Steam\steamapps\common\Mafia Definitive Edition
  • Find the "edit" folder on that directory, open it, and then proceed to open the "config" folder (\Mafia Definitive Edition\edit\config)
  • Find the file "game_constants.xml" on that folder, right click on it and select "edit".

The lines we need to find are under the <group name="Traffic"> section, as seen on the picture below.



As we can see there's all sorts of options to customize but we only need to edit these lines:

<group name="Traffic"> <constant name="MaxHumanElementsLow">20</constant> <constant name="MaxCarElementsLow">20</constant> <constant name="MaxParkedCarElementsLow">20</constant> <constant name="MaxTranslocatedCarElementsLow">20</constant> <constant name="MaxTranslocatedBoatElementsLow">20</constant> <constant name="MaxBoatElementsLow">3</constant> <constant name="MaxTrainElementsLow">2</constant> <constant name="MaxHumanElements">150</constant> <constant name="MaxCarElements">40</constant> <constant name="MaxParkedCarElements">50</constant> <constant name="MaxTranslocatedCarElements">50</constant> <constant name="MaxTranslocatedBoatElements">20</constant> <constant name="MaxBoatElements">10</constant> <constant name="MaxTrainElements">5</constant> <constant name="HumanSpawnRange" type="float">70</constant> <constant name="HumanSpawnCreateOffset" type="float">50</constant> <constant name="HumanSpawnRemoveOffset" type="float">60</constant> <constant name="HumanSpawnZDistance" type="float">30</constant> <constant name="VehicleSpawnRange" type="float">110</constant> <constant name="VehicleSpawnCreateOffset" type="float">80</constant> <!-- 50m was too small, some huge crossroads prevented from spawn car at the desired direction --> <constant name="VehicleSpawnRemoveOffset" type="float">110</constant>

I don't know what are the hardcoded limits on those values, I started to increase them by 10 to see if it made any difference. I'd say I'm happy with the results.

This are the values I'm currently using:

<constant name="MaxHumanElementsLow">40</constant> <constant name="MaxCarElementsLow">30</constant> <constant name="MaxParkedCarElementsLow">30</constant> <constant name="MaxTranslocatedCarElementsLow">30</constant> <constant name="MaxTranslocatedBoatElementsLow">30</constant> <constant name="MaxBoatElementsLow">5</constant> <constant name="MaxTrainElementsLow">4</constant> <constant name="MaxHumanElements">180</constant> <constant name="MaxCarElements">70</constant> <constant name="MaxParkedCarElements">80</constant> <constant name="MaxTranslocatedCarElements">50</constant> <constant name="MaxTranslocatedBoatElements">30</constant> <constant name="MaxBoatElements">10</constant> <constant name="MaxTrainElements">10</constant> <constant name="HumanSpawnRange" type="float">100</constant> <constant name="HumanSpawnCreateOffset" type="float">70</constant> <constant name="HumanSpawnRemoveOffset" type="float">80</constant> <constant name="HumanSpawnZDistance" type="float">60</constant> <constant name="VehicleSpawnRange" type="float">150</constant> <constant name="VehicleSpawnCreateOffset" type="float">100</constant> <!-- 50m was too small, some huge crossroads prevented from spawn car at the desired direction --> <constant name="VehicleSpawnRemoveOffset" type="float">150</constant>

Feel free to play around with the values and adjust them to your liking. I'm still trying different variables but as of now, those seem to be good enough to make the world a bit more alive.

17 Comments
Flonno Nov 25, 2023 @ 8:26pm 
Yeah I see, absolutely no worries, I appreciate you even taking the time to respond. Both of you.
Jelly Doughnut  [author] Nov 22, 2023 @ 1:39pm 
Hey Flonno, maybe DT is right and the difference is barely noticeable, if at all?

I remember noticing a bit more pedestrian density, even in some cases encountering odd glitches like little "crowds" of pedestrians colliding with each other as if they were spawning, that's why I started trying lower values...

But to be fair, I haven't played the game in quite a while, maybe something changed, maybe not. I'm sorry I can't be of more help regarding this, what I know is already on the guide.
excelatrate Nov 19, 2023 @ 10:49am 
For what it's worth I never really noticed a pedestrian difference before or after the edits while I was playing but the pedestrian density never really bothered me in the first place, just the empty highways which these edits alleviate a little.
Flonno Nov 19, 2023 @ 9:24am 
I appreciate your responses, thanks for taking the time to help me.
Flonno Nov 19, 2023 @ 9:24am 
Hi, yes I keep checking to make sure and its the right lines. I set it to read only and still no change. I even put the values ridiculously high (2500 for MaxHumanElements). Also I am playing in story mode, do these values only affect free ride?
Jelly Doughnut  [author] Nov 16, 2023 @ 3:39pm 
Hey Flonno, you sure you're editing the right lines? I would also recommend to set the file to read only after you finish editing so the game doesn't change it back, just to make sure.
Flonno Nov 13, 2023 @ 7:51pm 
No matter what I do I can't get more pedestrians.
Breadn Mar 2, 2023 @ 8:13pm 
Thanks! This should really be a setting in the game's options menu, similar to how GTA 5 has traffic / population density settings. There doesn't seem to be any performance impact so I don't see why not.
Jelly Doughnut  [author] Feb 20, 2023 @ 4:19pm 
Hey DT, thanks, I appreciate you find this useful.

I'm not sure about that since I didn't mess around with those values. I just stuck with editing the pedestrian/car spawn rate since that was what I was looking for.
I should mention that before making this guide I read somewhere that changing some of these rates to unproper values can have negative impacts on the game. So I would advise to be cautios and back up your files before making any drastic changes.

Yes, I should post it on the PCGW when I get the chance. Feel free to do so yourself if you want.
excelatrate Feb 19, 2023 @ 12:06am 
You should post this to the Mafia DE PCGAMINGWIKI page so it gets more visibility this tip isn't posted anywhere!

That being said I wonder if this code should be changed too?

<constant name="PoliceOnFootSpawnRange" type="float">70</constant>
<constant name="PoliceOnFootSpawnCreateOffset" type="float">200</constant>
<constant name="PoliceOnFootSpawnRemoveOffset" type="float">210</constant>
<constant name="PoliceOnFootZDistance" type="float">30</constant>
<constant name="PoliceVehicleSpawnRange" type="float">110</constant>
<constant name="PoliceVehicleSpawnCreateOffset" type="float">200</constant>
<constant name="PoliceVehicleSpawnRemoveOffset" type="float">210</constant>
<constant name="PoliceVehicleZDistance" type="float">30</constant>