Author Topic: Upcoming SGDK2 Implements Rules in HTML5  (Read 322993 times)

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #15 on: 2012-01-08, 03:42:58 PM »
Wow, there are just a lot of functions to implement.  I finally got enough implemented for the sample game to work: http://sgdk2.enigmadream.com/ben/JavaSample.html.  I need a break!  I'll be back another day to update the documentation and release the SGDK2 code that created this.

2 notable limitations: No multi-view games (2 player mode does not show a split view) and no sound.  Also, I realize the sample game doesn't do any sprite collisions except for the platform, so the sprite collision functions are still not implemented.  But really I just wanted to get enough implemented for the sample game to work for this release.

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #16 on: 2012-01-08, 07:13:09 PM »

I'm guessing the JavaSample means JavaScript :) Multi-view is nice, but the current features I see are impressive enough! Honestly, this seemed to be alot of work, and an impressive sample output.

Sound can always either be implemented later, and although collisions are also important, this is still an impressive release.

If anything, these sample game posts should be considered teasers- they get people excited enough and want to hang on even longer for the release. :D

Impressive sir!

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #17 on: 2012-01-11, 06:17:21 AM »
I just discovered that the sample runs *much* more smoothly (consuming much less CPU) if we don't have those transformed tiles in the background:
Compare the new faster http://sgdk2.enigmadream.com/ben/JavaSample.html to the original http://sgdk2.enigmadream.com/ben/JavaSampleo.html.

Vincent

  • SGDK2 Addict
  • Expert
  • Fanatic
  • *****
  • Posts: 612
  • Legacy of Kain: Revival is completed!!!
    • View Profile
    • Chivalrous Games
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #18 on: 2012-01-11, 07:22:07 AM »
I didn't monitor my cpu, but to the human eye there is no difference.  It runs very smoothly for me (Firefox). :)
Legacy of Kain: Revival completed!
http://lokrevival.webs.com

See also my company website:
http://chivalrousgames.com

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #19 on: 2012-01-11, 10:43:04 AM »
For me, in Chrome on my high powered desktop, the slow version runs smoothly, but not as fast as the compiled sample program as an EXE (which sets LimitFrameRate at 80 fps).  LimitFrameRate is used in the HTML5 code to determine the parameter for setInterval, the function that tells JavaScript to call a function periodically every X milliseconds.  So if the CPU hadn't hit its limit, the game should run at the same speed in a browser as it does in a compiled EXE.  When I run the other simplified version, it runs fast even in a browser.

I tried on my laptop where I have FireFox installed too.  There, both the old and new versions run slower than the compiled EXE, and the slower one is noticably slower.  On my desktop in IE, the performance is similar between the 2 versions.  I think it still runs slower than the compiled EXE (although very smooth), and the old version runs slightly slower than the simplified version.  I have not verified this -- just visual reaction.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #20 on: 2012-01-11, 03:51:20 PM »
The new samples won't accept my keyboard inputs.  :no:

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #21 on: 2012-01-11, 05:05:11 PM »
It's all well and good, until you try it on a Mac with multiple desktops enabled, where [CTRL]+[Left/Right] switches desktops.  Kinda makes it hard to see where you're going :)
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #22 on: 2012-01-12, 05:36:48 AM »
The new samples won't accept my keyboard inputs.  :no:

You can't even use the menu to start a 1-player game?  Were you able to interact via the keyboard before?  I haven't seen that behavior anywhere on any of the browsers I've tried.  What OS and browser are you using?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #23 on: 2012-01-12, 05:41:54 AM »
It's all well and good, until you try it on a Mac with multiple desktops enabled, where [CTRL]+[Left/Right] switches desktops.  Kinda makes it hard to see where you're going :)

What default key layouts do you suggest?  Try a few out.  Search for "key.Up" and you will see the block of code that sets the default key layouts.  Search for "PageUp" and you will find the list of all available Keys.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #24 on: 2012-01-12, 12:59:46 PM »
The new samples won't accept my keyboard inputs.  :no:

You can't even use the menu to start a 1-player game?  Were you able to interact via the keyboard before?  I haven't seen that behavior anywhere on any of the browsers I've tried.  What OS and browser are you using?

It was not able to start at all. I was able to interact with the first demo you had announcing HTML5 support.

I'm using Firefox and Windows 7.
I'll see if I can update Firefox and try it on Internet Explorer.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #25 on: 2012-01-12, 01:02:53 PM »
It works fine on my Internet Explorer. And I do not need an update on the firefox browser. (I think).

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #26 on: 2012-01-12, 07:06:37 PM »
Do you know how to debug Javascript in FireFox?  Can you determine if the "keyboardState.handleKeyDown" function is being called?  Anybody else that can reproduce this problem?  I know I've tried Firefox on Vista, and I think Vincent tried Firefox too and it worked for us.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #27 on: 2012-01-13, 08:02:45 AM »
I would suggest any layout that doesn't use ctrl or alt.  those are really the only two that would cause problems.  Or maybe there's a way to capture those and not pass them on to the OS.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #28 on: 2012-01-13, 02:08:23 PM »
Bah... leaving the thinking up to me.  Okay I'll have to think of something manually myself then ;).  Maybe I'll just swap Ctrl and Space so Space is the more frequently used button, or the one most likely to be used in conjunction with the others.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #29 on: 2012-01-13, 06:10:11 PM »
I have summarized the current state of all the rule functions available in SDGK2 and published it on the web.  Next step is to implement or remove the unsupported functions from a copy of the sample project and make that a new HTML project template.