Doverseer's Forum Posts

  • Its been a while since I used C2. but I started updating an old game and I found and I couldn't delete save game either (easily anyways..)

    I found a work around if you want to delete the entire save database for the game. Use the Browser object and execute the javascript "window.indexedDB.deleteDatabase('_C2SaveStates');"

    I haven't found an easy way to delete individual keys from the "saves" objectstore.

  • Right. its a chrome specific problem right now. I know scirra will have to update webstorage soon. Hopefully they use the Chrome storage sync api because it looks very easy to implement. Ill start on a demo extension to prove it.

  • Ok. It seems the save/load objects system in C2 already uses indexdb but webstorage uses localstorage. Chrome.sync is preferred for the packaged apps though. Id be willing to help make an extension for it. Anyone else wanna help code this extension?

    I also doubt google will bring localstorage back to package apps because security and it could slow down the browser/os

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Is there any alternatives to webstorage that use indexdb or chrome.storage to save instead of localstorage? LocalStorage cant be used for a offline chrome packaged app.

  • After doing some research.. New Chrome App can use IndexDB api which is what Construct 2 uses for its game save system. But the WebStorage Object uses LocalStorage Api which breaks a New Chrome App. So if the WebStorage Object could create IndexDB(the same as the Game Save system) in addition to LocalStorage for compatibility. I think that would be great for developers wishing to migrate from LocalStorage to the superior IndexDB.

  • So I'm back at the hobby/business of making games, though I'm a little rusty. This is some background info on why this suggestion is needed.

    Contruct 2 creates the the legacy version of the chrome packaged app. So I decided to force my game to be a *new chrome app by changing the manifest and adding a background script. I put these links in the dropbox.

    Dropbox to manifest and main js

    Now when running test on my games it loads up as New chrome app in its own process and runs i think at its best.

    <img src="https://dl.dropboxusercontent.com/u/48269173/Construct2/dominoeffect.jpg" border="0">

    until... Local Storage is used.. that crashes my little experiment.<img src="smileys/smiley11.gif" border="0" align="middle"> New Chrome apps cant use Local storage, they have to use chrome.storage api because of changes to the security and design principles of packaged apps. So.. We need...

    Quick solution

    1. WebStorage plugin needs a property option to change the storage engine from LocalStorage to chrome.storage.sync or this could be done automatically by the exporter when choosing chrome Web store. This will benefit games greatly because data from games will be synced from device to device, not to mention all the other benefits of being a New Packaged App. Then Construct 2 should create New packaged apps for the chrome web store not legacy ones.

    Full Solution

    2. It would be great for all of the New chrome apis to be included in a single plugin or just the ones that benefit game design. I know that's a lot to ask. I'll try to help but i have to re-learn javascript just about.

    Chrome API index

  • So having WebGL as an Option, building two versions (one with WebGL and one without), and then merging those to use the same resources - Does anyone think this is a good idea or practice to implement? If not, why?

  • I think developers should just add WebGL as an option in their games, as of now. That way people with newer tech can experience WebGL if they want. Hopefully Chrome will find a better way to deal with WebGL soon.

    I'm on a older work computer right now, but I've tested WebGL on the dev channel for chrome 20.0.1123.4 dev-m and it still seems to be using a painful software render script.

    However on Chrome 20.0.1126.0 canary, it just defaults to canvas2d accelerated, it seems. I'm not sure if a test determined I cant Run WebGL and just skipped it, or if they just have it disabled completely. Good thing you added the fallback to Canvas2D. It seems WebGL content with no fallback result in a blank screen on this computer.. No warnings or anything. I'll have to do more testing when I get home. Link to canary below.

    http://www.chromium.org/getting-involved/dev-channel

  • I have updated the examples again. I might just create a tutorial if enough people find it beneficial. But basically in your game you provide webgl as an option if possible. The webgl version of your runtime and the html file only need to be copied to your original directory, so that both the canvas only script and the webgl script load from the same files. So what do you think?

  • I have updated the Post with examples of a good way - Just Providing WebGL as an Option.

    If HTML5 were to get the performance of a Native App, allot of work would have to go into the Security Design of the browser. But I can see it happening soon or at least getting better.

  • <img src="http://upload.wikimedia.org/wikipedia/commons/3/39/WebGL_logo.png" border="0">

    <font size="5">Its Great... But DON'T enable it from Configuration Settings yet, and here's Why..</font>

    Provide WebGL as an OPTION!

    WebGL is awesome it really is, when things are working properly. But (because of crappy video drivers and/or hardware) some Computers will render the WebGL content, but it is painfully SLOW and therefore the game isn't really playable, <font color="red">Resulting in a Closed window or Backspace - LOSS OF POTENTIAL LONG-TERM FANS OF YOUR GAME!!!!</font>

    So what can be done for Computers that can run WebGL, but really shouldn't be?

    1. Regular Website:

    If you have your own website a work around is easy. Build 2 versions (one with WebGL, another without). Have a start screen where the Person can also choose a button "Enable WebGL" which will open the URL using the browser object to where the WebGL version is (Open URL - "http://mydomain.com/game/webgl.html"). If it is slow they can simply backspace and choose to Play the Regular (canvas2D) version. Or on the start page, some type of testing can be done to determine if it can run GOOD WebGL, if not it will go to a page on your site where the Regular version is.

    <img src="http://darren.netne.net/images/webgloption.PNG" border="0">

    The Game is compiled twice (without WebGL and with it) into separate directories. Then we just rename the c2runtime.js file and index.html from the WebGL build to webgl.html and webgl.js. Then copy these 2 files where the regular version is. Make sure you change the source of webgl.html to reference webgl.js instead of c2runtime.js. Now there will be no loading time between switching webgl and canvas because they will both be using the same source directories for images and media - which will already be loaded into cache memory.

    2. Game on the Arcade:

    I have not done any testing. I do not know a work around, other than the icon trick mentioned below. Anyone have any suggestions or methods?

    3. Chrome Web Store?

    I have not done enough testing, I will report my results soon. In theory you should be able to use a method similar to 1. Regular website, but instead your Open URL action to your WebGL version would be something like "chrome-extension://YOURAPPID/webgl.html" if you are exporting a Packaged App.

    4. Other Exports.

    More testing needs to be done. Feel free to help.

    I tested a WebGL game on my friends computer and It was so painful to watch!, because of the above mentioned problem. I updated their driver, but it was still painful to watch. So I just disabled WebGL in Chrome using --disable-webgl on the chrome icon, and the game ran perfect under canvas2D. But most people who just want to play a game on the internet, wont think to change any icon settings; they will just close the page if its painfully slow. WebGL will continue to get better as time goes along. Maybe one day Chrome will give a message "Your computer isn't running the WebGL content well, Click OK to switch to 2D mode." which then will disable WebGL on the tabs process.

    Example:

    Edited Space Blaster Demo

    Edited Space Blaster Demo Source:

    Edited Space Blaster Source

    Note: The example is on a free web server, so i apologize if you get a server busy message.

  • Not sure if this is related to the other 'OR' bug but...

    If an on-Left-Click(object) condition is inside an OR block; You can click anywhere and it will seem as if you clicked the object - even though you didn't.

    Using:

    chrome

    19.0.1084.36 beta-m

    windows xp sp3

    Example:

    http://dl.dropbox.com/u/48269173/Construct2/r87touchORmouseBug.capx

  • I forgot completely about that, I will adjust my code to that style. Thanks.

  • Suggestions:

    Mouse Object -> Action -> Disable Mouse Input, Enable Mouse Input

    Mouse Object -> Conditions -> MouseObjectEnabled?

    Same with Touch, and Keyboard Object.

    WHY?

         In my game I added support for a Mouse and for Touch screens. To test that touch works I enabled the (use mouse input) property, and disabled all conditions with the Mouse. After successful testing, I re-enabled all the mouse conditions and then disabled the touch(use mouse input) property, and exported the game, because this works I believe.. I dont have a touch screen device for development as of yet to test it. If doing development this way a Mouse->action->disable_mouse would help out, and speed up testing, I can also see it being used in other ways of development also.

    Thank-you.

  • This is huge. Amazing. Never expected this to happen. Time to start Porting my games. <img src="smileys/smiley10.gif" border="0" align="middle" />