HTML5 Engine Updates 2022-05-24

adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,059

Misc updates for the HTML5 engine released today. Some were released earlier, but just being documented now.

  • Table updates from network request actually notifies rule predicates of update.
  • Fixes to custom collision shapes.
  • Load music into AudioBuffer instead of playing from a Music tag.
  • Control music volume through Web Audio API. Also ensures music volume is properly adjusted in safari.
  • Run keyup events for all keys that are down when the Keyboard Input is triggered to match behavior in native engine.
  • Fix joystick disconnect detection.

Advanced / experimental features.

  • device.clock.epochTime: returns number of milliseconds since Unix Epoch. Great for figuring out elapsed time. Available on in HTML5 engine and Creator 2.0 for now, but will make it's way to native engines eventually.
  • For send table to URL, process the response's "updated" field to update table (untested).
  • Allow for changing table from javascript API like we allow for attributes.
  • Allow for changing an asset's image URL so you can dynamically load images into actors.


Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    I am particularly happy to see epochTime and keyup events. Also improved custom collision shapes!

    Thanks GS team!

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,059
    edited May 2022

    Just pushed an update to fix an issue with font rendering. Fonts may not be as sharp on retina devices as the previous version, but the rendering actually correctly matches 1x pixel devices.

    The fix is for an edge case where the engine would screw up fonts if you used a div / iframe exactly half the size of the game, which would cause the spacing of the text to be off.

  • The GlessnerdThe Glessnerd Member Posts: 63

    What can the epochtime be used for exactly?

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,059

    You can use epochTime it as a timer. For instance, I can use it to check the length of a game session.

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,059

    Also we updated then engine so it only loads music into a buffer on Safari and iOS browsers, since those have the bug that necessitate the preloading. Otherwise, they're running from a hidden <audio> tag to avoid taking up extra memory.

  • The GlessnerdThe Glessnerd Member Posts: 63

    @adent42 nifty! As an aside, are the publishing servers down again for the web creator? Ive had a project stuck in "RC Build Pending" for a hot minute now. Thanks!

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,059

    @The Glessnerd , can you DM me your publishing link. Also for faster service, check our support team via the blue chat bubble. Thx!

  • The GlessnerdThe Glessnerd Member Posts: 63

    I guess i just dont know enough about it, but what forumula could be used to track total play time exactly? The number returned was crazy (something like 1654744816)

  • adam36021adam36021 Member, PRO Posts: 45

    you can store the epochTime in to a variable at launch. Then you can subtract that variable from the current epochTime, and you'll be left with the current play time.

    Handy. For example, the game.time pauses when the application is not in focus, so if you wanted to create some sort of idle / clicker game, this would be useful.

  • DebraWrightDebraWright Member Posts: 1

    Thanks :)

Sign In or Register to comment.