Ren'Py Brothel King [v0.2] [Goldo]

4.60 star(s) 44 Votes

Kite80

Well-Known Member
Modder
May 30, 2017
1,025
1,014
King's way 2.0 should work fine for BK 0.15b, I have updated the OP of the thread about packs and mods, now including download and instructions of the mod
 

Oboe

Member
Nov 17, 2019
250
104
On the mods thread, I have a reconstruction of kite80's original trainer.

That said, I'm looking at the place where you change traits and thinking, old or new, that can be better.
Take the text apart, autocapitalize, put it back together, run it through the list of actual traits and error
on a typo. I recently typo'd on that and it forced a complete reboot of the game.

O-
 

Jman9

Engaged Member
Jul 17, 2019
2,293
954
MonkOne/Kite80's trainer 2.0 solves this by making a big-ass scrollable list of all traits, where you can toggle the individual ones at will. Superiour to a menu cheating-wise, I think.

Autocapitalise isn't so hot an idea, since someone might have a trait with an initial, but not middle capital, or vice versa. Better convert everything to a common format, like lowercase, and then compare the results. I implemented something along these lines for my Booty Headhunter, with some 'autocompletion' for certain inputs. Take a look, if you wish.
 

DougTheC

Member
Oct 15, 2018
386
218
On the mods thread, I have a reconstruction of kite80's original trainer.

That said, I'm looking at the place where you change traits and thinking, old or new, that can be better.
Take the text apart, autocapitalize, put it back together, run it through the list of actual traits and error
on a typo. I recently typo'd on that and it forced a complete reboot of the game.

O-
Autocapitalise isn't so hot an idea, since someone might have a trait with an initial, but not middle capital, or vice versa.
Checked, and sure that traits in Ver 0.2 and 0.15b are all only first letter capitalized. Any programming to take advantage of this to avoid error/crashes is welcome.
 
Last edited:

Jman9

Engaged Member
Jul 17, 2019
2,293
954
Checked, and sure that traits in Ver 0.2 and 0.15b are all only first letter capitalized.
Like I said:
someone might have a trait with an initial, but not middle capital
That someone is not necessarily Goldo. For example, _neronero's Trait King has a trait called 'Strong Gag Reflex', and at least intermediate versions of Bonanza also had mixed formats. Writing code that only fixes the immediate issue or assumes a given input format for no specific reason is never a good idea.
 

Oboe

Member
Nov 17, 2019
250
104
Like I said:

That someone is not necessarily Goldo. For example, _neronero's Trait King has a trait called 'Strong Gag Reflex', and at least intermediate versions of Bonanza also had mixed formats. Writing code that only fixes the immediate issue or assumes a given input format for no specific reason is never a good idea.
Traits are saved in a data structure named trait_dict. You can create a list of of the keys of this dict and compare text to text in a cap insensitive manner.

And then you can fix the capitalization, WhAtEveR iT Is, on a case by case basis.

This is NOT rocket science. A decent high school student could write this.

O-
 

Jman9

Engaged Member
Jul 17, 2019
2,293
954
Traits are saved in a data structure named trait_dict.
Which is not necessarily static. E.g. _neronero's Fran pack tried to play with adding dynamically created traits; and I had no end of trouble in Bonanza because I added a modified form of Trait King and regenerated the whole trait dictionary. So when you create these lists can matter, and a girl can perchance have traits outside of that list.

Edit: Also, 0.15b - which is still the main release - has some traits (Godless and the four you get for losing a girl's virginity) outside of that dictionary.

You can create a list of of the keys of this dict and compare text to text in a cap insensitive manner.
Which is exactly what I suggested earlier. :cautious:

No real need to create that list, either, because in the worst case it might get changed due to mods etc afterwards. And the performance increase is marginal. So you can just use trait_dict.keys() directly.

Note that Ren'Py still uses Python 2, where lowercase conversion is somewhat iffy if you have 'exotic' characters in your text, like Greek or ß.

And then you can fix the capitalization, WhAtEveR iT Is, on a case by case basis.
Uh, the whole point of this exercise is not to have to do that, right? :p


You could also put the whole thing into a try-catch block, so the game won't do a 'hard' crash on mistakes.

You're right that it's not rocket science, but there are several nuances here that can be solved now, instead of ignored and then reinvented by the unlucky souls who try the trainer on e.g. Trait King 0.2 if that ever comes out.
 
Last edited:
  • Like
Reactions: __neronero

Oboe

Member
Nov 17, 2019
250
104
You're right that it's not rocket science, but ..
I'd rather code than talk.

one implementation. Suitable for the init section of code derived from kite80's original trainer.


Code:
    def gSanitizeTrait(mytrait):
        matchcount = 0
        sanitized = ""
        tlen = len(mytrait)
        for key in trait_dict:
            kk = key
            kl = len(key)
            if kl > tlen:
                kk = kk[:tlen]
            if kk.casefold() == mytrait.casefold():
                matchcount += 1
                sanitized = key
        if matchcount > 1:
            sanitized = ""
        return sanitized
 
Last edited:

Jman9

Engaged Member
Jul 17, 2019
2,293
954
Python 2 does not have casefold(), at least not without extra work.

You might want to do a precise match as well and break the loop if it happens, right now you're iterating over the whole trait dictionary all of the time. Not that it matters all that much.

Otherwise, looks good.

Edit:
I'd rather code than talk.
Not that it's very important in hobby projects like these, but this kind of attitude is actually a pretty big problem in serious software development.
 
Last edited:

__neronero

Member
Jan 23, 2021
275
379
E.g. _neronero's Fran pack tried to play with adding dynamically created traits; and I had no end of trouble in Bonanza because I added a modified form of Trait King (...)
:unsure: Seeing my name mentioned here makes me wonder...
Apparently I'm right below the level of a decent high school student, an exemplary problem case for actual programmers. :whistle:

Probably not something to be proud of... But the fact you can contribute mods/events/stories without much programming experience is just another thing to like about Brothel King. Certainly very underutilised, despite Goldo welcoming it with open arms.

I guess it's slightly too complicated for someone with 0 experience, but slightly too limiting for someone with too much experience (quickly leading to a fork)?
 

Jman9

Engaged Member
Jul 17, 2019
2,293
954
Probably not something to be proud of...
Nah, Trait King is certainly something you can be proud of. Most of my troubles were self-inflicted. I could have chosen to fully integrate TK into my mod, but was too lazy to do it.

But the fact you can contribute mods/events/stories without much programming experience is just another thing to like about Brothel King.
Definitely. (y)

...slightly too limiting for someone with too much experience (quickly leading to a fork)?
I have (or had) nearly zero experience as well. Forking was just the natural consequence of me wanting to retouch everything. A professional would probably not have done that. On the other hand, a professional would most likely find entertainment in the non-programming parts, like Leortha does.
 
  • Like
Reactions: __neronero

Kite80

Well-Known Member
Modder
May 30, 2017
1,025
1,014
People can start from 0 and contribute to BK in any way they see fit for their availability, and trust me when I say it's almost the same thing if you have some basic dev skills or are a total newbie, in both cases you have to learn almost everything from scratch. Moreover, here you can find other people who can help you learning ren'py, enough to make your own events and mods, the only real limits are how much time you can spend on it and if you wish it or not.
 
  • Like
Reactions: Yukihirou

Kite80

Well-Known Member
Modder
May 30, 2017
1,025
1,014
New patch for 0.2 out:

It's another hotfix for some issues, there may still be bugs around
 
Last edited:
  • Like
Reactions: GH20

Kulman

Engaged Member
Sep 28, 2017
2,076
5,641
So I downloaded the game and added the patch and basic girl pack. The images of girls keep chaning every time I look at them (i.e. one time it is sakura from naruto, other time it is someone from bleach). The small images do not match the big image as well. Is it supposed to be ever changing like that or do I have a bug somewhere?
 

Kite80

Well-Known Member
Modder
May 30, 2017
1,025
1,014
Portraits and profiles are different, it is meant to be like that; also portraits of girls in the brothel may change every time you open brothel screen. You will notice that this doesn't happen for market slaves and free girls, so that you can easily reckognize them anytime
 

Jman9

Engaged Member
Jul 17, 2019
2,293
954
The images of girls keep chaning every time I look at them
If 'every time' is every day, that's intended. Girls get up in the morning and pick different clothing, or makeup, etc.

If it's every time you click a button ('Girls', 'Slave market', 'Farm', etc), it's a bug.

The small images do not match the big image as well.
Portraits and profiles are different files, since Ren'Py does not have an advanced AI zoom feature. And most people don't crop portraits based on profiles, because it's a lot of work.
 

Kulman

Engaged Member
Sep 28, 2017
2,076
5,641
If 'every time' is every day, that's intended. Girls get up in the morning and pick different clothing, or makeup, etc.

If it's every time you click a button ('Girls', 'Slave market', 'Farm', etc), it's a bug.


Portraits and profiles are different files, since Ren'Py does not have an advanced AI zoom feature. And most people don't crop portraits based on profiles, because it's a lot of work.
I see. That kinda sucks to me because I just cannot anchor the girl in my imagination when she keeps switching between completely different characters. Oh well.
 

Jman9

Engaged Member
Jul 17, 2019
2,293
954
That kinda sucks to me because I just cannot anchor the girl in my imagination when she keeps switching between completely different characters.
Wait, wait. Different characters? Can you provide an example screenshot? The whole point of girl packs is that it's the same character, but different pictures of her. The only times this is not the case is if the pack maker fucked up, or you have default pictures enabled, which are generally anonymised, even if hardcore fans can still occasionally recognise a few of the pictures.
 
4.60 star(s) 44 Votes