HentHighSchool Development Forum

Game Development => Brothel King => Topic started by: Ch12 on Aug 06, 2023, 07:24 AM

Title: GirlpackDb for 0.3
Post by: Ch12 on Aug 06, 2023, 07:24 AM
Hi,

I have implemented a Proof-of-Concept for the integration of the Girlpack Database into Brothel King (the game itself).
(https://i.postimg.cc/435tsQV6/Screenshot.webp)

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 (https://mega.nz/file/teMilZqY#IVU5Gbm7FvlND9suVO0GxGSbz2kVjAMcIV3u3JpwKhc) if Goldo's released a new patch already)
3. Install the POC (Download from MEGA (https://mega.nz/file/xOlxURqS#KQRQhtjByiPiRRRuMxic_eZ_NFL8RIMUfOQk7Z02hEk), unzip to the /game directory)

Implementation Details:
Title: Re: GirlpackDb for 0.3
Post by: Ch12 on Aug 06, 2023, 08:16 AM
@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.
Title: Re: GirlpackDb for 0.3
Post by: neronero on Aug 06, 2023, 01:20 PM
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
Title: Re: GirlpackDb for 0.3
Post by: Ch12 on Aug 06, 2023, 08:28 PM
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?
Title: Re: GirlpackDb for 0.3
Post by: neronero on Aug 06, 2023, 09:28 PM
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"
Title: Re: GirlpackDb for 0.3
Post by: Goldo on Aug 06, 2023, 10:18 PM
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.
Title: Re: GirlpackDb for 0.3
Post by: Ch12 on Aug 08, 2023, 04:37 AM
Update:

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.
Title: Re: GirlpackDb for 0.3
Post by: Ch12 on Aug 08, 2023, 04:49 AM
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.
Title: Re: GirlpackDb for 0.3
Post by: Yasaki74 on Aug 22, 2023, 06:58 PM
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