News:

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

Former www.henthighschool.com

[Feedback] *BUG REPORTS* Stable version only (v0.2)

Started by Goldo, May 13, 2022, 09:52 AM

Previous topic - Next topic

Ch12

#45
I gave DougTheC's suggestion a try. Basically, you're better off completely removing the prediction, because it's left completely broken. (As noted in the source code comment)
How to check:
  • Apply DougTheC's changes. Start the game.
  • On the home screen, press F4. This shows the image debug panel.
  • In the Cheat Menu (? in the upper right corner), select "Repair images". This resets all images for all girls.
  • Enter the girls screen. As you switch from one girl to the next, you will see a red cross, together with the girl's profile image name. This indicates that the image was loaded just now.
  • Quit the game. Apply the latest patch, reverting DougTheC's changes. Start the game.
  • Repeat the above procedure. Upon switching between girls, no red cross is shown for profile images. Instead, the images are loaded in the background upon entering the girls screen.

Personally, I doubt that this part is related to Justinof's problem. The function works on a separate thread, so it doesn't block the UI thread and hence should not be responsible for lags.

To be completely safe, you can slightly modify the function like this (BKfunctions.rpy), adding a check for renpy.predicting():
    # Threading is necessary, because otherwise the screen only shows AFTER ALL images have been loaded.
    # That would actually make things slower. With threading, the images load in the background as intended.
    # This function seems to work only if called from BKscreens. Probably got something to do with interactions. Maybe I'm just misunderstanding, though.
    def predict_images(girls, predict_portraits = True, predict_profiles = True):
        if renpy.predicting(): return
        def predict_images_helper():
            try:
                # Predict all portraits first since they are needed immediately.
                if predict_portraits:
                    for girl in girls:
                        if girl.portrait is not None : renpy.predict(girl.portrait.get(side=True))

                # After that, begin loading the profile images
                if predict_profiles:
                    for girl in girls:
                        if girl.profile is not None : renpy.predict(girl.profile.get(profile=True))
            except: pass
        if girls is not None and len(girls) > 0:
            t = threading.Thread(target=predict_images_helper)
            t.daemon = True
            t.start()

I assume that the randomness of the lags adds some random fluctuations. IF this part is responsible, (though I don't see how) I would rather recommend an option in the game settings to allow turning it off. On my rather old laptop, image prediction is still noticably improving performance, so I would definitely miss it.
I think that at least with the improved function, this will not be necessary.

Anyway, thanks for the detailed description, Justinof. The reason I asked is because the release version of 0.2 caused me problems just like yours, but they should be fixed with the latest patch.
I wracked my brain, what else might be responsible for your weird lags. One more thing I would like to check is your pack rating setting.

If you go to the game settings, somehwere down the bottom you should find "Display pack rating on girl profiles". Does it help if you set this to OFF? (You said that it's on city/slavemarket) This used to be one of the worst troublemakers. I improved the performance quite a while ago, but it can still take seconds for even just a single girl. (Mostly depending on image count of the girl pack)

If that does not help, the last idea I have is comparing performance with an older version. Here's a patch of 0.2 from November 2021.
Before applying it, please create a backup of all RPY files in your game directory!

Then apply the patch and retry. The game may complain a bit, but you should be able to load a savegame. If not, please start a new game. (If you skip the prologue, you can start directly in e.g. chapter 3 with 50k gold if you want to quickly be able to buy a few girls. (-> Extras))

Do the weird lags stop with the old version?

FInally, you mentioned this: "I know i am pushing the game to the limits, but i am wondering why it can't make use of a powerful gpu to handle the images more efficiently."
It feels like I am missing something. What exactly do you mean?
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

Justinof

Quote from: Ch12 on Jun 16, 2022, 05:03 AMI gave DougTheC's suggestion a try. Basically, you're better off completely removing the prediction, because it's left completely broken. (As noted in the source code comment)
How to check:
......
I have followed your istructions, and the behaviour is exactly as you described.
So what should i do now? Remove the changes suggested by DougTheC? Keep them?

Quote from: Ch12 on Jun 16, 2022, 05:03 AMPersonally, I doubt that this part is related to Justinof's problem. The function works on a separate thread, so it doesn't block the UI thread and hence should not be responsible for lags.

To be completely safe, you can slightly modify the function like this (BKfunctions.rpy), adding a check for renpy.predicting():
....
I have the same doubts. I have added the check and resetted this line to default value in BKsettings.rpy:
refresh_memory_on_home_screen = FalseThe access to girls screen is faster this way, and whit:
config.image_cache_size = 2048 i have enough memory to allocate the textures.

Quote from: Ch12 on Jun 16, 2022, 05:03 AMI assume that the randomness of the lags adds some random fluctuations. IF this part is responsible, (though I don't see how) I would rather recommend an option in the game settings to allow turning it off. On my rather old laptop, image prediction is still noticably improving performance, so I would definitely miss it.
I think that at least with the improved function, this will not be necessary.

About this, i have noticed this behaviour: upon entering the girls screen the 1st time, i start to select one girl after another to make changes as assign points etc.; the latency start to shows after the first 20 girls or so, not immediately, and remain there whit some fluctuations even during the successive accesses to the screen.

Quote from: Ch12 on Jun 16, 2022, 05:03 AMIf you go to the game settings, somehwere down the bottom you should find "Display pack rating on girl profiles". Does it help if you set this to OFF? (You said that it's on city/slavemarket)
Setting it to OFF doesn't give any performance improvement.

Quote from: Ch12 on Jun 16, 2022, 05:03 AMIf that does not help, the last idea I have is comparing performance with an older version. Here's a patch of 0.2 from November 2021.
.....

Do the weird lags stop with the old version?
Unfortunately i can't answer for this.
I have installed a new copy of v. 0.2 and applied the November's patch over in another disk, then copied saves, girl packs and mods.
At start the game throw me exception errors one after another, impossible to reach the main menu....

Quote from: Ch12 on Jun 16, 2022, 05:03 AMFInally, you mentioned this: "I know i am pushing the game to the limits, but i am wondering why it can't make use of a powerful gpu to handle the images more efficiently."
It feels like I am missing something. What exactly do you mean?

What i mean is that the game is almost Cpu dependent only, using a modern Gpu doesn't give any advantage. I could say that the performance difference between an integrated Gpu (old gen.) and a RTX 3060 Ti is negligible  :o

DougTheC

Quote from: Justinof on Jun 17, 2022, 03:12 PM
Quote from: Ch12 on Jun 16, 2022, 05:03 AMI gave DougTheC's suggestion a try. Basically, you're better off completely removing the prediction, because it's left completely broken. (As noted in the source code comment)
How to check:
......
I have followed your istructions, and the behaviour is exactly as you described.
So what should i do now? Remove the changes suggested by DougTheC? Keep them?

Quote from: Ch12 on Jun 16, 2022, 05:03 AMPersonally, I doubt that this part is related to Justinof's problem. The function works on a separate thread, so it doesn't block the UI thread and hence should not be responsible for lags.

To be completely safe, you can slightly modify the function like this (BKfunctions.rpy), adding a check for renpy.predicting():
....
I have the same doubts. I have added the check and resetted this line to default value in BKsettings.rpy:
refresh_memory_on_home_screen = FalseThe access to girls screen is faster this way, and whit:
config.image_cache_size = 2048 i have enough memory to allocate the textures.

My suggestion was not to avoid calling image-prediction during screen-prediction itself, though it would accomplish that if it worked, but to run the image-prediction before calling the girls screen, & avoid doing it upon every pass of the girls loop.

I'll work on the image-prediction helper function to try getting it functioning properly no matter where it is called from.

Quote from: Justinof on Jun 17, 2022, 03:12 PM
Quote from: Ch12 on Jun 16, 2022, 05:03 AMIf that does not help, the last idea I have is comparing performance with an older version. Here's a patch of 0.2 from November 2021.
.....

Do the weird lags stop with the old version?
Unfortunately i can't answer for this.
I have installed a new copy of v. 0.2 and applied the November's patch over in another disk, then copied saves, girl packs and mods.
At start the game throw me exception errors one after another, impossible to reach the main menu....

Predictable, bad results trying to install Beta patch on Release base code. Sorry you had to go to the trouble...
I predict that May 5, 2022, the US Dow Jones index will drop over 1,063 points.
It's a sure thing.

If we believe absurdities we shall commit atrocities. -- Voltaire
-
Advice from the radio: Wash your hands, often with soap and water.
-
My doctor put me on the Pro Plan® Bright Mind™ diet.

neronero

- In the main menu, the link to the forum says "henthighschool.com" instead of .net (it does hyperlink to the right place)

- The shortened patch link in Goldo's signature on this forum has expired or otherwise been hijacked by someone. Now links to some game on steam.
My Girl Packs: [ link ] - Trait King mod: [ link ]

vadi92

#49
The link for the patch are still working though as i can acces it. Dont know what caused that it changed in Goldo sig.
Edit: This only happen's here the sig in the F95 forum still hyperlink you to the patch.

Ch12

#50
Hey guys, sorry for the late reply, didn't get to answer sooner.

Quote from: DougTheC on Jun 17, 2022, 03:50 PMMy suggestion was not to avoid calling image-prediction during screen-prediction itself, though it would accomplish that if it worked, but to run the image-prediction before calling the girls screen, & avoid doing it upon every pass of the girls loop.

I'll work on the image-prediction helper function to try getting it functioning properly no matter where it is called from.

IF you can make it work being called from the code, please do let me know how. But I thought I should let you know that I already wasted quite some time on this and ultimately failed to make it work in another way.

Renpy internally works exactly the same way, doing a new prediction with every interaction. (E.g. it automatically does so for all images on the screen, background, portraits, etc.) IF an image is already in the cache, it doesn't create an additional load on the game.

Since all your working girl's portraits are already getting predicted every interaction (since they're shown on the screen), having all profiles predicted as well should not make any real difference.

Anyway, I already added the code that makes sure that prediction happens only once during the interaction. I think you would have to go deep down the rabbit hole for anything more.


Quote from: Justinof on Jun 17, 2022, 03:12 PM
Quote from: Ch12 on Jun 16, 2022, 05:03 AMI gave DougTheC's suggestion a try. Basically, you're better off completely removing the prediction, because it's left completely broken. (As noted in the source code comment)
How to check:
......
I have followed your istructions, and the behaviour is exactly as you described.
So what should i do now? Remove the changes suggested by DougTheC? Keep them?

Basically, whatever you prefer. My concern was more about DougTheC suggesting that Goldo applies his changes to game's source code. If you want to enable/disable my function real quick, you can go to BKfunctions.rpy and change the function like this:

    def predict_images(girls, predict_portraits = True, predict_profiles = True):
        # return
        if renpy.predicting(): return
        def predict_images_helper():
        (...)

If you remove the # from the return in the first line, you will basically disable the function. (Since it just returns immediately) If you add the # comment back in, you'll enable it again. Keep in mind that you still have to restart the game, but at least the editing part is real simple, only removing / adding a single #.

Edit: This is if you want to test this more extensively. Personally, I still think this was an educated guess by DougTheC that's most likely not the issue.

Quote from: Justinof on Jun 17, 2022, 03:12 PMI have installed a new copy of v. 0.2 and applied the November's patch over in another disk, then copied saves, girl packs and mods.
At start the game throw me exception errors one after another, impossible to reach the main menu....

For me, it runs simply by installing - is what I wanted to say, and then my game crashed just now. I had installed a new girlpack, which had an events.rpy file that relied on the new get_current_folder() function.

Still, after deleting it, the game started again for me. If you have already created a complete copy of the game, please try this: Go to your game/girls directory, search for "*.rpy*" and delete all those files. Also, go to your game/Mods folder, and do the same.

My "patch" contains ALL .rpy files from that point in time, not just altered files. (Those in the game directory, anyway.) So the game should definitely boot. All you have to do is get rid of any external dependencies. The traceback also gives you hints about the exact files. (E.g. my error was like this: "File "game/girls/#various/Boa Hancock/_events.rpy", line 10, in <module>" - so I knew an events.rpy file was the cause)

Ultimately, this will NOT fix your problem, only help us a bit trying to find the exact cause. IF my suggestion does not make it work for some reason, do not waste too much time and please let me know about the exact trouble.


Epiphany: Could you try removing all MODS and events.rpy files from girls in an up to date BK installation? It is possible that some custom code is creating the problems.


Quote from: Justinof on Jun 17, 2022, 03:12 PM
Quote from: Ch12 on Jun 16, 2022, 05:03 AMFInally, you mentioned this: "I know i am pushing the game to the limits, but i am wondering why it can't make use of a powerful gpu to handle the images more efficiently."
It feels like I am missing something. What exactly do you mean?

What i mean is that the game is almost Cpu dependent only, using a modern Gpu doesn't give any advantage. I could say that the performance difference between an integrated Gpu (old gen.) and a RTX 3060 Ti is negligible  :o

What I meant was the first part of your statement - "I know I am pushing the game to the limits". That's the part I don't get. I reread your old posts, but I still feel like something I'm missing something. Your comment about the problems starting after the first 20 girls feels like it is a hint, also that increasing the cache size helped. Is this about performance problems when owning as many girls as possible?

Random bit of info: I remember Jman having problems in the items screen when owning a lot of items in the past. I do not remember how much "a lot" was exactly. though. I also don't know if/how it was resolved.

Anyway, you are correct that the GPU is usually quite bored when playing BK. It's not like there's any complicated 3D calculations or anything. Except for a few parts in the story segments, there's not a lot of animations or image transformations, either.
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

GoldoTopic starter

#51
Quote from: neronero on Jun 18, 2022, 05:49 PM- The shortened patch link in Goldo's signature on this forum has expired or otherwise been hijacked by someone. Now links to some game on steam.


Damn, can't even trust a link shortener these days... Hopefully this one will work (the limitation on signature length makes it impossible to include two full paths...).

Quote from: Justinof on Jun 17, 2022, 03:12 PMI have followed your istructions, and the behaviour is exactly as you described.
So what should i do now? Remove the changes suggested by DougTheC? Keep them?

I have the same doubts. I have added the check and resetted this line to default value in BKsettings.rpy:
refresh_memory_on_home_screen = FalseThe access to girls screen is faster this way, and whit:
config.image_cache_size = 2048 i have enough memory to allocate the textures.

About this, i have noticed this behaviour: upon entering the girls screen the 1st time, i start to select one girl after another to make changes as assign points etc.; the latency start to shows after the first 20 girls or so, not immediately, and remain there whit some fluctuations even during the successive accesses to the screen. 

As regards the performance problem, I did have some lag but not a lot when loading your save, and removing prediction from both BKscreens.rpy and BKscreen_home.rpy did seem to improve things slightly (but it could simply be because the pictures were cached at that point).

I did not, however, test the game further such as having 20 interactions and so on, so maybe I missed the problem that arises from continuing the saved game.

Also, I do not have as many girl packs so I used console commands to replace the girls' pictures with packs I had. If some of the packs are unusually large or the sheer number of packs is the source of the problem, I may again have missed it.

I will be able to do more testing on the first point. On the second one, though, not sure how to proceed unless you want to share your entire girls folder for download (which may not even be doable if it's super large)...

Quote from: DougTheC on Jun 14, 2022, 04:07 PM@Goldo, also can consider parts of girls_loop to be done only after flag was set from change affecting them::
  •         $ game.sort(MC.girls, context = "girls")
  •         $ girl_status_dict = load_girl_status(MC.girls) # Test to increase performance
  •         $ brothel.update_customer_count()

This is unlikely to cause problems as the loop only runs after each 'ui.interact()' (in most cases, a mouse click). Moving this elsewhere may cause bugs as we won't be sure every event that changes statuses, sorting order or customer count will be caught.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

Ch12

#52
Hm, so I like double-checked each post. No savegames attached... Did I still miss it? Is my account being blocked from downloading attachments?

Anyway, one more thing to rule out is image loading being part of the lags. Justinof, when the lags start, can you press F4 and tell us if images are being loaded in that moment (indicated by the profile picture of the girl being shown in red). On the other hand, if the image is already loaded, it's displayed either in green, or not at all.

(Note: I you see droplet / heart / skull in red, it's because the symbols needed to be rescaled, that's normal)
Download My High Quality Girlpacks
Belldandy, Urd, Kaenbyou Rin, Jessica Albert, Kino Makoto (Sailor Jupiter), Temari, Tohsaka Rin, Pyra, Lyndis, Atago, Zelda, Kasumi, Camilla

Leortha

Quote from: Ch12 on Jun 20, 2022, 07:19 PMHm, so I like double-checked each post. No savegames attached... Did I still miss it? Is my account being blocked from downloading attachments?

The max attachment size on this new site is set very small because storage space is very limited.   It's too small for save games.   We've figured out a good workaround for images for pack announcements (Imgur), but I have not seen anyone come up with a good reliable way to share save games under these conditions.
Mega link for all my Brothel King girl packs:

https://mega.nz/folder/Fcg2lBID#yKalC_e47WAS8jsbHPyOvQ

Mega link for my loli packs:

https://mega.nz/folder/BMwizTwD#89Lqk4Q2cFxFNVQEzTzXDg

Justinof

First thing: i am very grateful for all the efforts you guys are doing to solve my issue  :-*

Ch12, no mistery, the save game was posted in F95 forum, not here. This because i was asking Jman to help me about another problem whit mana points AND the issue we are talking about here.
Then, i believe, Jman has given the save to Goldo for a thorough check and for the fact that the size of the save was worringly big.

I did another try whit the Novenber's patch, this time i have made another copy of the game, deleted all the .rpyc files and applied the patch. Then removed Boa Hancock event.rpy and event.rpyc files (they were responsibles for the 3rd error at start in my first attempt). I had to delete all Mod files aswell (even Goldo's cool mod!) as resposibles of other errors.
Started the game (ok), loaded a save (no problem), in the girl screen all goes well....not really, after some interactions whit the girls the latency start to show her ugly head again,  >:(

In conclusion there isn't a performance difference between the November's patch and the current release. apart that in the former there are some bugs such as the perks tooltip that shows up when it shoulnd't and the girls' portraits that get loaded 2 times (although predicted) in the interaction screen.

I have even sold almost all the items i had to see if it improves the performance, whit no apparent gain. About this, the solution i believe was to introduce a limit of 30 items that get displayed in the left menu at once (i use a limit of 50).

About the "pushing the game to the limits"....maybe i was not enough clear before: i am playing  whit a number of girls in the brothel that is 5x the vanilla limit, but the latency i am experiencing was already present well before i did reach the 32 girls' limit.

That is why i am in conflict: "i am asking for the impossible due to my egoism or there is a issue that shoud be solved, so others will not have to go through this pain?"

GoldoTopic starter

I think it's always good to look at fringe cases: you are pushing the envelope, but it may help us diagnose a performance problem that is otherwise not very easy to identify and solve, so to me it's a very good exercise.

Unfortunately, my living conditions right now don't allow for a lot of privacy to test the game. But whenever I get the chance, I plan to look at your case in more detail.

One avenue of investigation is to simply disable some screens one by one until we find the source of the performance hit. Should be possible to at least narrow it down to one area of the girls screen.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

DougTheC

#56
Bro, you the Hokoman!

----
Miscelleaneous items, since ver 0.2 will be mostly wrapped soon:

* Why in BKsettings is this not using bro_cost[7] for consistency?
    chapter_goals = {
                    6 : [Goal("ranked", 4, 12), Goal("gold", 100000)],
change to:
    chapter_goals = {
                    6 : [Goal("ranked", 4, 12), Goal("gold", bro_cost[7])],

I'm looking at replacing all the word-processing apostrophes in BKdialogue.rpy with simple single-quote apostrophes.

While the fancier version may look a bit better in the sentences that include them, they interfere with searches:
("she's" not = "she's") and are different from non-community-dialog usage.

Thoughts?

----------------------

Typos as noticed:

Spoiler
BKchapter1.rpy
Change (line 1153)
  front of him"
to
  front of him."

Change (line 5042)
  homokan
to
  Hokoman

BKday_events.rpy
Change (line 6281)
  Homokan
to
  Hokoman

BKinit_variables.rpy
Change (line 1691)
  shaft run
to
  shaft runs

BKfunctions.rpy
Change (line 1083)
  loose
to
  lose

Change (line 1189,1194) add period
  str(damage)
to
  str(damage) + "."

Change (line 1361, 1365, 1369, 1373) Suggestion
Could add the translation __() to other diff descriptions,
            d = "Easy"
            d = "Medium"
            d = "Hard"
            d = "Very hard"


BKdialogue.rpy  (Community dialogue also fixed on Google spreadsheet)
Change (line 2893)
  {i}lso
to
  {i}so

Change (line 3465) Add g:
  "EHEHEHE! I can't
to
  "g: EHEHEHE! I can't

Change (line 5056) Add period; replace word-processor special apostrophe with single-quote to help search
  bitch's ... erm... lady's purse
to
  bitch's ... erm... lady's purse.

Change (line 5056) Add punctuation
  misunderstanding
to
  misunderstanding...

[close]
I predict that May 5, 2022, the US Dow Jones index will drop over 1,063 points.
It's a sure thing.

If we believe absurdities we shall commit atrocities. -- Voltaire
-
Advice from the radio: Wash your hands, often with soap and water.
-
My doctor put me on the Pro Plan® Bright Mind™ diet.

Justinof

Quote from: Ch12 on Jun 20, 2022, 07:19 PMAnyway, one more thing to rule out is image loading being part of the lags. Justinof, when the lags start, can you press F4 and tell us if images are being loaded in that moment (indicated by the profile picture of the girl being shown in red). On the other hand, if the image is already loaded, it's displayed either in green, or not at all.

(Note: I you see droplet / heart / skull in red, it's because the symbols needed to be rescaled, that's normal)
The first time i interact whit a girl (select her) the message says that portrait pic is green (predicted) but profile pic is red.
Any successive interation, after exiting and reentering the girls screen, shows only portrait pic in green.

I don't think that the image prediction is the culprit for the latency at this point, there are not messages when i click other buttons AND the lag is high in most cases.
About the config.image_cache_size, now i understand that even the vanilla value (128) is more than enough, i believed that this cache was there for the textures and images. I was wrong so forget about it.

The game is still playable, even whit the latency, so it's not a priority to solve this issue atm.





Justinof

#58
Typo that i have found:
Spoiler
BKfunctions.rpy line 2291 text1 = "{size=" + str(res_font(18)) + "}" + __("A customer ordered") + girl.name + __(" to give him extra service. He wanted her to ") + __(s_des[s_act]) + "."Missing space after "ordered "
[close]

In a couple of occasions this happened: when a city girl ask the MC if he knows what is that she likes to do, among the possible answers there isn't the correct one, so the failure is certain.
If i remember correctly, the right answer was "hiking" or "swimming", but i could be wrong. I will take note the next time this happens.

vadi92

Quote from: Justinof on Jun 23, 2022, 04:29 PMTypo that i have found:
Spoiler
BKfunctions.rpy line 2291 text1 = "{size=" + str(res_font(18)) + "}" + __("A customer ordered") + girl.name + __(" to give him extra service. He wanted her to ") + __(s_des[s_act]) + "."Missing space after "ordered "
[close]

In a couple of occasions this happened: when a city girl ask the MC if he knows what is that she likes to do, among the possible answers there isn't the correct one, so the failure is certain.
If i remember correctly, the right answer was "hiking" or "swimming", but i could be wrong. I will take note the next time this happens.

There are 2 possible answer for each girl. Sadly the girl only tells you 1 of her hobby.