Scrolling Game Development Kit Forum

SGDK Version 2 => News and Announcements => Topic started by: bluemonkmn on 2011-10-23, 04:09:11 PM

Title: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-23, 04:09:11 PM
Take a look at what the next version of SGDK2 will do for you: http://sgdk2.enigmadream.com/ben/IsoSample.html (http://sgdk2.enigmadream.com/ben/IsoSample.html)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: SmartBoy16 on 2011-10-23, 06:26:02 PM
I can see a big potential for this, since I can't think of any HTML5 editors at the moment. Nice job!
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: tprime on 2011-10-24, 11:18:39 PM
Looks awesome.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-26, 05:47:31 AM
Whoa!  That's impressive!  When did you start working on that secret project? :)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-26, 01:39:49 PM
I think I started the real work last Saturday and finished Sunday.  Programming these days is so much easier than it used to be!

BTW, Vincent, I got your whole LOK Revival project to output a page with all its maps visible and scrollable!  There are dozens of buttons (which the generator puts on the page) to switch between maps, and they all work (after a few additional adjustments to handle offsets correctly).  The file size is 32 MB.

Now I think I need to add support for the sprites.  Not the rules, just drawing the sprites in their designed positions and states.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-26, 01:42:23 PM
 :o Whoa!  Can you upload the page somewhere so I can see this?  If LoK:Revival worked in HTML5, that would be incredible!!!
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-26, 02:48:37 PM
It's 16 MB 7-zipped and 32 MB un-zipped.  Would you rather see it posted in zipped form or unzipped?
Keep in mind, this is just the maps and no sprites at this point.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-26, 03:07:44 PM
I posted the unzipped version at http://sgdk2.enigmadream.com/ben/LokRevivalHtml5.html (http://sgdk2.enigmadream.com/ben/LokRevivalHtml5.html).
You'll probably want to save that instead of navigating to it.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-26, 08:08:10 PM
That's absolutely amazing!  All maps and all layers are there. :)  At 32 MB, is everything contained?  (even if the sprites don't show up, are they included?)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-27, 06:59:48 AM
The graphic sheet images for the sprites are there (which is probably most of the size), but the data structures for representing the sprite states are not yet.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-27, 07:05:22 AM
Can't wait to see the next steps :)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-29, 06:06:28 PM
I got sprite definitions into the mix, and now sprites are drawing.  No rules, but you could probably go and edit the script to add your own rules in JavaScript form, and you might be able to make a simplistic game with complex sprites and tiles.  I uploaded an updated (zipped this time) version of the LOK Revival HTML to http://sgdk2.enigmadream.com/ben/LokRevivalHtml5.7z (http://sgdk2.enigmadream.com/ben/LokRevivalHtml5.7z).  Oh, the sprites are always drawing on top of all the tiles on the layer right now.  I didn't do any work to make the sprites draw behind or between the tiles when appropriate.

I don't remember if it was slow before, but I'm noticing now that drawing/scrolling around the maps is slow, even though other projects with bigger views draw faster.  I'm not sure why.  But I'm done fiddling for today.  Maybe I'll figure it out later.  If anybody knows, you could save me some time.  I don't know if there are tools for easily checking performance issues in JavaScript.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-31, 06:02:21 AM
Hum, I don't see the problem with scrolling.  It works just as fine with this version as it did before.  I load the file locally with Firefox 7.0.1.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-31, 01:20:01 PM
How fast does it scroll?  For me, on some of the larger maps like the cave map near the beginning of the list, I think it was only updatng once or twice per second.  Is it faster for you?
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-10-31, 06:48:27 PM
I tried all the first maps (from ELBoss to ELPillarsGood, then skipped the Endings maps that don't show much since there is the white screen sprite, then tested HDBoss to HDLifeUp), so I guess I must have seen the map you tested.  It works very well for me, the display is smooth and the scrolling too.  The map follows the mouse almost in realtime, it's not easy to see the delay.  Unless I'm not scrolling the way you are?  I simply click with the mouse in the map and then drag around.  But the memory usage is violent, around 700 megs for Firefox to manage SGDK2 forum, Hotmail and LokRevival.htm at the same time.  Is that helping?
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-10-31, 08:28:39 PM
I am using Chrome.  I will have to re-run a FireFox test.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-01, 05:18:59 AM
Wow, I'm running FireFox on a little laptop and Chrome on a powerful desktop, yet FireFix outperforms Chrome by a lot!  I wonder why.  I posted a question about it ar http://stackoverflow.com/questions/7965592/html5-canvas-slow-on-chrome-but-fast-on-firefox (http://stackoverflow.com/questions/7965592/html5-canvas-slow-on-chrome-but-fast-on-firefox)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-11-01, 05:54:35 AM
Huh, I didn't know there were such huge performance differences between the two browsers.  I usually use Firefox because of Firebug and then I validate the final display of the page with other browsers, such as IE6, 7, 8, 9, Opera, Chrome and Safari.  I never noticed performance issues...  But then again, I never used HTML5.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: SmartBoy16 on 2011-11-01, 05:32:14 PM
Wow, I'm running FireFox on a little laptop and Chrome on a powerful desktop, yet FireFix outperforms Chrome by a lot!  I wonder why.  I posted a question about it ar http://stackoverflow.com/questions/7965592/html5-canvas-slow-on-chrome-but-fast-on-firefox (http://stackoverflow.com/questions/7965592/html5-canvas-slow-on-chrome-but-fast-on-firefox)

It might be because Chrome uses a lot more memory than other browsers, which may explain why it runs faster is because it allows itself more memory to work with at once. I learned that quickly since I noticed that games like Team Fortress 2 lagged a lot more when Chrome was running.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-01, 08:30:59 PM
Chrome is the one that's running slower.  And it's using less memory than FireFox at the moment.  Where do you get the impression that Chrome uses a lot more memory?
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: SmartBoy16 on 2011-11-01, 08:47:32 PM
Oh....I haven't actually tested this out myself. Maybe it's because I usually have 5 or 6 tabs open at once and some usually run flash too.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-05, 10:20:10 AM
Good news:
As I was investigating Chrome's slowness I discovered some inefficiencies to clean up in the code generated from the LOK Revival project.  Mostly it's summed up by the rule: don't store and draw 100% transparent frames.  That improved the performance a bit.

Even much better news:
As I was fiddling with scrolling around one of the maps, I stumbled into a mode where the mouseup event was not processed and boom incredibly smooth scrolling was happening as I moved the mouse around without holding down the button!  So I disabled the mouseup event allowing me to always scroll the map around without holding down the button.  Lo and behold, it scrolls very smoothly as long as I'm not holding the button down.  But as soon as I hold the button, it lags severely on each frame.  I have updated my posting at stackoverflow.com with the details.  Hopefully I can get to the bottom of it.  But I don't think it even matters terribly because most high frame rate games probably won't be primarily using mouse dragging.  So I think we got some great performance here even on a huge complex project like LOK Revival!
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-11-05, 02:16:24 PM
Hey!  That's great news!  I'm with you on this, if Lok:Revival runs smoothly, I guess all games will (since I didn't spent optimizing the game and since it's pretty huge).  ;D
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-13, 07:22:28 PM
Scrolling Game Development Kit 2.2.0 has been released with (limited) HTML5 support.  You can view and scroll around all your maps, and all the sprites, solidity and tile categories and animations are available, but since the rules aren't you will have to manually add JavaScript code in order to interact with your game beyond the default scrolling around the map.  Before I make a larger announcement, would any of you care to download the latest version and share any comments you have about the process of finding, downloading or using SGDK 2.2 and its new HTML5 output feature?  Then I can post any further important information along with my initial announcement in order to give users a better first-time experience.  I think this is a big one, folks.  HTML5 is a big deal for SGDK2 I think -- now you can use SGDK2 to make significant progress toward designing and developing games that work on iPad and other mobile devices! So I want to get this right on the first try and not have users walk away due to a bad first experience.

It may be that this ends up just being the "preview version" to something more substantial where rules are actually implemented in HTML5 also, or where there's detailed documentation provided on how to turn your SGDK2 project into an HTML5 game.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-14, 06:05:22 AM
Oh, here's what the new menu looks like.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-11-14, 05:56:49 PM
I tried it with LokRevival, but somehow it doesn't work.  Did you modify the LokRevival project to make it work?  When I export to a single file, the page loads up but I can't scroll and the buttons do not switch the map. (hum, maybe it's possible to scroll, but the first map that loads up is small, so maybe only the buttons are broken.)

I like the fact that you can export to many files.  It's a good thing for anyone who wants to patch only a part of the project without making a full release.  But when I tried it with Lok:Revival, the page doesn't load up properly, I get an error message about local files.

It would be nice also if you can export to a subfolder so the HTML5 projects isn't mixed up with a normal project ressources.  It can be annoying to split all the files manually.  Or simply add the option: clean up and export.

I think I would implement rules to javascript before making an announcement.  It would be a powerful tool and much more interesting than rewriting a game with javascript.  :)
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: durnurd on 2011-11-14, 08:40:54 PM
Looks pretty nice.  I tried it with TVSGDK2, and it worked pretty well.  There were some oddities when viewing with a full window and changing the browser's size, but that's probably "not supported" anyway.

One thing I would suggest is changing the export flow. If I want to change from fixed size to full screen, and toggle generation of buttons before exporting, that requires navigation through the menus three times.

My suggestion would be to instead make it another form, and also allow the user to select the location of the file/files to go, rather than just place them in the project directory.  I was fully expecting a dialog asking me where to save it, but nope.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-15, 06:04:08 AM
Thanks.  Of course that requires modifications to the software, not just additional comments on the announcement.  But maybe it would be OK to update the files before announcing the release.

The reason I put it all in the menus (and I agree it's cumbersome if you want to change all the options) was simply because I didn't want to introduce a whole new form with its own help page.  But it's probably the right thing to do.

Odd it didn't even occur to be to prompt for where the output file(s) should go.  I just assumed it was going to be similar to compiling.  But now that you mention it, it is more like an export.  It wouldn't be hard to prompt for a target location.

Got any ideas for a slick sample project to attract some attention?  Need something with parallax scrolling, animated tiles and translucency.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: durnurd on 2011-11-15, 08:52:06 AM
If you're just looking for a map that looks good for scrolling, wouldn't the sample project work well?  Or are you thinking something more expansive?

As for difficulty of finding, etc... I'm used to it by now but most apps don't let you just extract all the files and be good to go.  You usually have to go through some sort of installation process.  You may want to include a readme or mention something about how it's self-contained and you don't need to install anything, which is a plus for most people.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: v6v on 2011-11-15, 03:57:04 PM
Would it be possible to load a savegame via browser?
I would love for people to go to my game's site and see what players are on a current map at any given time, even if it's only a snapshot that appears when the page is loaded..
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-15, 07:27:50 PM
If you're just looking for a map that looks good for scrolling, wouldn't the sample project work well?  Or are you thinking something more expansive?

I'm looking for something that would only require a little bit of additional work to turn into a cool-looking and possibly fun game playable on an iPad.  Something to get someone's attention enough that they'll want to try the same thing.

Would it be possible to load a savegame via browser?

It would not be easy to load a savegame saved by a true SGDK2 game into an HTML5 version of the "game".  And there are no save/load game features available for the HTML5 projects yet.  But I expect there will be.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-16, 06:50:11 AM
I think I will use this as a sample of the new feature:

http://sgdk2.enigmadream.com/ben/Html5Sample.html (http://sgdk2.enigmadream.com/ben/Html5Sample.html)

There are still a few bugs to work out of reactToSolidity, and the level is incomplete, but I think it's a good visual demo.  Also, in IE I just noticed some graphics have some garbage around the edges like there's a rounding error in drawing the tiles.  Ah well, it's a problem for later.
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: Vincent on 2011-11-16, 06:53:51 AM
It looks good to me!
Title: Re: Upcoming SGDK2 Outputs HTML5
Post by: bluemonkmn on 2011-11-16, 07:06:52 AM
I have posted an updated version of SGDK220.zip on SourceForge.  I will start posting announcements soon.