devolution

Poll

If you are reporting a bug, follow these steps to assist us in finding the cause of your bug

1. Delete the "gamelog.txt" file from your game folder to clear it.
2. Run the game as you normally would until it crashes.
3. Create a zip file with your savegame and your "gamelog.txt" files.
4. Post your bug report with details of how and when you get the crash.
5. Attach the zip file to your report.

Author Topic: Crazy and PP's mod bug thread  (Read 619182 times)

0 Members and 8 Guests are viewing this topic.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #660 on: January 14, 2015, 05:46:44 AM »
Found this lil' dealie doo (see attached pic) while trying to do some problem solving for some issues I've been having. Haven't added any new traits to the game, so the problem is somewhere in the coding I'm guessing. Also, been trying to make grammar edits to some of the scripts as well as adding new dialogue, but the game doesn't like me adding to 'em apparently and now freezes/crashes after inputting brothel name and hitting start (v06.00.18). (would attach a gamelog but, after reviewing them myself, no reason for a crash is sited in the logs)
Attach the girl file named in the error and I will take a look at it.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Gmind

  • Newbie
  • *
  • Posts: 10
Re: Crazy and PP's mod bug thread
« Reply #661 on: January 14, 2015, 06:04:38 AM »
Attach the girl file named in the error and I will take a look at it.


Done. Not sure if was the one used when this happened (though the likelyhood is high) as I've been doing many trait changes to it and others to cut down on the number of traits that pop up upon creation. So far, it appears that "job" traits such as Director and Cook are causing the problem (not too certain, though).

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #662 on: January 14, 2015, 06:24:05 AM »
Done. Not sure if was the one used when this happened (though the likelyhood is high) as I've been doing many trait changes to it and others to cut down on the number of traits that pop up upon creation. So far, it appears that "job" traits such as Director and Cook are causing the problem (not too certain, though).
The problem is not the traits themselves but rather the number of them.
Girls can only have 60 traits but that files has 81.
Even with the random chance there is still a chance of getting more than 60 thus causing the error.
My test caught the error on trait 77 of 81.

I will add a catch for this but try to keep the number of traits lower than 60
Also, reduce the chance% on similar but not exclusive traits so they don't get too many traits that may not go well together.
If you have 81 traits, a lower percent for them should not make too much of a difference in the girls but will in the code.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Gmind

  • Newbie
  • *
  • Posts: 10
Re: Crazy and PP's mod bug thread
« Reply #663 on: January 14, 2015, 06:50:00 AM »
The problem is not the traits themselves but rather the number of them.
Girls can only have 60 traits but that files has 81.
Even with the random chance there is still a chance of getting more than 60 thus causing the error.
My test caught the error on trait 77 of 81.

I will add a catch for this but try to keep the number of traits lower than 60
Also, reduce the chance% on similar but not exclusive traits so they don't get too many traits that may not go well together.
If you have 81 traits, a lower percent for them should not make too much of a difference in the girls but will in the code.


Been lowering the traits all across the board with the highest non-definite traits being set at 10% while removing traits that can either be trained or gained rather easily in-game. Many thanks though, good sir!

Offline gcdeathrow

  • Newbie
  • *
  • Posts: 4
Re: Crazy and PP's mod bug thread
« Reply #664 on: January 15, 2015, 06:50:25 PM »
Think I found the problem with the matron not setting back the girl's day jobs after resting.

Method signature for HandleSpecialJobs on cJobManager is:
Code: [Select]
bool cJobManager::HandleSpecialJobs(int TargetBrothel, sGirl* Girl, int JobID, int OldJobID, bool Day0Night1, bool fulltime)
But when calling from cBrothel (line: 1543), it provides JobID and OldJobID in the wrong order:
Code: [Select]
g_Brothels.m_JobManager.HandleSpecialJobs(brothel->m_id, current, current->m_PrevDayJob, current->m_DayJob, true);

Haven't been able to build the solution to prove that is solves the problem, but seems like a likely candidate.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #665 on: January 15, 2015, 07:19:48 PM »
Think I found the problem with the matron not setting back the girl's day jobs after resting.
Method signature for HandleSpecialJobs on cJobManager is:
Code: [Select]
bool cJobManager::HandleSpecialJobs(int TargetBrothel, sGirl* Girl, int JobID, int OldJobID, bool Day0Night1, bool fulltime)But when calling from cBrothel (line: 1543), it provides JobID and OldJobID in the wrong order:
Code: [Select]
g_Brothels.m_JobManager.HandleSpecialJobs(brothel->m_id, current, current->m_PrevDayJob, current->m_DayJob, true);Haven't been able to build the solution to prove that is solves the problem, but seems like a likely candidate.
No that is not the problem, they are not "in the wrong order".
They are they way they are because the check is the "new job" is the job they had before being taken off the job and the "old job" is the current job (resting).

The problem is just below that:
Code: [Select]
g_Brothels.m_JobManager.HandleSpecialJobs(brothel->m_id, current, current->m_PrevDayJob, current->m_DayJob, true);
if (current->m_DayJob == current->m_PrevDayJob)  // only update night job if day job passed HandleSpecialJobs
    current->m_NightJob = current->m_PrevNightJob;
else
    current->m_DayJob = restjob;  <------ Should be   current->m_NightJob = restjob;
It was setting the day job with the HandleSpecialJobs then if it was changed it should set the night job.
Instead it would set the day job to resting.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline gcdeathrow

  • Newbie
  • *
  • Posts: 4
Re: Crazy and PP's mod bug thread
« Reply #666 on: January 15, 2015, 08:41:51 PM »
I can only bow to your superior understanding of the codebase.

However, I made the change you suggested and the problem was not fixed. Changing the final argument of the HandleSpecialJobs call from 'true' to 'false' does seem to fix the problem, but I am unsure of other implications of this change.

Including changed code for clarity:
Code: [Select]
g_Brothels.m_JobManager.HandleSpecialJobs(brothel->m_id, current, current->m_PrevDayJob, current->m_DayJob, false);
if (current->m_DayJob == current->m_PrevDayJob)  // only update night job if day job passed HandleSpecialJobs
    current->m_NightJob = current->m_PrevNightJob;
else
    current->m_NightJob = restjob;

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #667 on: January 15, 2015, 08:55:46 PM »
However, I made the change you suggested and the problem was not fixed. Changing the final argument of the HandleSpecialJobs call from 'true' to 'false' does seem to fix the problem, but I am unsure of other implications of this change.

The last argument was added to allow holding the control key when selecting the girls job to make a job full time.
In the other buildings it is used but the brothel has not gotten the full update yet.
So making it false, or even removing it, should not affect anything.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline gcdeathrow

  • Newbie
  • *
  • Posts: 4
Re: Crazy and PP's mod bug thread
« Reply #668 on: January 15, 2015, 10:45:19 PM »
Please note that when HandleSpecialJobs is called in this case, fullTime is never specified, only Day0Night1. It seems to solve the problem from my testing.

Offline Rafflesia

  • Newbie
  • *
  • Posts: 6
Re: Crazy and PP's mod bug thread
« Reply #669 on: January 15, 2015, 11:00:11 PM »
Speaking of fixing matrons, I made a change to HandleSpecialJobs that seemed to work. In the last else statement checking for special jobs I changed SHIFT_DAY to true.
Code: [Select]
else
    {
        MadeChanges = false;
        if (fulltime)
            Girl->m_DayJob = Girl->m_NightJob = JobID;
        else if (Day0Night1 == true)
            Girl->m_DayJob = JobID;
        else
            Girl->m_NightJob = JobID;
I don't think that was the problem either since Day0Night1 == SHIFT_DAY seems to work correctly everywhere else as far as I can tell, but it's something I guess.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #670 on: January 16, 2015, 02:17:38 AM »
An update on this:
Found this lil' dealie doo (see attached pic) while trying to do some problem solving for some issues I've been having. Haven't added any new traits to the game, so the problem is somewhere in the coding I'm guessing. Also, been trying to make grammar edits to some of the scripts as well as adding new dialogue, but the game doesn't like me adding to 'em apparently and now freezes/crashes after inputting brothel name and hitting start (v06.00.18). (would attach a gamelog but, after reviewing them myself, no reason for a crash is sited in the logs)
Done. Not sure if was the one used when this happened (though the likelyhood is high) as I've been doing many trait changes to it and others to cut down on the number of traits that pop up upon creation. So far, it appears that "job" traits such as Director and Cook are causing the problem (not too certain, though).
The problem is not the traits themselves but rather the number of them.
Girls can only have 60 traits but that files has 81.
Even with the random chance there is still a chance of getting more than 60 thus causing the error.
My test caught the error on trait 77 of 81.

I will add a catch for this but try to keep the number of traits lower than 60
Also, reduce the chance% on similar but not exclusive traits so they don't get too many traits that may not go well together.
If you have 81 traits, a lower percent for them should not make too much of a difference in the girls but will in the code.

I have reworked random girl's traits so that you can have up to 200 traits in an .rgirlsx file.
I have not changed the number of traits a girl can have so those 200 traits will need to have their percent low enough to allow checking of the later traits on the list.
What it does now is load all traits in the .rgirlsx file and then when it comes to select the traits, it then checks the percent and adds in as many as it can before stopping when the girl has 60 traits.

So if you want any traits to be given to the girl 100% of the time, be sure to have them at the top of the .rgirlsx file.
It would be best to sort the traits in percent order from 100% to 1%.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Hanzo

  • Full Member
  • ***
  • Posts: 116
Re: Crazy and PP's mod bug thread
« Reply #671 on: January 16, 2015, 07:17:51 AM »
In the XXX entertainer job customers may complain if a girl is too old, and demons, constructs and a few others are exempt due to aging differently. Shouldn't elves, succubi and maybe others be exempt too?

Quote from: code
if (g_Girls.HasTrait(girl, "Demon") || g_Girls.HasTrait(girl, "Shape Shifter") || g_Girls.HasTrait(girl, "Construct")
                        || g_Girls.HasTrait(girl, "Cat Girl"))
                {
                        ss << "Customers are surprised to see such an unusual girl giving sexual entertainment. ";
                        ss << "Some are disgusted, some are turned on, but many can't help watching.\n";
                        ss << "The dealers at the tables make a small fortune from distracted guests. ";
                        wages += 30;
                }
                else if (g_Dice.percent(min(max((g_Girls.GetStat(girl, STAT_AGE) - 28) * 4, 0), 100)))
                {       //"Too old!" - chance of heckle: age<28y= 0%, then 4%/year (30y - 8%, 40y - 48%...) from 53 = 100%... (but only a 20% chance this bit even runs)
                        //Note: demons are exempt as they age differently
                        ss << "Some customers heckle " + girlName + " over her age.";
                        ss << "\n\"Gross!\" \"Grandma is that you!?\"\n";
                        ss << "This makes it harder for her to work this shift. ";
                        jobperformance -= 20;
                 }

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #672 on: January 16, 2015, 08:23:59 AM »
In the XXX entertainer job customers may complain if a girl is too old, and demons, constructs and a few others are exempt due to aging differently. Shouldn't elves, succubi and maybe others be exempt too?
Ok, How about this?
Code: [Select]
        if (g_Girls.HasTrait(girl, "Demon") || g_Girls.HasTrait(girl, "Shape Shifter") || g_Girls.HasTrait(girl, "Construct") ||
            g_Girls.HasTrait(girl, "Cat Girl") || g_Girls.HasTrait(girl, "Succubus") || g_Girls.HasTrait(girl, "Reptilian"))
        {
            ss << "Customers are surprised to see such an unusual girl giving sexual entertainment. ";
            ss << "Some are disgusted, some are turned on, but many can't help watching.\n";
            ss << "The dealers at the tables make a small fortune from distracted guests. ";
            wages += 30;
        }
        else if (girl->age() > 30 && g_Dice.percent(min(90, max((girl->age() - 30) * 3, 1))))
        {    //"Too old!" - chance of heckle: age<30y= 0%, then 4%/year (32y - 6%, 40y - 30%...) max 90%... (but only a 20% chance this bit even runs)
            //Note: demons are exempt as they age differently
            ss << "Some customers heckle " + girlName + " over her age.";
            ss << "\n\"Gross!\" \"Grandma is that you!?\"\n";
            ss << "This makes it harder for her to work this shift. ";
            jobperformance -= 20;
        }
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Lurker

  • Hero Member
  • *****
  • Posts: 688
Re: Crazy and PP's mod bug thread
« Reply #673 on: January 16, 2015, 06:28:25 PM »
Game crash when i press next week. New game started had no girls, crashed. New game started had one girl, crashed.
Using WhoreMaster.06.00.26

Edit: Tried version 00.25 and that one works fine.
« Last Edit: January 16, 2015, 06:33:40 PM by Lurker »

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Crazy and PP's mod bug thread
« Reply #674 on: January 17, 2015, 01:14:50 AM »
Game crash when i press next week. New game started had no girls, crashed. New game started had one girl, crashed.
Using WhoreMaster.06.00.26

Edit: Tried version 00.25 and that one works fine.
This is cause by the new rival code that allows rival gangs to fight.
The "gang fights gang" and "gang fights girl" were written only for your gangs so it assumed the number of gangs would be 1 or more.
The healing potion check was still used but threw a divide by 0 error. (numpotions / numgangs)

I need to add a check for that.

It is an oversight on my part but this will cause the rivals to uses your potions when they fight each other.
Until I fix this, expect a slight increase in potion replenishment cost.
The good thing is that it shouldn't affect your gangs because rivals are run after your gangs.
So if you use all of your potion allocation that turn, the rival who started the fight will have fewer potions than the one they are attacking.
« Last Edit: January 17, 2015, 02:03:44 AM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug