News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

GirlpackDb for 0.3

Started by Ch12, Aug 06, 2023, 07:24 AM

Previous topic - Next topic

Ch12Topic starter

Hi,

I have implemented a Proof-of-Concept for the integration of the Girlpack Database into Brothel King (the game itself).


How it works:
Basically, it parses the Girlpack Database (as a CSV file) and then tries to match girlpacks based on name, _BK.ini information and imagecount.
Then it enriches init_dict (even for girls without BK.ini) with new information.
At the moment, I'm adding the creator, together with a confidence indicator. On top of that, Girlsource and Franchise get saved to description.
In the screenshot above, you can see that it correctly recognized Leortha's Utena pack. Recognition rate is pretty good, more than 90%. (However, I have not yet checked for false positives.)

Install Instructions:
1. Get the BK 0.3 beta
2. Install the 2023-08-06 patch (Download here if Goldo's released a new patch already)
3. Install the POC (Download from MEGA, unzip to the /game directory)

Implementation Details:
  • The heavy lifting is done by the new file BKgirlpackdb.rpy. It does the parsing, matching, as well as enriching the init_dict.
    There are 4 confidence levels right now: "maybe", "probably", "likely" and implicitly "certainly" (adds nothing in the last case)
  • I've also adapted GirlFilesDict, so that the _BK.ini files get parsed/enriched only once during the startup phase of the game.
    This was necessary because the read_init_file implementation was kinda messy. The old code was basically parsing the INI file multiple times, especially in BKevents.
    GirlFilesDict.get_ini(girlpack) has been replaced by the new function GirlFilesDict.get_init_dict(girlpack), which hands back a copy of the already parsed dictionary.
  • The Girl class has been adapted to work with the new system.
    self.ini now is a boolean, reflecting if there really is a physical BK.ini file.
    The same information is also available in the new init_dict["girlpack_has_ini"] entry.
  • BKfunctions and BKevents were also updated to work with the new mechanism.
    Mainly the two functions read_init_file_generate_as() and read_init_file_field()
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

Ch12Topic starter

#1
@Goldo I have set up a local GIT, so I should be able to integrate it into a potential new patch quite easily. (In case your codebase is already different from your last patch)
I hope this makes it into the real game, I think it's kinda cool.

There's still a number of things that can be improved, I guess. At the moment, I mostly overwrite existing sections in the init_dict, because it integrates with the rest of the game straight away. You could just as easily put the enriched information into a separate section in init_dict, though. Depends on if/how you want to use it.
There's also more information available, I am not using the information (Drawn/Real Girl), Comments, Art Style, and Warning Tags. (Data is already available in renpy.)
Some other columns like Timestamp might also be interesting, but these are not being imported (yet). Should be real easy to parse a few more columns, though.


I recommend integrating the init_dict changes in any case. I think the new code is smoother and also offers more performance.
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

neronero

Running into this error. At first I thought I must've done something wrong with the patching, but I got the same traceback after re-downloading base 0.3 + the patches in this thread:

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/BKgirlclass.rpy", line 5853, in script
    init +2 python:
  File "game/BKgirlclass.rpy", line 5854, in <module>
    GirlFilesDict.enrich_init_dict()
  File "game/BKgirlclass.rpy", line 5577, in enrich_init_dict
    GirlFilesDict.__get().__enrich_init_dict()
  File "game/BKgirlclass.rpy", line 5588, in _m1_BKgirlclass__enrich_init_dict
    init_dict = read_init_file(file, search_for = None, skip_checks = False)
  File "game/BKfunctions.rpy", line 3543, in read_init_file
    if trait not in trait_dict.keys():
NameError: name 'trait_dict' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/BKgirlclass.rpy", line 5853, in script
    init +2 python:
  File "F:\ilx\BK03T20230805\renpy\ast.py", line 1138, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "F:\ilx\BK03T20230805\renpy\python.py", line 1122, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/BKgirlclass.rpy", line 5854, in <module>
    GirlFilesDict.enrich_init_dict()
  File "game/BKgirlclass.rpy", line 5577, in enrich_init_dict
    GirlFilesDict.__get().__enrich_init_dict()
  File "game/BKgirlclass.rpy", line 5588, in _m1_BKgirlclass__enrich_init_dict
    init_dict = read_init_file(file, search_for = None, skip_checks = False)
  File "game/BKfunctions.rpy", line 3543, in read_init_file
    if trait not in trait_dict.keys():
NameError: name 'trait_dict' is not defined

Windows-10-10.0.19045 AMD64
Ren'Py 8.1.1.23060707
Brothel King 0.3t v230805
Sun Aug  6 15:10:23 2023
My Girl Packs: [ link ] - Trait King mod: [ link ]

Ch12Topic starter

I hope I have a quick fix for this, although I'm not sure if it is really the proper way to go about this in the long run.
Anyway, if you open BKtraits.rpy, ´line 15 should look like this:
    python:

Please add "init " in front, so that it looks like this:
    init python:

Does it work if you do that?
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

neronero

#4
Yep, works like a charm now!

The tech clearly works. The usefulness as-is is still a bit limited but I see two clear applications, both still requiring some work to pull off:

1) Enhance the Girl Mix screen further so that making new Girl Mixes becomes a better experience
- Add little icons for "warning" tags like loli and furry
- Make the filter field work on more than just the names
- Sorting by certain data?
Downside: Ultimately the spreadsheet will offer a better user experience than a spreadsheet-imitation recreated within renpy (but you can't make a girlmix there)

2) Create a "Download More Girl Packs"-screen, to onboard new players who only downloaded the game
- Ship the game with a list of girlpacks/download links, automatically open a "download"-screen with a list of options + download buttons if someone starts the game with not enough content in /girls/ (download buttons = opening a url in the default browser)
Downside: Too many packs to choose from, not sure how you pick which ones to highlight as "suggested downloads"
My Girl Packs: [ link ] - Trait King mod: [ link ]

Goldo

Thanks, it looks like a great addition!

Some updates to the girl mix screen are definitely possible if you guys can agree on what they should be (and provide me with icons cause I ain't going to search for loli and furry pics myself ;) ).

As for sorting/filters, I think a generic search bar such as the one for the night log would work better, then you can type a girl's name, a series' name, a creator or a tag or whatever without adding a dozen new buttons.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

Ch12Topic starter

#6
Update:
  • Updated the bugfix, it is now stable and works with the original BKtraits.rpy
  • Merged Goldo's newest patch into my branch
  • Updated the Initial Thread Post accordingly

If you're still on the old GirlpackDb, you can just install Goldo's newest patch and then the new GirlpackDb. (Download can be found in the Initial Post)

I'll now start to play around a bit more, check for false positives and stuff like that. Will probably take some time, I hope to have some news this weekend.
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

Ch12Topic starter

#7
Regarding ways to use this, I'd mostly like to leave this to you guys. I think showing the author and franchise could be interesting not only in the girl mix screen, but also in the slavemarket. E.g. you could add it to the tooltip that pops up when you hover over the girlpack quality.


On the technical side, my suggestion would be to add a new "virtual" section to the init_dict, call it e.g. "enriched" or "girlpackdb", kinda like :
"enriched/franchise" = "Fate"
"enriched/girltype" = "Drawn"

etc.

Please be aware that I create init_dicts even for girls that do not have a BK.ini. You can check a girl's self.has_ini attribute to check if there is a real BK.ini. This is important during girl creation, because girls without ini file have no "identity/first_name" and such, only enriched information.
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

Yasaki74

I think for managing Girl packs, you should make it view as tile where it fits horizontal and vertical, it's more easy to navigate, you did the same with the slave market so it make sense to do it right? since you make the screen 16:9