HTML 5 Questions: Save/Load/SQL and JS engine

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
thebluejester
001 Enthusiast
 
Joined: Fri Jul 24, 2015 3:05 am

HTML 5 Questions: Save/Load/SQL and JS engine

Postby thebluejester » Fri Jan 08, 2016 9:55 am

Hello all,

Question 1:
I have a few issues with HTML 5 (my preferred platform atm; although this might change with the zoom feature).
Are the saved games simply stored in the browsers Cache? Just waiting to be cleared out?
Problem 1:
I haven't been able to test this well (via saving then clearing browser) because I get an error "Out of String Space" when trying to load games anyway:
Game fail.PNG
Loading Bug

I'm not really fussed about this issue pending Question 2/Issue 2

Question 2:
With the engines SQL capabilities saving to a SQL database makes a lot of sense but I have no idea what the save structure/what goes into a save file is like. Realistically once a database is set up and a custom script for saving/loading is made in the engine, sharing a SQL script to recreate the Database for others would be easy and sharing the custom script from the engine is also a piece of cake. Is there anyway to open/access the save file? I'd love to experiment with this.
Issue 2:
I don't seem to have SQL capabilities in GG Maker (Steam) even though it states in the documentation that it does/should have. "The features below are ONLY available to Subscribers or those that have purchased a copy of GG Maker." and then lists SQL. If SQL is only a features for subscription I don't mind getting a subscription, I'm just unsure at the moment.

Question 3: Bonus Round
Kind of a tangent but is the HTML 5 / JS engine updated as Emscripten and LLVM are updated/improved? From what I can tell the .exe that runs games hasn't been updated in a long time and still runs in VB6 so obviously there isn't a need to update the JS engine based on updates to the windows binary. Is the VB6 project converted into C/C++ and then run through Emscripten? Or is there a custom/original C/C++ source code used for this? Just curious. I'd love to play around with it all, but understand this is not an open source project.

Sorry for the giant post. I REALLY like Engine 001/GG Maker but I just want to make sure everything will work before I spend limitless hours playing in it. Haha.

Thanks for hearing me out. I'm always up for helping out where I can so let me know if there's something I can do to give back.
GG Maker Owner. Occasional 001 Subscriber.
Lvl 1 Mage. Chaotic Neutral.
Postgrad Science/IT student. Feed me I'm poor.

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Lee » Fri Jan 08, 2016 10:11 am

1) I've confirmed this issue and sent a bug report for it to be looked into. Should be fixed for the next version :).

2) The Steam version is identical to the Subscription version. You have access to web events just like Subscribers, I think it's just the wording of the Wiki that is a little outdated. Basically you want to look for the 'Query Webpage into Table' and 'Query Webpage into Variable' events.

EDIT: Yeah, that page was VERY outdated. I've updated the entire page to clear up any future confusion. Thanks for pointing it out!

3) This is a question that Mike would be better at answering. If he doesn't see this post, I'll link him to the topic so he can respond.
Lee - 001 Community Manager

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Mike » Fri Jan 08, 2016 11:13 am

There have actually been no consideration for saved games for HTML5. There's so many features in this project, and sometimes things like that slip by. Sorry :P. Anyway, I'm speaking with Lee about possible implementations. However, even if we conclude that we cannot support these events, you could easily implement something based off the networking features (like storing user's data on the server). And honestly, this is far optimal since you know they're connected to the Internet, since GG Maker does not handle saved games after a game has been updated very well.

thebluejester wrote:is the HTML 5 / JS engine updated as Emscripten and LLVM are updated/improved?

I do my best, but there's no guarantee. However, if there are performance issues, we can always look into them.

thebluejester wrote:From what I can tell the .exe that runs games hasn't been updated in a long time and still runs in VB6 so obviously there isn't a need to update the JS engine based on updates to the windows binary.

The exe that runs games gets updated all the time. It has nothing to do with the HTML5 build, however. As you guessed...

thebluejester wrote:Is the VB6 project converted into C/C++ and then run through Emscripten?

This is sadly the case. It's using a special script I worked on when I was younger and I re-purposed it for this project. It somehow handles the entire engine and this is how we have Android and HTML5, and soon iOS. I was thinking of releasing the converting system, but I figure nobody uses VB6 anymore anyway :P.

thebluejester wrote:Just curious. I'd love to play around with it all, but understand this is not an open source project.

Indeed, as this project is not open source, none of this really matters. Just know, if you have performance issues, I'm always willing to help you out :)!

User avatar
thebluejester
001 Enthusiast
 
Joined: Fri Jul 24, 2015 3:05 am

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby thebluejester » Fri Jan 08, 2016 12:26 pm

Thanks for getting back to me Mike and so quickly too. I'm overly curious about everything, haha.

I for one do have Visual Studio 6 installed for VB6. It's fairly easy to go from VB6 to VB.net via the built in converter in Visual Studio 2008, but then you'd still have to get it to C/C++ which isn't hard or expensive from my knowledge but probably not great for performance. (I'm certain you've considered all/most options anyway).

Apparently "VBto" works well for converting VB5-6 to a range of languages and has a range of optimizations but it costs several hundred and Emscripten does it's own optimizations anyway (as I'm sure you're aware, as I've seen the JS script) Overall I think you're lucky to have that special little script of yours, haha.

In regards to performance I've been considering starting a thread/guide for optimization. The do's and don't for getting the best performance on HTML and Android. I've already started gathering data, FPS comparisons before and after and such. Could become a useful sticky or guide in the tute sections. Anyway...

Thanks for the info. I'm off to tinker to my hearts content.
GG Maker Owner. Occasional 001 Subscriber.
Lvl 1 Mage. Chaotic Neutral.
Postgrad Science/IT student. Feed me I'm poor.

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Mike » Fri Jan 08, 2016 8:10 pm

I have taken advantage of IndexedDB through Emscripten's IDBFS and the next version should have the save/load game issue fixed :)!

User avatar
thebluejester
001 Enthusiast
 
Joined: Fri Jul 24, 2015 3:05 am

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby thebluejester » Mon Jan 11, 2016 11:10 am

I was literally writing a bug post asking if Save/Load would be something that could be fixed in the future (Sooner or later). Thank you so much for getting this sorted!

I was feeling a little disheartened to be honest; couldn't do Android because of resolution issues (which I hear you've fixed with the ability to zoom) and HTML 5 was out because of saving, and now you've fixed that. So happy. I can't believe how actively Engine 001/GG Maker is worked on :D.

I do have a question though; will this new save feature save to the browsers cache or somewhere more permanent?
I'm grateful either way, Thanks Mike!
GG Maker Owner. Occasional 001 Subscriber.
Lvl 1 Mage. Chaotic Neutral.
Postgrad Science/IT student. Feed me I'm poor.

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Lee » Mon Jan 11, 2016 11:50 am

The save data will be stored in the browser cache, which means browser resets might cause save data to be erased. This was deemed to be the easiest and fairest solution (that or disabling the functionality altogether). Since web pages don't have full access to your computer, the save data can't be stored in the same location as regular saves are. Looking towards the long-term, we thought about setting up a service with Degica that would allow save data to be stored on a server. The problem with this being that if the service is stopped, then everyone would lose their save data. I should also mention that there are no guarantees that this will be implemented, just something we thought about.
Lee - 001 Community Manager

User avatar
thebluejester
001 Enthusiast
 
Joined: Fri Jul 24, 2015 3:05 am

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby thebluejester » Mon Jan 11, 2016 2:25 pm

Thanks for the info Lee :)
I imagine I'll be able to write a script to upload and download save files from my web server with a login system using SQL. Hopefully I can hook it into the JS engine, whenever it writes a save it triggers the upload. I'll just have to wait and see the code, bit of a pain with it being super optimized but oh well. Worse case I can a save to server button on the webpage the game runs in.

Thanks again.
GG Maker Owner. Occasional 001 Subscriber.
Lvl 1 Mage. Chaotic Neutral.
Postgrad Science/IT student. Feed me I'm poor.

User avatar
Mike
001 Co-Founder
 
Joined: Sun May 08, 2005 1:29 pm
Location: Ontario, Canada

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Mike » Mon Jan 11, 2016 4:07 pm

I'm contemplating making "Execute Shell Command" on HTML5 execute javascript. It would allow you to trigger events of sorts like you're wanting to. And it would be easy for me to implement. I'm just not sure about the security and would have to ponder on it more.

User avatar
thebluejester
001 Enthusiast
 
Joined: Fri Jul 24, 2015 3:05 am

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby thebluejester » Mon Jan 11, 2016 5:15 pm

I for one love the idea of being able to execute JS script from within the game!
Security wise as far as I'm aware the browser contains JS within a fairly tight sandbox. Plus if someone really wanted to do something malicious they could embed the script in the JS engine file or just into the HTML code.
Either way I'm stoked for the next update :D
GG Maker Owner. Occasional 001 Subscriber.
Lvl 1 Mage. Chaotic Neutral.
Postgrad Science/IT student. Feed me I'm poor.

User avatar
Lee
001 Support
 
Joined: Thu Sep 21, 2006 1:59 pm
Location: United Kingdom

Re: HTML 5 Questions: Save/Load/SQL and JS engine

Postby Lee » Mon Jan 11, 2016 6:47 pm

He's already added the functionality :P.

New subscription version should be out relatively soon :).
Lee - 001 Community Manager


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron