Reverse Engineering - joric/blueprince GitHub Wiki

Kudos to Hyphz for the posts.

Decompiling

Ill2CppDumper-net6-v6.7.46 and Ghidra 11.3.1 plus potentially a .NET DLL analyser will get you started on the code. However, reading il2cpp'ed code is a pain in the ass - everything is NULL checked, meaning that there's a huge nest of IF statements in the decompiled output, and the CPP compiler also sticks in an anonymous function for almost any duplicated code. The class you're looking to start with for the RNG is RoomDraftHelper. There's a lot of other code for Rooms, but most of it is to do with displaying the rooms you can see while culling the ones that can't be visible to increase performance.

However, here's the snag: a lot of this game isn't in that code. Most of the probability data is in Unity objects. Plus, a lot of the game logic is in PlaymakerFsms.

So next step is: BepinEx ILCPP win64 6.0.0 and RunTimeUnityEditor Bepin6 IL2CPP v6.0. The object tree for this game is big, so expect a few seconds of lag when you hit F12. The place to look in the object tree is in "__SYSTEM/THE DRAFT/Draft Code" and nearby items (capitals sic). There's a probabilities object and a whole bunch of room lists.

There is a dumper out there to generate a header file for Ghidra, information is pretty limited and the closest thing you will find to a guide is this:

Save files

There are tools that allow decoding Unity save files in es3 format, such as Blue Prince save files, i.e. EasySave3 format. They appear to be AES-encrypted JSON files. You can dump AES password with MelonLoader.

This is how you can unlock vault 370, for example (search for "370 Opened" on web):

Save files are located at %HOMEPATH%\AppData\LocalLow\Dogubomb\BLUE PRINCE\storage.

  1. If you have a current save, make a backup in case anything goes wrong.
  2. Upload your save to https://es3.tusinean.ro/, under the Decryption heading.
  3. For the encryption password, use the following:
D#vnrl%TI_9q0euFPIx+wKRuNx%Aja2-AtuH1jtMSk2k%H1jXjUPor08QaeQE=p5l=LAIWaSYms-68SYVS0PPoWxgM1B8?8tirM+UGr=cp!5a3=B5tBsKYEUfqxN!H9DvRVkLW?6cMeZWxgov%OOXmfl9zRiqWPsXq95lEc4yax7hqf5m_i5ssn-OGgLA8LJu2ETibBi7DwLc-zQ4M9jRGIdV_izS_J_=3FA=rAo0HUiEr-HWYVnuK$OQUyaVMchXxf%EBo3A7Z-PXYm$6PPG%fJfWzV7M$L5he#y5cb?kVR67IfGzG$UzBcLhNMDhQFwQSEX59ZG7hP32q?6PgirmvGTd-45+7ZKyG$FrDHoNw7ceUhrxYdzYSHd0yRz0T_RR_R5$GZda%DDfCUPHIaVlIhMq4FEOzo?GL7wyXr9XD7SD_QGpjZh&NDwycjnBeOy2mmFazlOV5eR7jsiwYDde9jCOH&cOxeTody=iUEt|l7JCQ8IyX|0g3H&NO6DMveVqC9|OPkOZpO3DpM|||3LJ7PX40rZJXmLILu0UXU9hpM5
  1. Download the decrypted save file. You can now edit the file in notepad or any text editor.
  2. Go through and change options from FALSE to TRUE for your trophies, permanent progression, etc. There are a few where you can set a value as well, like for allowance or the number of times you've beaten the parlor/billiard puzzles.
  3. Once you're done, upload it to the website again in the encryption section, and then download the encrypted save.
  4. Change the name to match the original save game name and put it back in the save folder.

In this case, search for "370 Opened" and set all them to true (there are 4 occurences, for all user profiles). Upload to site, download encrypted, rename to MtHollyBlueprint.es3 and you're good to go.

RNG

Tips

So, like a lot of people I got rather frustrated with the RNG in this game, especially in the context that it's essentially using a gambling mechanic to encourage you to spend more time on the game than you otherwise would.

So I tried to reverse engineer parts of the game to see if I could find anything out about the RNG or how it works. Annoyingly, this is a right pain in the ass on this game, as it's written in a very confusing way and has been il2cpp'ed (a process to make Unity games specifically harder to mod or inspect) which is rather aggressive for a single-player game.

But I think I've found:

  • The game completely replaces the rarity probability tables based on the game week, ending at week 3. So for the first 14 game days you face harsher RNG that you will for the rest of entire campaign that point.
  • The probability of drawing rare rooms increases with rank (this is mentioned), but they are also more likely in the right-hand draft slots than the left.
  • There seems to be a mechanic called "minor boost" and "major boost" which gives bonusses to certain rooms, but I'm not sure what causes them to get it.
  • I'm like 50%+ sure that there isn't a single deck of rooms you're drawing from. The game essentially rebuilds a new deck every time you draft, but leaves out any rooms you've already placed.
  • There are a bunch of different categories rooms can be in. For example, there's separate lists called "edge creep", "edge pierce", "edge advance" and "edge retreat", and these are different for east and west edges. I'm not sure what their significance is. Rooms that cost gems are in separate category lists. If the game keeps giving you gem rooms when you have no gems, it knows exactly what it's doing.
  • There was at some point a display that showed the probability information on rooms on the draft screen, but the code seems to have been removed. There was also a "publisher mode" which let you give yourself gems and keys and rotate rooms freely, but only a help texture seems to be left. There are some "cheat objects" left in the scene graph.
  • Internally this game is nowhere near as serious as it feels in play :)

Weird find of the day. RoomDraftContext::RedraftSlot seems to use this logic:

  • Try once to pick a room
  • If that didn't work, try again to pick a room
  • If that didn't work, pick the Closet (!)

Curves

Should also note. The game makes the probability curves significantly easier on day 7 and then again on day 14. So if you’re suddenly hitting 46 on those days, don’t start crowing about skill!

I mean the easier curve helps everything. You’re like 10x more likely to get rare rooms on day 21 than day 1.

Misc

At the start of the game your percentage probabilities for drawing each room rarity on each rank are:

Rank Common Standard Unusual Rare
1    99.48  0.5      0.01    0.01          
2    99.28  0.7      0.01    0.01    
3    97.89  2        0.1     0.01    
4    95.49  4        0.5     0.01    
5    91.95  7        1       0.05    
6    89.65  7.5      2.5     0.35    
7    88.6   8        3       0.4     
8    87.5   8.5      3.5     0.5     
9    86     9        4       1       

However, these change as you play. The game has 4 probability schedules: "Week 1", "Week 2", "Week 3", and "Solarium". So just taking more days increases your probabilities. As an example, by week 3, here's the chart:

Rank Common Standand Unusual Rare
1    91.8   7        1       0.2
2    89.7   8        2       0.3
3    87.5   9        3       0.5
4    74.3   20       5       0.7
5    71     22       6       1
6    64     28.5     7.5     2
7    60     28       9       3
8    57     29.9     10      3.5
9    56     30       11      3

And that's not all - on the later weeks, the three slots of the draft have different probabilities, with the right hand slots notably more likely to get rarer prints.

Also the authors of this game had some kind of freaky obsession with the PlaymakerFSM library and with giving things names like "THE BIG RESET".

Having managed to take a look at some of the code, the RNG appears to be quite a lot not-random. There's a lot of calls to some kind of internal Finite State Machine and constantly shifting probability lists. The deck appears to actually be resorted each time you draft a room (although previously drafted rooms are not added back in)

Yea, it's a bugger to work through because it's il2cpp and so everything is split in half and there's a bunch of code marshalling between the two. There seems to be something called "publisher mode" which gives you free keys and gems and lets you rotate rooms for the entire game, but I couldn't see how it's enabled.

It honestly isn't. The sneaky bugger we're interested in is called "RoomDraftHelper". It has some debugging messages left over in it, which are:

"Indicates how many cards needs to be left in the stack, before starting to offer the next rarity tier. (Free rooms)" "Indicates how many cards needs to be left in the stack, before starting to offer the next rarity tier. (Gem rooms)" "If set to true, it will invert the final dead end check, only offering 3 dead ends." "Define the chance of a particular rarity of rooms being ignored for the next door's draft, if they were in the last draft round."

I have managed to extract part of the FSM but it's very hard to read and massive. It does give a strong suspicion that the game knows when you have no gems and draws gem rooms just to piss you off.

Some more code messing. There's an incredibly suspicious object called Luck Calculator.

What's more interesting is that there's a whole bunch of lists of edge rooms in many more categories than you'd think. I don't know what the names mean, though. Here:

EDGE CREEP EAST: Utility Closet, Coat check, Boudoir, East Wing Hall, Pantry.
EDGE CREEP WEST: Utility Closet, Coat check, Boudoir, West Wing Hall, Pantry.
EDGE CREEP RARE: Furnance, Mail Room, Gymnasium, Study, Workshop, Gallery, Conference Room, Bunk Room, Maid’s Chamber, Library, Closed Exhibit.
EDGE CREEP RARE G: Laundry Room, Freezer, Drafting STudio, Foyer, Ballroom, Locksmith, Servant’s Quarters, Walk-In Closet, Vault, Showroom, Attic, Trophy Room, Music Room.
EDGE ADVANCE WEST G: Veranda, Aquarium, Secret Passage, Nursery, Garage, Kitchen, Courtyard, Patio, Rumpus Room, Laboratory, Pool.
EDGE RETREAT WEST G: Boiler Room, Laboratory, The Pool, Nursery, Office, Kitchen, Courtyard, Greenhouse, Veranda, Rumpus Room, Aquarium, Secret Passage, Her Ladyship’s Chamber.
EDGE ADVANCE EAST G: Boiler Room, Secret Passage, The Pool, Nursery, Greenhouse, Kitchen, Courtyard, Veranda, Office, Rumpus Room, Aquarium, Laboratory, Master Bedroom.
EDGE RETREAT EAST G: Veranda, The Pool, Secret Passage, Nursery, Patio, Kitchen, Courtyard, Office, Rumpus Room, Aquarium, Laboratory, Master Bedroom.
EDGE PIERCE EAST: Terrace, Library, Coat Check, Boudoir, East Wing Hall, Pantry, Utility Closet, Bunk Room, Master Bedroom, Dovecote.
EDGE PIERCE WEST: Terrace, Library, Coat Check, Boudoir, Pantry, West Wing Hall, Utility CLoset, Bunk Room, Dovecote.
EDGE PIERCE G: Patio, Walk In Closet, Nursery, Office, Kitchen, Courtyard, Aquarium, Laboratory, The Pool.
EDGE PIERCE RARE: Furnace, Mail Room, Wine Cellar, Study, Gymnasium, Maid’s Chamber, Conference Room, Closed Exhibit.
EDGE PIERCE RARE G: Vault, Locksmith, Freezer, Attic, Music Room, Trophy Room, Servant’s Quarters, Laundry Room.

After West Gate: I noticed that the Shelter activated on the Lavatory when I drafted it. Does the Lavatory actually have any negative effects other than being a dead end that doesn't have any other bonus?

Rare Draft: Is there any actual point to the Chamber of Mirrors apart from screwing you by adding all your throwaways back into the deck? I got to the central button and it took me to an upside-down version where I couldn't do anything.

Parlor: Some of the puzzles seem to be awkwardly designed and have short circuits. For example, I just got "One of the other statements is false." "One of the other boxes contains gems." "If you replace ONE in the other statements with BOTH they would both be false." I didn't bother working out the knights and knaves, I just opened the second box straight away because it being false is the only statement that could place the gems in a single box.

A non-exhaustive thing from reverse engineering: The probability distribution of rooms changes on weeks 2 and 3.

Trainers

There is a lot of content but the game is pretty much unplayable as is. I use this trainer for unlimited dice and 2.5-5x speed:

It doesn't allow setting values to 0, but I got the Key of Aries by spending all resources. Note that ending the day in "Coat Check" (or any room) with "Blessing of the Monk" removes the room from the inner rooms RNG pool for the next day.