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

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 #30 on: 2012-01-13, 10:16:18 PM »
The TestCollisionMask and the modulate alpha/colors made me feel kind of down, but at least there's more than enough for a game!

So 'soon' means that there will be support, but 'no' means it will never be included?


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 #31 on: 2012-01-14, 07:00:41 AM »
No doesn't mean never.  It just means I don't know if/when it will be included.  I might put all the "Soon" items in for this release and look at many of the "No" items for next release.  Or put all the Soon functions in the next release and some "No" items in the release after.

Why are the color modulation functions so interesting to you?  You can still make frameset frames that are based on color/alpha modulations of graphic sheet tiles (the code can pre-render those); you just can't modulate colors in real time (HTML5 unfortunately doesn't seem to support it).

And do you feel like TestCollisionMask is so important and TestCollisionRect won't suffice?  If so I can consider that sooner (after the other "Soon" functions) to see if it's feasible in JavaScript.

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 #32 on: 2012-01-14, 09:32:39 AM »
Ack no no... My earlier compliment.. came off extremely blunt, I apologize, I'm in no way saying those functions are the "bread and butter" of a game, but  superfluous..

It's hard to explain my desire for either of those functions, because my game uses both heavily (Players choose the color of skin and clothing, hair, eyes etc at runtime- and collisions to detect if all movable joints are within a players 'bounding box', and attached to each other to form a body, although the bounding box actually does the collisions.)

I can make every body part, hair, clothing accessories,eyes, etc in every color, and I can always switch to single sprite animation rather than bone based animation, although a collision rectangle wouldn't do much to the end result.


tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #33 on: 2012-01-14, 12:27:06 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.

I'm not sure exactly how to do that, so I looked around my tools and found "Web Developer". So, I assumed it could be the debugger. When running the page again, I got this:

Code: [Select]
[10:25:07.496] GET http://sgdk2.enigmadream.com/ben/JavaSample.html [HTTP/1.1 304 Not Modified 65ms]
[10:25:07.624] Unknown property 'user-select'.  Declaration dropped. @ http://sgdk2.enigmadream.com/ben/JavaSample.html:8

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 #34 on: 2012-01-14, 02:40:16 PM »
I'm not sure exactly how to do that, so I looked around my tools and found "Web Developer". So, I assumed it could be the debugger. When running the page again, I got this:

My wife (who has done more recent work with FireFox and is taking web classes) says FireBug is a plug-in for FireFox useful in debugging JavaScript.  Give that a try.

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 #35 on: 2012-01-14, 02:59:48 PM »
Ack no no... My earlier compliment.. came off extremely blunt, I apologize, I'm in no way saying those functions are the "bread and butter" of a game, but  superfluous..

No worries.  I'm trying to keep in mind that I don't necessarily have a full awareness of the most valuable features of SGDK2 since my use of the engine is somewhat limited. So as a result I try to take the comments I do get seriously; try to gain whatever awareness I can about what features are important especially when in the process of choosing among which features are going into an upcoming release.

And if your project is using the features, it's a good source of information.  Knowing how your project would be affected by the lack of these features could be important to other people planning similar projects.  So with that in mind, I can think about what alternatives this kind of project would have.  For customizing colors, you might have the options of:
1. Limiting the range of colors available to the player when customizing the color, and rely on different colored frames instead of color modulated sprites.
2. Manually applying the color modulation function that the HTML5 framework uses to modulate frame colors.  Apply it directly to the graphic sheet instead of while drawing if you don't need to be constantly changing them.  Perhaps functions like "ModulateCellRed", "ModulateCellAlpha" could be provided to permanently modulate color in a graphic sheet (until the page is re-loaded).

As for collision masks, if I find that more games are wanting to detect collisions at the pixel level, I should have a try at implementing the collision mask functions.  If you have individual bones at different angles that want to detect collisions because they are not aligned with the rectangle they are in, perhaps we could make a different rectangular collision function that can detect collisions between *rotated* rectangles.  Or maybe if the components are small, pixel detection *is* the best way to go.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #36 on: 2012-01-14, 03:53:22 PM »
I'm not sure exactly how to do that, so I looked around my tools and found "Web Developer". So, I assumed it could be the debugger. When running the page again, I got this:

My wife (who has done more recent work with FireFox and is taking web classes) says FireBug is a plug-in for FireFox useful in debugging JavaScript.  Give that a try.

Alright. I'll get back to you on that as soon as I can.

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 #37 on: 2012-01-14, 06:08:44 PM »
Quote
1. Limiting the range of colors available to the player when customizing the color, and rely on different colored frames instead of color modulated sprites.
2. Manually applying the color modulation function that the HTML5 framework uses to modulate frame colors.  Apply it directly to the graphic sheet instead of while drawing if you don't need to be constantly changing them.  Perhaps functions like "ModulateCellRed", "ModulateCellAlpha" could be provided to permanently modulate color in a graphic sheet (until the page is re-loaded).

Heh, I could never go wrong with color palettes. It makes more sense than the loads of questions I'll get when my game is released, like "Hey, why can players choose to have green or purple skin and hair?"
I'm sure I could also rotate rectanges, that would actually be perfect!

But a browser version is far from now, I'm still in the process of trying to get a functional Master Server online, (It's actually much more fun and more importantly easier than I thought it would be!) and If I did infact get a browser version running, it would be a "Try a Browser Demo that lacks User Accounts before downloading" since I don't want to have to drive my hosting into the ground from multiple users driving up the CPU usage.

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 #38 on: 2012-01-15, 09:50:28 AM »
Alright. I'll get back to you on that as soon as I can.

Never mind -- I found out the same problem exists here too, and probably for everyone using FireFox.  I am going to post a question on stackoverflow.com and see if someone there can help me since it seems to affect all FireFox users.

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 #39 on: 2012-01-15, 12:34:49 PM »
The Firefox keyboard event problems have been resolved in the 2.2.1 release.  (Had to use scripted event handler setup instead of event attributes.)  The sample HTML5 project has been tested successfully on IE, Chrome and Firefox.

tprime

  • Fanatic
  • ***
  • Posts: 395
    • View Profile
    • Email
Re: Upcoming SGDK2 Implements Rules in HTML5
« Reply #40 on: 2012-01-15, 02:44:23 PM »
The Firefox keyboard event problems have been resolved in the 2.2.1 release.  (Had to use scripted event handler setup instead of event attributes.)  The sample HTML5 project has been tested successfully on IE, Chrome and Firefox.

Awesome, thank you. :)

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 #41 on: 2012-01-15, 08:21:54 PM »
Oh, this may not be important, but I didn't realize this entire time I was using Opera.

Well, it works fine in Opera - for all the Opera users. :)

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 #42 on: 2012-01-16, 07:22:35 PM »
A couple of suggestions for friendliness:

Remember settings in the Export to HTML5 code.
Either add another button to the toolbar or another option in the play dropdown button to run the game in HTML.
Add an option when exporting as HTML to export sprites and maps as their own js files, just like the C# version (for better debugging of individual sprites)
Pressing the Save button seems like it should actually save.  Probably you don't need the output filename as a field on the form, just show the dialog when you hit OK.
« Last Edit: 2012-01-16, 07:54:52 PM by durnurd »
Edward Dassmesser

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 #43 on: 2012-01-16, 08:14:35 PM »
Found a bug in "blocked" in the "Up" case.  It calls this.floor where it should call Math.floor.
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 #44 on: 2012-01-16, 10:09:01 PM »
Add an option when exporting as HTML to export sprites and maps as their own js files, just like the C# version (for better debugging of individual sprites)

How does having the sprites in a separate js file help debugging?

Pressing the Save button seems like it should actually save.  Probably you don't need the output filename as a field on the form, just show the dialog when you hit OK.

Are you implying something doesn't save when you press the save button?  The project saves when I click the save button.  I think I'm misunderstanding something.

The reason I have an output field on the form is in case you want to export the HTML before saving the project (there will be no default output name in that case).  It doesn't seem to interfere or even be an extra step in the process, and it gived you more control in case you expect (with good reason) that the term "export" means you get to choose where the output is going.

Good suggestions about remembering the export settings and having a button to run the HTML.  I'll try to remember to investigate those.  But I assume I have to write a file in order to run the HTML.  So do you suggest that operation displays the export HTML dialog first?

Found a bug in "blocked" in the "Up" case.  It calls this.floor where it should call Math.floor.

Thanks.  How did you notice that?  Are you testing all my "Untested" functions or just working on a project that randomly encountered this?