qwertyu12359

Jack-o-nine-tails
Game Developer
Aug 1, 2017
1,553
1,686
Not sure where in save files is that arrays stored, more to front bigger the problem. Biggest problems are arrays with a lot of elements, size of elements doesnt matter that much. They contribute most to unnecessary copying of data in memory.
Do you want me to put your new .dll in the EXTRAS section of the OP, and eventually in the game for v2.2 ? Or do you want to continue further testing and improving until you see fit?
 

Pararock

Member
Aug 17, 2016
316
373
Not sure where in save files is that arrays stored, more to front bigger the problem. Biggest problems are arrays with a lot of elements, size of elements doesnt matter that much. They contribute most to unnecessary copying of data in memory.
God damn it you beat me to the punch. I was working on compiling the full gui while you skipped straight to the dll. That's cheating ;)

Do you mind sharing the code change? I'm looking to fork FastQSP and rebuilding it for QT 5.12 instead of Qt 5.14 .
 
  • Like
Reactions: i107760

roktav

Newbie
Jun 14, 2018
20
24
Testing the fix now, loading a save takes as long as before, if not longer, but saving the game takes much shorter, as in instantaneously, where it used to take so long that I'd go and watch a youtube clip while it was doing the decade save. Loading still isn't nearly as slow as saving used to be, still noticeably slower (takes about 3-4 times as long). This is with a day 583 save with 8 slaves total.
I only changed saving as I never had that much problems with loading, so loading time should be same.
Do you want me to put your new .dll in the EXTRAS section of the OP, and eventually in the game for v2.2 ? Or do you want to continue further testing and improving until you see fit?
I probably won't change anything else in it, so it will be useful as long as game engine isn't updated. You can put it in EXTRAS section in meantime.
God damn it you beat me to the punch. I was working on compiling the full gui while you skipped straight to the dll. That's cheating ;)

Do you mind sharing the code change? I'm looking to fork FastQSP and rebuilding it for QT 5.12 instead of Qt 5.14 .
I changed directly assembly in dll so you already have source code ;) But I can look at FastQSP code to see what I changed.
 

roktav

Newbie
Jun 14, 2018
20
24
God damn it you beat me to the punch. I was working on compiling the full gui while you skipped straight to the dll. That's cheating ;)

Do you mind sharing the code change? I'm looking to fork FastQSP and rebuilding it for QT 5.12 instead of Qt 5.14 .
I looked at source code at . I changed function qspAddText from text.cpp. To replicate my changes in source code you would need to change qspCodeWriteIntVal and qspCodeWriteVal from coding.cpp to call changed qspAddText as is in attachment. I cannot guarantee that code in attachment is runable as it was long time since I wrote any c++ code, but I left enough comments do decipher changes.
 
  • Like
Reactions: Pararock

i107760

Sistersitting / Housesitting Developer
Modder
Game Developer
Nov 1, 2016
849
1,474
Changed master editor screen to always go up by 1 per press, now looking into the other issues you had with cheat menu qwertyu12359.

Also, great work roktav, when v2.2 is ready I will add your changes to the git as well.

EDIT: All the issues you had with cheat menu are now fixed: Master editing of skills is one 'level' per click, buttons are now yellow when clickable, can no longer go to "frail" strength which resulted in gameover.
EDIT2: Also fixed the "Leave the house" button reappearing when switching rooms.
 
Last edited:

Zirnitra

Newbie
Jun 18, 2017
29
13
Changed master editor screen to always go up by 1 per press, now looking into the other issues you had with cheat menu qwertyu12359.

Also, great work roktav, when v2.2 is ready I will add your changes to the git as well.

EDIT: All the issues you had with cheat menu are now fixed: Master editing of skills is one 'level' per click, buttons are now yellow when clickable, can no longer go to "frail" strength which resulted in gameover.
EDIT2: Also fixed the "Leave the house" button reappearing when switching rooms.
A problem I've seen is that, when you get a girl from the Fog fights she tends to lose her virginity if she had it before, there is no explanation in the text as to why. Can you either fix that, or add something to the cheat menu to allow the manipulation of the virginity status?
 

Zurrlock

Member
May 13, 2018
335
222
In a similar vein the magical explosion thing when you put a magical brand on her seems to happen like 80 % of the time, if she's got a virginity you want to preserve for a while you essentially can't do that because of that. That "rare occurrence" needs to be made drastically more so.
 

i107760

Sistersitting / Housesitting Developer
Modder
Game Developer
Nov 1, 2016
849
1,474
A problem I've seen is that, when you get a girl from the Fog fights she tends to lose her virginity if she had it before, there is no explanation in the text as to why. Can you either fix that, or add something to the cheat menu to allow the manipulation of the virginity status?
Many fog encounters are that a girl is being raped, it still will display virgin in the screen after the fight, but that is the reason she is not a virgin as far as I'm aware.
 
  • Like
Reactions: Zirnitra

orin15

New Member
Dec 15, 2019
1
0
So I see that there is a tool to add images to already existing girls but is there a way to add new girls? Do I have to go to the code and change something to add them?
Sorry if that question was already asked, I tried searching on the internet but I could only find the tool to add pictures to slaves already in the game.
 

qwertyu12359

Jack-o-nine-tails
Game Developer
Aug 1, 2017
1,553
1,686
So I see that there is a tool to add images to already existing girls but is there a way to add new girls? Do I have to go to the code and change something to add them?
Sorry if that question was already asked, I tried searching on the internet but I could only find the tool to add pictures to slaves already in the game.
You don't need to go to the code. But you have to create a json file (you can edit one with a correspinding age and hair color and save it with another name and edit the 'Face' and 'Full' informations). That's in the Json/slave folder.

In the Json folder. You have a slave_index with the number delimiter according to the organization of your slave folder. Edit it according to your modifications.
 
  • Like
Reactions: orin15

Pararock

Member
Aug 17, 2016
316
373
I looked at source code at . I changed function qspAddText from text.cpp. To replicate my changes in source code you would need to change qspCodeWriteIntVal and qspCodeWriteVal from coding.cpp to call changed qspAddText as is in attachment. I cannot guarantee that code in attachment is runable as it was long time since I wrote any c++ code, but I left enough comments do decipher changes.
I get crashes when I try your solution. destPtr is not initialized if the buffer isn't increased so the debugger complain when it try to do destPtr += destLen; I understand what you are doing but not the details. So I don't know where to start on this. And like you c is not my best.

I tried an alternative. I just allocate a 50MB buffer and qspStrNCopy the save into it. Not the most memory efficient and not scalable to save over 50MB.

C:
int qspAddTextChanged(QSP_CHAR** dest, const QSP_CHAR* val, int destLen, int valLen, QSP_BOOL isCreate) {
    int ret;
    int size;
    int sizeLeft;
    QSP_CHAR* destPtr;

    if (valLen < 0)
        valLen = qspStrLen(val);

    if (destLen < 0)
        destLen = qspStrLen(*dest);

    ret = destLen + valLen;
    destPtr = *dest + destLen;

    qspStrNCopy(destPtr, val, valLen);
    destPtr[valLen] = 0;

    return ret;
}
For load, you have to change the default bufSize in qspSplitStr

C:
int qspSplitStr(QSP_CHAR *str, const QSP_CHAR *delim, QSP_CHAR ***res) {
  int allocChars, count = 0, bufSize = (10 * 1024 * 1024), delimLen = qspStrLen(delim);
  QSP_CHAR *newStr, **ret, *curPos = str, *found = qspStrStr(str, delim);
  ret = (QSP_CHAR **)malloc(bufSize * sizeof(QSP_CHAR *));
  while (found) {
    allocChars = (int)(found - curPos);
    newStr = (QSP_CHAR *)malloc((allocChars + 1) * sizeof(QSP_CHAR));
    qspStrNCopy(newStr, curPos, allocChars);
    newStr[allocChars] = 0;
    if (++count > bufSize) {
      bufSize += 1024;
      ret = (QSP_CHAR **)realloc(ret, bufSize * sizeof(QSP_CHAR *));
    }
    ret[count - 1] = newStr;
    curPos = found + delimLen;
    found = qspStrStr(curPos, delim);
  }
  newStr = (QSP_CHAR *)malloc((qspStrLen(curPos) + 1) * sizeof(QSP_CHAR));
  qspStrCopy(newStr, curPos);
  if (++count > bufSize)
    ret = (QSP_CHAR **)realloc(ret, count * sizeof(QSP_CHAR *));
  ret[count - 1] = newStr;
  *res = ret;
  return count;
}
Before it started at 8 and increased by 16. I tried to change the dll like you but failed.

I have been playing with this for the in the past few days. Any reason you guys stayed with FastQSP? With only some tweaking I manage to run on the Sonnix branch.

https://f95zone.to/threads/qsp-player-with-video-support-written-in-qt.10801/
 

i107760

Sistersitting / Housesitting Developer
Modder
Game Developer
Nov 1, 2016
849
1,474
I haven't really kept up with QSP development, I knew Girl Life used a different QSP player, but thought it just added video support. And I was not sure how it would work, since JonT is a little different from most QSP games. And I wasn't sure new players would work with JonT since it doesn't use the standard QSP player, but is a little different.

Anyway, all the testing/input is appreciated. Hopefully we figure out the best way to go for v2.2 to minimize saving and loading times.
 

roktav

Newbie
Jun 14, 2018
20
24
I get crashes when I try your solution. destPtr is not initialized if the buffer isn't increased so the debugger complain when it try to do destPtr += destLen; I understand what you are doing but not the details. So I don't know where to start on this. And like you c is not my best.

I tried an alternative. I just allocate a 50MB buffer and qspStrNCopy the save into it. Not the most memory efficient and not scalable to save over 50MB.

C:
int qspAddTextChanged(QSP_CHAR** dest, const QSP_CHAR* val, int destLen, int valLen, QSP_BOOL isCreate) {
    int ret;
    int size;
    int sizeLeft;
    QSP_CHAR* destPtr;

    if (valLen < 0)
        valLen = qspStrLen(val);

    if (destLen < 0)
        destLen = qspStrLen(*dest);

    ret = destLen + valLen;
    destPtr = *dest + destLen;

    qspStrNCopy(destPtr, val, valLen);
    destPtr[valLen] = 0;

    return ret;
}
For load, you have to change the default bufSize in qspSplitStr

C:
int qspSplitStr(QSP_CHAR *str, const QSP_CHAR *delim, QSP_CHAR ***res) {
  int allocChars, count = 0, bufSize = (10 * 1024 * 1024), delimLen = qspStrLen(delim);
  QSP_CHAR *newStr, **ret, *curPos = str, *found = qspStrStr(str, delim);
  ret = (QSP_CHAR **)malloc(bufSize * sizeof(QSP_CHAR *));
  while (found) {
    allocChars = (int)(found - curPos);
    newStr = (QSP_CHAR *)malloc((allocChars + 1) * sizeof(QSP_CHAR));
    qspStrNCopy(newStr, curPos, allocChars);
    newStr[allocChars] = 0;
    if (++count > bufSize) {
      bufSize += 1024;
      ret = (QSP_CHAR **)realloc(ret, bufSize * sizeof(QSP_CHAR *));
    }
    ret[count - 1] = newStr;
    curPos = found + delimLen;
    found = qspStrStr(curPos, delim);
  }
  newStr = (QSP_CHAR *)malloc((qspStrLen(curPos) + 1) * sizeof(QSP_CHAR));
  qspStrCopy(newStr, curPos);
  if (++count > bufSize)
    ret = (QSP_CHAR **)realloc(ret, count * sizeof(QSP_CHAR *));
  ret[count - 1] = newStr;
  *res = ret;
  return count;
}
Before it started at 8 and increased by 16. I tried to change the dll like you but failed.

I have been playing with this for the in the past few days. Any reason you guys stayed with FastQSP? With only some tweaking I manage to run on the Sonnix branch.

https://f95zone.to/threads/qsp-player-with-video-support-written-in-qt.10801/
This error should be easily solvable, just initiate it with previous value
C:
  QSP_CHAR *destPtr = *dest;
I updated qsp.dll to set buffer of qspSplitStr to start with 1024 and then double each time. This should now shorten load times.
 

Pararock

Member
Aug 17, 2016
316
373
I haven't really kept up with QSP development, I knew Girl Life used a different QSP player, but thought it just added video support. And I was not sure how it would work, since JonT is a little different from most QSP games. And I wasn't sure new players would work with JonT since it doesn't use the standard QSP player, but is a little different.

Anyway, all the testing/input is appreciated. Hopefully we figure out the best way to go for v2.2 to minimize saving and loading times.
Yeah, I spoke too soon. Seems like he modified QSP lib a little without any changelogs. The play command use in Jack-O-Nine support 3 parameter. 1 string, 1 number and another string while all the other QSP client don't know what to do with the last string. I'm still not too sure myself. The QSP lib still with the code on github doesn't support it either.

There's another strange thing going on I didn't figure out yet. How the variable STYLESHEET is populated? There's the code for a css in it, but honnestly I have idea how it got there.
 

Pararock

Member
Aug 17, 2016
316
373
There's so many fucking forks for this project. It's hard to keep track...




Someone did similar save/load optimization a year ago.
 

roktav

Newbie
Jun 14, 2018
20
24
There's so many fucking forks for this project. It's hard to keep track...




Someone did similar save/load optimization a year ago.
Not sure how faster is saving in this variant. It mainly replace realloc with vector push_back. Anyway if you will also fork, it should be easy to calculate needed size first (or small over allocate, but nobody should have less than 100 Mb free ram nowadays) and only allocate memory only once.
 

Pararock

Member
Aug 17, 2016
316
373
Not sure how faster is saving in this variant. It mainly replace realloc with vector push_back. Anyway if you will also fork, it should be easy to calculate needed size first (or small over allocate, but nobody should have less than 100 Mb free ram nowadays) and only allocate memory only once.
I didn't look at the details to see which one would be faster. I was focused on the others change to qsp like read from json and the imcompatible play command.

So, I have been working on bringing this branch up to date with QT5.14 WebEngine shamesely copying code from Sonnix branch.

I got it working pretty good now. I can drop the result inside the engine folder and it works. The neat thing with this is that command line argument --remote-debugging-port works. So you can see the developer console of the html.

Demo



There's still plenty of bug.
 
  • Like
Reactions: Linkin88
4.00 star(s) 58 Votes