We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Saving changes made in the Application!

Home Forums General Questions Saving changes made in the Application!

Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #54390
    pontus
    Customer

    Hello I have a question and I do not know if it is possible.

    Let’s say i have an application and it has the possibilities to change color, move, clone and hide/show objects.

    Is it possible to close the application and save the changes that was made to later open it up again?

    This is very important. Thank you

    #54395
    kdv
    Participant

    Is it possible to close the application and save the changes that was made to later open it up again?

    You can export changes to GLTF and load this GLTF later…

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #54435
    pontus
    Customer

    Is this GLTF able to reopen the application and continue from where it left off?

    #54441
    Crunch
    Customer

    I think what you are looking for is something like a “resume” feature that reloads the user app to the exact same state it was before closing the browser.

    That would be a VERY nice feature/puzzle to have in Verge. So why don’t we don’t we have it?

    Good question.. I for one never really thought much about requesting it as my understanding has always been ‘saving to disc’ means having to configure something to store it in – meaning database setup, php scripting, and other fun stuff that involves coding… Basically, something way out of scope for Verge3d developers to invest time in much less trying to provide user support for.

    *Wordpress being the exception here, as its standardized, mainly codeless option for Verge users to be able to ‘plugin’ an online DB storage solution. However, not everyone using Verge uses, or wants to use, WordPress.

    So I suppose I had ruled the idea that there could be any EASY button (puzzle) to implement a ‘save to disc’ and ‘resume’ feature for Verge apps… but that was before I learned about window.localStorage

    https://www.w3schools.com/jsref/prop_win_localstorage.asp

    It is so simple to use and from what I see, it’s a standard feature across all major browsers.

    So far, what I have managed to put together is a simple scheme where I create a dictionary with the variables I want to save (as Yuri and company have been advising as a solution for years), then convert it to a string to save to local storage.

    When my app loads, it checks localstorage to see if my key is set, if its not there, I run a procedure to set their default values – if the key is set, I load the string value into a JSON to setup a dictionary with the saved values, then run a procedure to set my variables to those values.

    Being able to simply save and load variables is great – but, its still far off from being an easy button for a ‘resume app state’ feature.

    You basically have to wire another layer of logic into your app to deal with the event of reloading variables and setting things to get back to the saved state where you left off. If your app allows users to modify any properties of objects (position, color, textures, clones etc), then things get even more complicated.

    It would be SO nice if Verge developers could come up with something that could essentially take a ‘snapshot’ of an apps current state (variables, object properties, etc) that could then be automatically restored/resumed on command.

    Still not sure how technically feasible such a feature would be, BUT with an essentially universal storage option (web local storage) open to all Verge developers (and end users) on the table… I now just have to ask the question to the Soft8Soft team.

    Yuri? Your thoughts?

    For starters, maybe a “create suspend data string” puzzle that simplifies the process of gathering all variables used in the app and writing their values, along with any object properties, when invoked at runtime, and writing out a stringified JSON formatted text string?

    With options to then save that string to local web storage, send to database, or whatever?

    Not sure what the puzzle looks like to load/unwrap the info back into the app as part of the resume process, but I am sure you guys could figure something out.

    Attachments:
    You must be logged in to view attached files.
    #54444
    Crunch
    Customer

    Of note, if you look at the attached screenshot of my local storage in post above, notice the ‘ispring’ key in there.

    Ispring is an Elearning authoring tool similar to Articulate that I know you are familiar with. Their ‘resume’ feature works by writing out a JSON formatted text string that stores progress (ie “lastslideviewed: 5”, etc).

    Of course since every Ispring “app” runs off the same cookie cutter template, restoring the app to where the user left off (last viewed slide, what links have been clicked, etc) is a much simpler scenario compared to say a custom Verge app.

    Articulate is a much more robust authoring tool that allows for variables, custom javascript, custom object states.. More moving parts means of course means more data for the save/resume function and from what I can tell, they actually run their ‘resume string’ through compression before storage.

    Which makes sense, as I know from experience that string size can get beefy really fast.( In case you missed it on separate post, I mentioned the major bonus of upgrading from SCORM 1.2 to SCORM 2004 is the ‘suspend data field’ (on the LMS) goes from a limit of 4096 characters to 64,000 characters)

    I believe the max size for local web storage 5 megs per app, so plenty of space there. B-)

    #54455

    Hi,

    Indeed, having local storage supported in Puzzles would be very useful. Making it a priority task.

    Regarding SCORM 2004, we should consider adding this standard to Verge3D as well. :scratch: The strange thing with it, however, I can’t say exactly what open-source LMS-es support this standard. We used Moodle to test our e-learning Puzzles, but the developers of this system stopped working on SCORM 2004 long time ago. Perhaps you have some LMS in mind that you can recommend?

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #54477
    Crunch
    Customer

    Alex.. actually, after doing a little research & thinking about, its not strange at all why open source LMSs (ie moodle) don’t bother with SCORM 2004 support.. ‘upgrading’ SCORM is akin to trying to “polish a turd”.

    Moodle apparently developed its own proprietary format for content development that breaks the chains of SCORM standards and thus opens the door for them to make a better experience for creators and learners. Makes total sense to me. Being an open source LMS platform operator, they have that luxury.

    So I am retracting my request for SCORM 2004 support in Verge and exchanging it with a BETTER IDEA.

    Before I get to that BIG idea.. in regards to the limitation on the suspend data field..(even the 64k that 2004 provides still sucks) I know the field size can be expanded from the LMS side (SCORM cloud allows you to tweak it), but there really is no assurance any client LMS you deliver a SCORM app to will have their admins make such accommodations. However where I am going with this, “we don’t need no roads”

    Aside from simpler work arounds like splitting the resume string up and shoving it into unused LMS fields (like the comments field), I came up with a possible workaround that opens the doors to other features.

    First I rewired your Elearning box demo so it saves and resumes from where the user leaves off. Nothing fancy there and I did a messy job (see screenshots)…just a proof of concept that Verge SCORM 1.2 puzzles provide everything needed for creating very advanced SCORM modules.

    I further modified it (not shown in any of the ss) to be able to also save and load a resume string from an external server (via ajax call)… well almost. My ‘external’ server I got it working on was still local.. when I uploaded to SCORM Cloud to test, it threw a Mixed content error as their Cloud is https and my local server’s SSL is no longer setup..doh..

    I will save sharing my BIG IDEA for later after some more testing.. but before I do, does anyone with LMS/scorm experience see any pitfalls so far with being able to save and pull data from external servers (that I control) from within a SCORM module hosted on an LMS server (that I have no control over)?

    I think I am still concerned over cross-domain issues.. My first attempts at sending and receiving data from my external server got blocked, but I was able to modify the headers on my scripts to Access-Control-Allow-Origin* which fixed things. Still worried I am missing something…

    Any input appreciated, thanks!

    Attachments:
    You must be logged in to view attached files.
    #54498

    Interesting idea! It’s definitely worth thinking about it :scratch:

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #54536
    kdv
    Participant

    After exporting to JSON and parsing from JSON the object looks like this

    Any ideas how to convert this object to a normal Object3D? Some kind of fromJSON() is needed )))

    Indeed, having local storage supported in Puzzles would be very useful

    The best solution to realize an app’s state saving/loading. It would be possible to save _pGlob.states[0] and restore this state on loading…

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #54564
    kdv
    Participant

    A draft variant of the save/restore system based on GLTF export/import )))
    https://v3d.net/9vj
    Materials should be MeshStandardMaterial. MeshNodeMaterial is exported as MeshStandardMaterial (glTF 2.0 compatible)

    p.s. Four cubes are draggable, two of them are hidable.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #54865
    kdv
    Participant

    A fully functional demo that can save/restore all made changes. No limitations with materials. It can restore the main camera position and direction, all geometry (including appended scenes), objects visibility, outlined objects and annotations. It just restores the saved state )))
    https://v3d.net/a4k

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #56664
    Crunch
    Customer

    Woah!! KDV, that is awesome!!!!

    I got pulled away from board and only today came back to this thread.
    For others who missed it, check out KDVs demo app which allows for saving an apps state then reloading in the exact same state you left it.

    https://v3d.net/a4k

    KDV, so using Verge Storage key puzzles, you could basically stuff that ‘.sav’ into a local storage key, and have things setup so when the app loads, it will check for that key, if found, loads and restores the user session? Pretty sweet!! Nice work, thanks for the high quality contributions!! :yahoo:

    #56668
    kdv
    Participant

    you could basically stuff that ‘.sav’ into a local storage key

    No, localStorage is not used. It can store string values only and it’s too small to store some serious scene. All parameters are exported into .gltf file and then restored from it.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #68595
    meumobbi
    Participant

    you could basically stuff that ‘.sav’ into a local storage key

    No, localStorage is not used. It can store string values only and it’s too small to store some serious scene. All parameters are exported into .gltf file and then restored from it.

    That’s pretty impressive! Could you give us mortal non-coders maybe a little bit more to go on? Would it be possible to see the puzzles to try and figure out how you accomplished this?

    Thanks!

    #68602
    kdv
    Participant

    In general, that’s an individual task depending on what exactly you want to save/restore.

    Here’s a simple set of puzzles to save/restore objects’ position/rotation/scale

    Link to zip https://v3d.net/q7q

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.