11

Just as the title says. There are a LOT of terribly written names and biographies for prisoners that really ruin what immersion there is, and I haven't seen anything pertaining to this yet. So, there it is. Can it be done with a mod/simple option I have yet to see?

  • 1
    Have you come across Dave Grabowski the Wildebeest smuggler yet by any chance? I would not be surprised if it is not possible as people who have paid extra for the privilege will feel like they have contributed to the core game that way. – kenjara Oct 31 '14 at 13:07
  • 1
    They don't care about other users seeing their character (especially with the way some of them are written), they want to see them for themselves. They can access it all they want, but I want no part of it. :P – Dax Nov 2 '14 at 2:31
  • 4
    As of the latest update, you can now report bio's that are offensive or of very low quality. – Landric Nov 30 '14 at 11:03
  • Two of my favorites is a prisoner called "%username% %password%" (first,last) and "Adolf Hitler" the death row inmate. His bio goes on to describe how he was a dictator in Europe that was responsible for the genocide of millions of innocents. Some get rather ridiculous though. – Tim S. Jun 6 '17 at 18:22
5

As of now (Alpha-29) this is currently not possible with a mod, because the game does not recognize when you try to override "names_in_the_game.txt". If it annoys you enough you can modify main.dat directly though.

I've created a mod on steam that provides the files, and same instructions, as this answer: http://steamcommunity.com/sharedfiles/filedetails/?id=402505971.

IMPORTANT: This answer modifies gamefiles directly. The answer is provided as-is, and could very well break the game completely. You are strongly recommended to back up your game files and your save files before trying this out. You'll likely need to repeat the steps after the game auto-updates.

First we need WinRar. You can download a free trial version from the official website if you don't have it already.

Go to your game files. By default they are located in C:\Program Files (x86)\Steam\steamapps\common\Prison Architect. Open "main.dat" in WinRAR. You might need to rename the file to "main.rar" to get this to work. Extract all the files to a place you can find, such as your desktop.

There should be a Data folder in the files you just extracted. Replace "names_in_the_game.txt" with a version you like better. An empty file will remove all the custom prisoners from the game. I personally prefer to run a script on the original file to normalize some of the crazy stuff. I'll include the sourcecode of a python script I wrote in the bottom.

Once you are done, replace the file "names_in_the_game.txt" in the Data folder. Right-click on the Data folder and "add it to archive". This should open WinRar. Set the outputfile to be main.dat. The output format should be "rar". You have to turn on the option "make compact archive" or something along those lines in the archive options. Click "Ok" and it will start recreating main.dat. Last, move "main.dat" back into your game folder.


import re, random

sourcebiographies = "biographies.txt"
sourcefile = "names_in_the_game_original.txt"
outputfile = "names_in_the_game.txt"

forenames = []
surnames = []
validpresurname = ['mc', 'von', 'van', 'de', 'da', 'di', 'du', 'la', 'le', 'der', 'the', 'af', 'of', 'el', 'vi', 'v/d', 'den', 'al', 'del', 'se']

i = open( sourcebiographies, "r" )
for line in i:
  x = re.split( "[\t ]+", line.strip(), 1 )
  if x[0] == "Forename":
    forenames.append( x[1] )
  elif x[0] == "Surname":
    surnames.append( x[1] )

i.close()

i = open( sourcefile, "r" )
o = open( outputfile, "w" )
for line in i:
  x = re.split( "[\t ]+", line.strip(), 1 )

  if len(x) > 1:
    val = x[1][1:-1]

  if x[0] == "Bio":
    #Blank out every bio. Most of them are crap
    o.write( "  Bio \t\t\"\"\n" )
  elif x[0] == "LastName" and len(val.strip().split( " " )) > 1 and val.strip().split( " " )[0].lower() not in validpresurname:
    #Some people abused the LastName field. If our educated guess of finding out
    #if the name is valid, we replace it with a random name
    o.write( "  LastName \t\t\"%s\"\n" % random.choice( surnames ) )
  elif x[0] == "LastName" and len( val ) <= 1:
    #If the last name is 1 or 0 characters long, we replace it with a random one
    o.write( "  LastName \t\t\"%s\"\n" % random.choice( surnames ) )
  elif x[0] == "FirstName" and len( val ) <= 1:
    #Similary if the first name is 1 or 0 characters long, replace it with a
    #normal name
    o.write( "  FirstName \t\t\"%s\"\n" % random.choice( forenames ) )
  elif x[0] == "NickName" and (len(val.split( ' ' )) > 2 or len(val) > 15):
    #Some people write entire stories in their nickname; if there are more
    #than 2 words in the nickname, or the nickname is very long (15+ characters)
    #we just ignore it
    pass
  elif x[0] == "FirstName" and re.match( "^(?P<rep>.+)(?P=rep)(?P=rep).+$", val.lower() ):
    #If the first name is a repetition of some kind, let's replace it
    o.write( "  FirstName \t\t\"%s\"\n" % random.choice( forenames ) )
  elif x[0] == "LastName" and re.match( "^(?P<rep>.+)(?P=rep)(?P=rep).+$", val.lower() ):
    #Same for the surname
    o.write( "  LastName \t\t\"%s\"\n" % random.choice( surnames ) )
  elif x[0] == "NickName" and not re.match( "^[a-z ]+$", val.lower() ):
    #Some people have weird characters in their nickname; we don't want that
    pass
  elif x[0] == "FirstName" or x[0] == "LastName" or x[0] == "NickName":
    #Some people don't know how to capitalize a name. On the off-chance
    #that we misspell 1 or 2 names we just title-case the first and last name!
    o.write( "  %s \t\t\"%s\"\n" % (x[0], val.title()) )
  else:
    #Everything else we just write back unchanged
    o.write( line )

i.close()
o.close()
  • For those not familiar, the above script is Python and in order to execute it, requires a python interpreter installed on your system. – Tim S. Jun 6 '17 at 18:23
2

Like Landric said you can now report bad bios but there is no way (at least not yet) to turn them off.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.