ShiVa Developer Forum • View topic - Limitation WebGL & Save Environment
 

Limitation WebGL & Save Environment

Plugin-free alternative to the ShiVa Web Player and Flash

Limitation WebGL & Save Environment

Postby giggsy » 2018-04-13 14:27

Hi,

I'm currently doing some testing with WebGL and noticed weird behaviour, when saving data to the environment (and possibly saving alternative data into another environment).
Could you outline the limitations of environments in WebGL?

They somehow seem to work, but my test case (which includes the switching) doesn't always seem to work ... but on the other hand, sometimes it does.

Thanks!
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby broozar » 2018-04-17 00:55

hi giggsy,

if it sometimes works and other times it doesn't, that sounds like a bug to me. i'd like to see a sample to reproduce some of your findings.
please also keep track of things like browsers and their versions, local vs remote server testing, etc.

not sure what you mean by "the switching" though.

I am not informed about any limitations with the environment. for engine specifics, you need to ask NiCoX through e-mail or slack. but let's find out together first if it's browser-related or a true bug.
User avatar
broozar
Administrator
Administrator
 
Posts: 4158
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Re: Limitation WebGL & Save Environment

Postby giggsy » 2018-04-17 07:45

Hi,

by switching environments I mean we got the following enivronments (=STS files):
* config (keeps track of must current savegame)
* savegame A
* savegame B

So my current suspicion is, that saving genereally works, but switching might get messed up (e.g. if you quit the game when saving).
That's what I would try next (in the next few days) and then I can try to give you an example to reproduce.

Thanks so far for you offer!
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby broozar » 2018-04-19 11:31

the games are run on the client in a browser sandbox. if you quit the game, i would be surprised if any of the information is carried over to the next run. at the very least you cannot rely on it. also file access in the browser sandbox, especially chrome, is quite painful. that's one of the reasons why local html5 websites like my "ports" for ChromeOS or FreeBSD have to run on a local microserver http://www.shiva-engine.com/html5-anywh ... localhost/ for details on how STS is affected by that, you would have to ask NiCoX.

i suppose if you want persistent saves, you will have to go the old "send xml to php script and store in a database" route that was necessary with the old webplayer.
User avatar
broozar
Administrator
Administrator
 
Posts: 4158
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Re: Limitation WebGL & Save Environment

Postby giggsy » 2018-04-25 08:51

Got held up with another project, hopefully have some time soon to continue researching.
But: Are you saying, you think STS files aren't persisted across different sessions?

I think a common solution is to store data in the local storage of the browser (e.g. the STS file stored in a sqllite db) ... it would be interesting if shiva STS files are stored that way or what to expect.
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby giggsy » 2018-04-26 10:24

I wrote a quick test which uses one single environment file. You should see just a counter counting up each app reload.

http://slegg.net/shiva/WebGLTest.ste

Online version:
http://www.slegg.net/shiva/WebGLTest/

For now, it looks promissing ... closed firefox a few times, data keeps getting counted up.
Haven't tried a reboot.


I think it could become a problem, if you exit the browser whilest the game is saving ... so maybe, we have to implement a manual save button for webgl ... have to test other browsers first with this simple test though.
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby broozar » 2018-04-26 10:32

very erratic/unreliable on Chrome. i got 0 two times before the counter went up, then 1, 2, and 0 again.
User avatar
broozar
Administrator
Administrator
 
Posts: 4158
Joined: 2007-09-16 10:22
Location: Berlin - Germany

Re: Limitation WebGL & Save Environment

Postby giggsy » 2018-04-26 11:01

yeah, got 0 again on FF aswell (without reboot)
Thanks for testing though!
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby giggsy » 2018-04-27 09:20

Just to be clear, with
i suppose if you want persistent saves, you will have to go the old "send xml to php script and store in a database" route that was necessary with the old webplayer.

you mean really store the savegame online in a DB, not local ... local won't work.
giggsy
Platinum Boarder
Platinum Boarder
 
Posts: 1154
Joined: 2010-06-27 21:17
Location: Austria

Re: Limitation WebGL & Save Environment

Postby broozar » 2018-04-28 23:58

yes, sure. have the player log into an account, store data in an online database under that username/password.
User avatar
broozar
Administrator
Administrator
 
Posts: 4158
Joined: 2007-09-16 10:22
Location: Berlin - Germany


Return to HTML 5

Who is online

Users browsing this forum: No registered users and 1 guest