Archived Big Brother: Understanding mechanics (code thread) [v0.9.0.006]

5.00 star(s) 1 Vote
Status
Not open for further replies.

ikaruga

Well-Known Member
Modder
Respected User
Donor
Aug 11, 2016
1,191
2,499
...Just Downloaded dnSpy. Could you give me advice to do that? Please!
You need some skills in dev in c# or other compiled language
Then you need to REALLY understand what you're doing, as manipulting DLL can cause application crash

If you're okay with that, they're good tutorials in the youtube to understand how to
  • Decompile a DLL (search unity assembly dll)
  • Altering a method, a class
  • Save altered dll
Don't forget to backup !
 

Galin

Active Member
May 5, 2017
679
764
You need some skills in dev in c# or other compiled language
Then you need to REALLY understand what you're doing, as manipulting DLL can cause application crash

If you're okay with that, they're good tutorials in the youtube to understand how to
  • Decompile a DLL (search unity assembly dll)
  • Altering a method, a class
  • Save altered dll
Don't forget to backup !
I want to learn more about the Game-mechanic, I did not mention to alter the DLLs ;)
I did some C# 20 years ago or so, I think I can read it ;)
 

ikaruga

Well-Known Member
Modder
Respected User
Donor
Aug 11, 2016
1,191
2,499
Then just open the crack dll with DSN spy and go fetch :)
 
  • Like
Reactions: Galin

Finsit

Harder Better Faster Cheater
Game Developer
Jun 2, 2017
1,167
1,377
If someone is interested by a rawer approach.

Most variables are stored as "SP" composed of :
  • name
  • signed 4 byte min value
  • signed 4 byte max value
  • 4 byte P1 value
  • 4 byte P2 value
The variable itself is stored as P1 + P2
P1 value is random
P2 value is the variable value minus P1

Each time the variable is changed P1 get a new value too, making scan impossible without scanning for a custom type of variable.

My custom type for Cheat Engine :
You don't have permission to view the spoiler content. Log in or register now.
This custom type allow you to scan for values contained in SP class

It most of the global SP are in the V class wich contain an static array of Strings waiting to be parsed to SP e.g. :
You don't have permission to view the spoiler content. Log in or register now.
"skill.social_80_0_1000" creates a SP named skill.social of value 80 of minmum value of 0 and maximum of 1000

The SP associated with NPCs are init from an other place :
You don't have permission to view the spoiler content. Log in or register now.
All NPCs share the same layout and are init in that order :
  1. Lisa (liza)
  2. Alice (alisa)
  3. Ann (mom)
  4. Eric (eric)
  5. Kira (kira)
  6. Olivia (olivia)
  7. Kate (kate)

Using the complete list can helps you either finding the name of variable for a script approach or initial value and min max for a scan approach.

With Cheat Engine the SP while supposed to make it harder to cheat using memory scan it actually helps us to find the right values.

First, it adds P1 and P2 so using the custom type filter many results.
Second, since it stores the min and max value you can use them for group scan.

The last nail in the coffin of SP is that they are all stored in a array.
Since SP is a class the array is an array of pointers to SP data structures, and knowing the order of variable you can just pick the variable you are interested in easily.

A side note that Unity is quite deeply monothreaded, it takes tears and blood to make it works multithreaded, so the "massage" skill will always be after the "social" skill.


I'll also upload my cheat table for the current version as an example.
 

Finsit

Harder Better Faster Cheater
Game Developer
Jun 2, 2017
1,167
1,377
Since the 0.6.0.010 is out I'll post what should be the complete list SPs I collected. I guess script users will be able to use it.

The first number is the id, the second is the address offset from pointer G.sp
You don't have permission to view the spoiler content. Log in or register now.

I'll update this post to add the cheat table when ready (and with new scipts)

Edit:
I added my cheat table, it should be pretty rugged against updates now, it will work until the SP system is changed.

You can easily manipulate any SP since every one of them is now a symbol.

The symbol :
Code:
G.sp.whatever
Will point to to the SP named "whatever".
Then you can acess each component ofd the SP by adding :
  • .name (unicode string)
  • .min (4 byte)
  • .max (4 byte)
  • .value (P1+P2 Value)
  • .p1 (4 byte)
  • .p2 (4 byte)
For example if you want the number of kisses with kira the SP name being "count.kira.kisses"
You can add the address "G.sp.count.kira.kisses.value" in the table with the type P1+P2 and you will directly have the value.

And if you are not sure of the min or max value of one SP you easily copy the entry and swap the last part to min or max and the type to 4 byte.
 
Last edited:

ikaruga

Well-Known Member
Modder
Respected User
Donor
Aug 11, 2016
1,191
2,499
Hello @Finsit
I think you may create your own thread as it does not belong right here, and cheat engine table need some explanation and guide to use them.

You opened a whole new way to edit / mod the game, and i think you may need to have your own thread about it !
 

Finsit

Harder Better Faster Cheater
Game Developer
Jun 2, 2017
1,167
1,377
As I understand the need for a proper space about my tool, I'll just point my posts just tend to inflate over time. And the list was the only thing new I had apart from my table. So since a list is pretty self explanatory it didn't get nearly as much space as the edit on the final post.

So yeah, don't worry I'll make a thread for my table, but I tend to procrastinate (and hate being OP).
 

704621168

Member
Apr 5, 2017
142
222
ok So I will post at the correct place this time


I'm just starting to create my own mod for this game and I think I'm sort of figuring things out. But I'm wondering if I can get some help from some experienced modders about the following

1. Editing Existing Dialogues
Thanks to ikaruga, we now have access to dia6.txt, which I suppose contains all the dialogues.



2. Showing Variables
I have tried to get variables to show in the left side text multiple times, but it seems like only the first variable will show up. Everything including and after the second variable will be cut off.
This is what I've done
Untitled.jpg
 

Finsit

Harder Better Faster Cheater
Game Developer
Jun 2, 2017
1,167
1,377
You can set debug to 1 to display most of the variables, if you main purpose is to obtain the values.
 

Finsit

Harder Better Faster Cheater
Game Developer
Jun 2, 2017
1,167
1,377
Debug is a SP like others, so you can set it the same way you set other SP.
You just need to set it to 1.

Look at the list of SP I posted if you don't know what is a SP and what is not.
 

DamnVamMan

Member
Mar 14, 2017
302
362
So this didn't go as expected...
FYI this went from a tutorial to a plea for help lol

Couldn't determine on a universal themed Big Brother thread so I guess I'll post this in all the modding threads so long as I get some positive feedback on the manner.. don't know who has thought of this or knew about this..

If the pros know this, then I provide for the noobs.

After I figured out how damn easy it was to produce any sequence of images so long as you had identified the dialog that belonged said sequence (thanks modders) the next step for me was to further the simplification process of going about all this.


Naturally, the first task to simplify this process would be to disable word wrap.
Before:

After:


The next thing to do is put all the sequences in a partial order. Not 100 percent order as there is no such thing within this game, but rather a more sensible order in that sequences follow each other and they do it in a way that follows the events of that chapter (or version). What I mean by this is DS currently is prefacing the scene identifier [ 05.aboutvic.0 ] with the number that corresponds to that version. In the example I used it is obviously 05. He hasn't been consistent in his scene identifier naming scheme, but it would appear that he is going to stick with the number prefix.

Using the TextFX plugin or features of Notepad++ (Pretty sure it comes stock with n++ as it doesn't exist within the plugins menu with all the other plugins; but still easy if I was wrong as there is a plugin manager that auto gets) we can use the ordering feature.

  1. First, CTRL + A to select all (mind you that when we start the sort this will take a while as there are tons of lines of text, so even if n++ appears to be not reponding just wait. Think it took me a min or two but I have i7)
  2. Go to TextFX -> TextFX Tools -> Sort lines as case insensitive (at columns)
dia.txt should now look like this:


The last thing that we can do is remove all the Russian text that only creates noise (IMO). We can achieve this with the awesome gift of the coding gods, RegEx, or regular expressions.

Now IDK the difference between Java RegEx, HTML5 RegEx or C# Regex, but I do know how to make regex work in n++ which I believe is a partial RegEx engine.

Bare with me..
  • (\^(.*?)\|)
After doing this writeup I realized I had my other one wrong. Now I ask for some help if we have RegEx ninjas in here by any chance. Only I would go from thinking I was helping to asking for help lol. At least I'm honest about it and don't change the nature of the message.

Here is the problem with my other RegEx:
  • (@(.*?)\|)
05.aft2kir.7@100@

We need the first @, the one followed by #'s (100 in this case) to be ignored and start at the second

Since the scene identifier has two ampersands ' @ ', the RegEx finds the first and ignores the second as it reads all characters between ' @ ' and ' | '. Now from research, it appears that there is no way to tell RegEx to skip first occurrence of a match, ' @ ' in this case, and have it start at the second, the one we need it to stop at. I could have got this wrong thought, the idea that we can't do this.

If this is the case, unless you tell me otherwise, it seems we can use IF statement to say:

We want the ampersand that is followed by characters and not numbers; i.e. IF #'s follow @ ignore, if anything that is NOT numbers (I go this route because it seems to be easier than the inclusion of the RU Unicode character set) follows @ START.

I know stack exchange is more ideal for this, but I will not go there as I have no attempted equation as I am a RegEx noob, not a Ninja.

Here is how the text looks with the one grouping removed:


Well shit, I guess it still looks better no word wrap and sorted alpha... FML​
 

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,440
6,847
@divneProportions - FYI, I've written code that automates this process. I uploaded an "ordered" version of the dialog files in a thread, which got merged into one of the "mod" threads as being the better place for it.
 

Derover

Member
Modder
Nov 11, 2016
157
265
Is there a way to add a new location option to the game?
By this I mean an extra circle.

For example, If you're in the kitchen, there is an option to go to the hallway or the cellar.
 

Deleted member 216358

Well-Known Member
Modder
Donor
Game Developer
Sep 24, 2017
1,316
3,128
set_alisa.pun_1!set_alisa.punreason_6^ I want Alice punished !
set_liza.pun_1!set_liza.punreason_2^ I want Lisa punished !

In your example, it doesn't include the option to allow max to do the punishment instead of mom. How would this code be modified to accommodate that?
 
Aug 22, 2017
23
6
Been wondering this for a while: In save files, what is the variable name which determines whether Alice wears panties?
 
Status
Not open for further replies.
5.00 star(s) 1 Vote