CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Tool QSP QSP Player With Video Support Written In Qt

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
Saving and loading should be the same as in original player. They just use the functions from the original library.
Frame visibility should be saved as well. The only difference that might be inconsistent is window size.
If you try and save inside dynamic call (DYNAMIC, DYNEVAL) then the evaluated state might be different after you load it. It is also this way in original player.

If you have examples of save games that work different in different players or you think might have problems then you can send them to me and I will take a look at them when I have the time.
I actually think the problem is based on your player actually being smarter than the original one. It is not a huge problem that would require any immediate action but i will send you some savefiles via message and attach some screenshots pointing out what i mean. I have been solely working with your player lately - so this is not about saves behaving differently between different players but about the panels resetting to some kind of 'default' despite they had been resized/moved.
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
Consider the panel thing solved. I double checked everything and you are right only happens when resizing the overall window. Solved.
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
Also for the new version I've added an ability to add custom elements to the <head> part of the page. This allows to set custom css and javascript file for the page. To test this you need to enable "HTML5 Extras" option in settings.
To set the header you need to set $SETMAINDESCHEAD variable for the main description and $SETSTATHEAD for additional description. Like so:
$SETMAINDESCHEAD = '<link rel="stylesheet" href="example.css">'
Right now it will persist across locations once set. So if you don't need it anymore you would have to set it to empty string ($SETMAINDESCHEAD = '') or use KILLVAR.
I'm interested in feedback on this feature. And suggestions on how to implement this.

In future I might include more features to bridge html5 features to player.
Since you asked for feedback for this feature: I personally love this one and its one of the most powerful ones you gave us. Since formatting changes can be done outside of the qsp via a standard css stylesheet it invites non-qsp designers to help with the 'fancy' stuff.
As a request: it would be helpful if you would rename the variable for the add. desc frame to fit that name as stat is just something that was used in GL but is not the common name for that frame.
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
Just a quick note about the player and configuration files:

It took me a while to solve this riddle as i understood it that the player only creates a configuration ini in the actual game directory. That is actually not true for WIN systems. In the %appdata% (roaming) section is a QQsp directory with a copy of the qqsp.ini. So my original panel thing showed up again and i also noticed that the player wouldnt reset to default settings after i deleted the ini in the game directory. That actually makes packaging a game with a predefined ini wonky as there will be an ini that we cant get rid off and force our own settings (extra html5 option is i.e. important for my game)
 

Sonnix

Newbie
Dec 25, 2017
19
40
I've released a new version.

Version 1.8:
Win32:
Win64:

I've posted the source code for this version some time go but did not have time to build binary version.
This version includes small fixes for WebEngine related code. And it includes some changes on how default configuration and autostart is handled.

With recent changes in how Chrome handles autoplay there might be some problems with autoplay for unmuted videos in Qt 5.12. The most reliable workaround for now is using webm/webp or starting videos with javascript.
 

Sonnix

Newbie
Dec 25, 2017
19
40
Since there is no good documentation for my player right now here is an example on how to bundle player configuration and game file with the player:


For configuration you just need custom.ini in the folder with executable file. You can set any default options you want. I'd advice not to include settings like geometry and windowState that rely on users screen resolution and physical screen size.

You can bundle the game by adding all the required files to standalone_content folder which should be located in the same folder with the executable file. The main qsp file that will be loaded by default should be called game.qsp. All the other files will be ignored so you can add modules if you require them and it would still work.
To start the bundled game set autostartLastGame=true in the configuration file. In that case lastPath and lastGame settings can be left blank as they will not be used in this setup. Everything else can be changed to the settings required for the game.
 
Feb 25, 2019
124
47
Since there is no good documentation for my player right now here is an example on how to bundle player configuration and game file with the player:


For configuration you just need custom.ini in the folder with executable file. You can set any default options you want. I'd advice not to include settings like geometry and windowState that rely on users screen resolution and physical screen size.

You can bundle the game by adding all the required files to standalone_content folder which should be located in the same folder with the executable file. The main qsp file that will be loaded by default should be called game.qsp. All the other files will be ignored so you can add modules if you require them and it would still work.
To start the bundled game set autostartLastGame=true in the configuration file. In that case lastPath and lastGame settings can be left blank as they will not be used in this setup. Everything else can be changed to the settings required for the game.
This player is very interesting.

Sonnix, can your player read .json files? I'm working on a mod for a QSP game where a previous modder managed to enable the usage of json files, thousands of them actually. If I use this can it cause bugs when reading json files?
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
This player is very interesting.

Sonnix, can your player read .json files? I'm working on a mod for a QSP game where a previous modder managed to enable the usage of json files, thousands of them actually. If I use this can it cause bugs when reading json files?
Without knowing the details of your code i am almost 100% certain everything should work as before with Sonnix's player. Sonnix hasnt really changed anything regarding the qsp part but merely replaced the reduced html4 part from the original qsp implementation with a proper html5 one. So changes you will see are more or less opening up for full html including some javascript without any real changes to qsp code itself.
So if the other modder managed to implement the reading of json he/she probably used default qsp capabilities to do it - maybe you could drop that code as attachment so one can have a look at it.
 
Feb 25, 2019
124
47
Thanks for responding very quickly.

I'm also stumped by how the program is reading qsp files. I have attached the requested qsp file. Btw, I can't attach the modified qsp player either as is or as a zipped file.

EDIT1: I'm modding with some guys an old qsp game in this thread. https://f95zone.to/threads/jack-o-nine-tails-v1-8-hf-old-huntsman-et-al.390/
EDIT2: I managed to upload the QSP player our game is using.
 
Last edited:

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
I actually have the 176 version on my drive. As far as i am aware he is already using QT5 stuff in JackONine but i never really took the time to dig deeper into the code itself.
This also means i change my assumption from earlier: JackONine is special and not pure qsp - so it might actually not work at all since Jack uses its own implementation already. You are not starting a qsp file but a compiled exe in Jack.
P.S.: I quickly checked the code for the json stuff and i am almost certain now that this is definitely a special implementation via QT. QSP itself has very limited functions to read from files (which is also a good thing by the way) and the data you get in Jack from those json files is implemented via some extra stuff in the compiled code.
 
Last edited:
Feb 25, 2019
124
47
I actually have the 176 version on my drive.
You're actually playing this game man? Seriously? We're in over our head modding some aspects of this game. Our lead coder is PowerAirMax (PAM), the guy who designed the current Jack UI. But we really need the advice (simple advice would do) of another real coder.

We had been trying to contact spectre1viper aka crushboss for a while but he has yet to respond. Can you make contact with PAM? He has big plans for the upcoming mod for this game but he could really use the help of someone with real coding skills in qsp.

As far as i am aware he is already using QT5 stuff in JackONine but i never really took the time to dig deeper into the code itself.
This also means i change my assumption from earlier: JackONine is special and not pure qsp - so it might actually not work at all since Jack uses its own implementation already. You are not starting a qsp file but a compiled exe in Jack.
That's why I couldn't find any reference to the json files in the qsp file. The previous modder actually edited the player itself? I'm not sure who did that but I'm willing to bet it's crushboss.

You're very much welcome to participate in our thread man. But do note that recently a lot of different people are participating in the discussions and some of these discussions are getting acrimonious.

The overall head of the modding group is qwerty. PAM is his second-in-command. StJesuz and I are helping mainly with debugging but also some oddjobs here and there as well. Qwerty is not yet a coder but he has terrific image manipulation skills. StJesuz and I only understand the basics of qsp programming. So PAM will be the guy you need to deal with if you're interested.

EDIT: PowerAirMax is the designer of the current Jack UI, not the primary coder of the jack.qsp.
 
Last edited:

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
Crush aka Viper didnt do the QT part -that was another dev who helped him during his major work on Jack (my best bet it was beaver14 who did that part). Reading json isnt standard part of qsp - you can achieve something similar without actually changing the player etc by using structured data in a qsp file and read those files as libs into the game (as i do for my current work).
Without meaning to brag but currently i am probably the most active and able coder for qsp here on F95 and i am working solely on my own project which is already delayed.
You are welcome to step into my discord anytime if its about qsp coding as i have helped quite a few people so far with it.
 

Sonnix

Newbie
Dec 25, 2017
19
40
This player is very interesting.

Sonnix, can your player read .json files? I'm working on a mod for a QSP game where a previous modder managed to enable the usage of json files, thousands of them actually. If I use this can it cause bugs when reading json files?
When I started working on this player I looked at the code of JackONine as it was more recent then the original player. It was not pure QSP and that implementation would not work with other QSP games.
As my player is based on the classic player it will not handle json and will not work with JackONine.
As far as I remember they use json to load different image variations without using qsp code (and to be fair qsp implementation of that would be complex and slow if you need to load hundreds of different resources).

It might be possible to make a separate version of the player with json support. I'd have to look at the code of JackONine again to figure out how complex it would be and how much time it would take. But I'm not really sure if it's worth the effort as it would only work with just one game and will not support anything else.
A better idea might be rewriting the parts of the game that rely on json. With HTML5 and JavaScript support in my player it might not be too hard. JavaScript can read and handle json and load the required resources dynamically. And the qsp can handle the game logic.
 
Feb 25, 2019
124
47
Crush aka Viper didnt do the QT part -that was another dev who helped him during his major work on Jack (my best bet it was beaver14 who did that part). Reading json isnt standard part of qsp - you can achieve something similar without actually changing the player etc by using structured data in a qsp file and read those files as libs into the game (as i do for my current work).
I stand corrected. I was unfamiliar with the development of Jack in the old HongFire threads.

Can you show me a sample program with associated files for enabling a qsp file to read json files?

What's your current project?

Without meaning to brag but currently i am probably the most active and able coder for qsp here on F95 and i am working solely on my own project which is already delayed.
You are welcome to step into my discord anytime if its about qsp coding as i have helped quite a few people so far with it.
That's fantastic! What's your discord?
 
Feb 25, 2019
124
47
When I started working on this player I looked at the code of JackONine as it was more recent then the original player. It was not pure QSP and that implementation would not work with other QSP games.
As my player is based on the classic player it will not handle json and will not work with JackONine.
As far as I remember they use json to load different image variations without using qsp code (and to be fair qsp implementation of that would be complex and slow if you need to load hundreds of different resources).
If I may add, it's not just complex and slow but the save game becomes bloated. There is an extremely weird bug where if you change the filename of a json file in the game same 100.json to 10000.json the save file triples in size without doing anything else. Same file, the name was just changed from 100.json to 10000.json.

It might be possible to make a separate version of the player with json support. I'd have to look at the code of JackONine again to figure out how complex it would be and how much time it would take. But I'm not really sure if it's worth the effort as it would only work with just one game and will not support anything else.
No problem. I understand.

A better idea might be rewriting the parts of the game that rely on json. With HTML5 and JavaScript support in my player it might not be too hard. JavaScript can read and handle json and load the required resources dynamically. And the qsp can handle the game logic.
I'm not familiar, yet, with handling executables. How can I peek into its contents so I can determine how exactly it is commanding the game to run json files?

Lastly, would you mind if me or some of my associates consult with you from time to time in addition to toolkitxx with regards to coding QSP? If so what's the most convenient way for you to be reached by us?
 
Feb 25, 2019
124
47
You are welcome to step into my discord anytime if its about qsp coding as i have helped quite a few people so far with it.
Toolkitxx, before you log off of F95, can I ask you one final question?

Since you have a Jack game you can probably test this. In the json\slave folder If you delete all the numbered json files save one then turn the filename of that remaining one, say 1.json, into a much larger number, say 10000.json, the save file will triple in the latter case as compared to the previous save with ~1K json files but with the largest filename being 908.json.

What could possibly cause it to bloat due to a filename change?

SIDE NOTE: For some reason F95 logs me out from time to time.
 

Sonnix

Newbie
Dec 25, 2017
19
40
If I may add, it's not just complex and slow but the save game becomes bloated. There is an extremely weird bug where if you change the filename of a json file in the game same 100.json to 10000.json the save file triples in size without doing anything else. Same file, the name was just changed from 100.json to 10000.json.


No problem. I understand.


I'm not familiar, yet, with handling executables. How can I peek into its contents so I can determine how exactly it is commanding the game to run json files?

Lastly, would you mind if me or some of my associates consult with you from time to time in addition to toolkitxx with regards to coding QSP? If so what's the most convenient way for you to be reached by us?
Another problem with qsp saves is that it can handle limited number of variables and there is nothing that can be done about that without breaking backward compatibility. If the game becomes large it will be a problem if a large portion is used by variables that just define resources.

I would have too look at the code so that I could point you to the parts that are responsible for json as last time I've seen it was quite some time ago. If it's not complex I might be able to make an example JS code that can replace it without making a separate player. If I have time I will try to look over JackONine code this weekend.

Sure I can help answering come questions. You can find me at toolkitxx's Discord, PM me here. Or we can use something else if you have anything better in mind.
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
The responsible parts are inclib and freelib commands in $addon. Both are not qsp commands btw
 
Feb 25, 2019
124
47
Another problem with qsp saves is that it can handle limited number of variables and there is nothing that can be done about that without breaking backward compatibility. If the game becomes large it will be a problem if a large portion is used by variables that just define resources.

I would have too look at the code so that I could point you to the parts that are responsible for json as last time I've seen it was quite some time ago. If it's not complex I might be able to make an example JS code that can replace it without making a separate player. If I have time I will try to look over JackONine code this weekend.
Thank you very much for this Sonnix.

Sure I can help answering come questions. You can find me at toolkitxx's Discord, PM me here. Or we can use something else if you have anything better in mind.
I don't mind Discord. You and toolkitxx appear to be good chaps when I joined you there. I don't mind PM either.

But just this once should you make breakthroughs with beaver14's json code would you mind posting your results at our thread? https://f95zone.to/threads/jack-o-nine-tails-v1-8-hf-old-huntsman-et-al.390/

We would like to use your findings as related literature for the benefit of future modders of Jack as this game's modding frequently drops dead only to get resurrected by a different set of modders.
 

toolkitxx

Well-Known Member
Modder
Donor
Game Developer
May 3, 2017
1,473
1,795
We would like to use your findings as related literature for the benefit of future modders of Jack as this game's modding frequently drops dead only to get resurrected by a different set of modders.
As much as I understand the wish to get things documented, that where done by others before, I feel it is the wrong approach.

Look at what the json stuff does actually. It provides simple data for slaves or path data for graphics. Both can easily be achieved with standard qsp means. Which leaves the question: Why has someone created a propriety (since undocumented) version of the qsp player that only enables the import of simple data from json files? From where i sit the reason is lazyness and/or lack of knowledge how to solve it in qsp itself. As long as that data isnt constantly changed/edited/added by others there is simply no need to use json at all.

Writing the same data as sets of data for an array in qsp can be easily done in notepad++ and a simple batch file converts that textfile into a proper qsp file. That would be the proper approach if the argument is to enable other modders in the future instead of trying to continue to work with an undocumented version that only works for that particular game.

Sonnix's player allows usage of javascript which means that json files can be read via eval commands in javascript - would be the same result as long as you can manage to actually assign the read data to qsp variables/arrays etc. His player is documented, publicly available as source on Github and he is active as dev to answer questions, give advice or even taking feature requests.