Update: HTML5 bug fixes

I just deployed a new update to the HTML5 version, with several bug fixes:

  • Timers have been completely rewritten to run as a part of the main game loop, so they will always stay synchronized. Previously, timers ran outside of the main game, so two timers both set to identical delays and started at the same time would not always trigger on the same frame - now they will. This means you can now do things like connect two timers to an AND gate and have it work reliably. As a side-effect of this change, timers will now pause when the game is paused.
  • Fixed: Once Trigger / Reset behavior. http://forum.flowlab.io/discussion/7279/once-trigger-is-broken-per-behaviors-described-in-users-guide#latest
  • Fixed: Density resets on reload fixed. http://forum.flowlab.io/discussion/6863/resetting-density-bug#latest
  • Fixed: Background objects sometimes interfere with game objects. I think I fixed this - I could never reproduce it, but I fixed a physics issue that could appear to have this effect, so I'm calling it fixed for now. http://forum.flowlab.io/discussion/6759/background-objects-are-no-longer-background-objects#latest
  • Fixed: Delete attached crashes game. http://forum.flowlab.io/discussion/7220/are-you-guys-able-to-play-my-game-cause-i-cant#latest
  • Fixed: Raycast doesn't work on capsules.

@Latif - I also tweaked the behavior window background to try and increase the contrast, so that behavior links are more visible in games with light backgrounds.

Please post in this thread if you have any issues with the update.


to reproduce the issue with the background objects is simple, create a new game, make a movable character and add a background object, only the first one placed is solid in the game world until reloading the page.

Also does this mean I have to fix all of my stuff using timers?

Hey @MagmaDude100 - I just tried the steps you described, in both Flash and HTML5 versions, and the bg object was not solid. I’m not sure what I’m doing wrong, but I cannot reproduce this issue.

Regarding timers: the update should not change the timer behavior in any way that would break your games, and you should not need to make any changes, unless you relied on having the timers running while your game is paused. If you do have an issue with the new timers, please post a description here (with a link), and I’ll fix the timers.

Regarding background issue, then I’m guessing the update fixed it? Unless you weren’t using the exact first background object created.
Timers: no, I genreally don’t have the pause options in my games, so thanks for relieving some stress

Thank you grazer!

I made a level to test if the timers pause and yes, its just HTML5.
This could help to prevent allot of objects to spawn in one spot while paused!
Thanks for the update grazer!

HTML5: http://flowlab.io/game/play/1186430?v=html
Flash: http://flowlab.io/game/play/1186430

EDIT: I just notice this breaks my loading screen illusion in one of my games, so be sure you don’t have a function where timers are used to unpause your games.

I’m surprised you decided to fix the timer. I remember bringing it up years ago, because all my animations were desynced. If we now have a global timer, I don’t have to worry about off screen nonsense happening, well, hopefully. It used to miss the que and I’d walk up to something that should have triggered, but it didn’t, or stuff was just off in general, like tiles not animating at the same time. Nice to see that fixed.

The timers update


Move around mouse to change direction, click to shoot, when you shoot the spinny things with the green plus in the middle, it’s supposed to randomly move to a different location in the map, but on HTML it freezes the game.

Bugs on HTML:
- Raycast Issue 1
Raycast doesn’t work on Objects with rectangles hitbox;
/I mentioned this on the last discussion. It is now confirmed and tested.

Bugs on both engines:
- Raycast Issue 2
Raycast doesn’t work properly on objects with capsule or circle hitboxes;

- Camera Issue
Camera behavior > First two “out” = don’t send negative values when moving;

- Expression Issue
(Not sure about this logic) Expression takes too long to calculate causing small (still bad) delays on results. Having multiple expressions will eventually create enormous delays;
= See Feature Request 1. =

- Messages System Issue
(Could be an issue with “Message” or “Mailbox” behavior) (Not sure about this logic)
Messages take too long to be received, causing small (still bad) delays on results. Having multiple messages will eventually create enormous delays;

Simulated Event, for example:

1.: Object 1 is extracting its X position;
2.: Object 1 sends the X value to Object 2 (trough messages);
3.1: Object 2 receives and uses the X value;
This process has already caused a delay.
And If:
3.2: Object 2, before using the X value, uses one or more expressions behaviors
=Will cause even MORE delay

Obs.: This system must work through messages in order to be functional on the multiple levels throughout the game.

Simple Feature Requests:
1. Adding a minus ("-") in to the Number block (Just like the “+” in)
/ This would give me the advantage to make simple calculations on real-time


This is some stuff I found today. I hope it’s not too confusing.

Oh, and since we are moving to html5 I think this is the perfect time to request again my beloved right click feature.
So, Could we have a… Mouse right click feature, please? :slight_smile:

I was gonna say right click could be an eraser for tiles, but then again, you could just add an eraser button next to the clone button.

You can delete multiple tiles with the backspace key so I don’t think that button would be necessary.

What I meant with the “right-click feature” was really using the right click as an in-game working key.

Ok, new update posted.

@PixelStudios your crash should be fixed, thanks for reporting

@PixelPizza -

Raycast issues 1 & 2:
I’m not seeing the RayCast issues. Here is a test with Capsule->Capsule, Rect->Capsule, and Capsule->Rect and they all seem to be working. What am I doing wrong? https://flowlab.io/game/view/1186949?v=html

Camera issue:
I’ll investigate, but I’m not 100% sure I understand.

Expression performance issue:
I haven’t benchmarked the expression recently, but it shouldn’t be that slow. Do you have an example where this is slowing your game down?

Message performance issue
Do you have an example of this? Messages are not usually “slow”, but there is a design trade-off that means that they can sometimes seem delayed. This has been discussed here in the forums before, but the messages are currently processed like this:

During the current frame, for each object, every trigger is processed, then its messages are processed. This means that depending on the order that each object is processed in, they could be processed like this:

Frame 1:
Object A: processes logic, and checks messages (empty)
Object B: processes logic, and sends message to Object A
Frame 2:
Object A: processes logic, and checks messages (now sees message from frame 1)

This means that some messages can be delayed for up to one frame, but this isn’t the messages being “slow” and they shouldn’t build up and slow down your game or anything. Messages are processed in two steps like this to avoid this problem:

Frame 1:
Object A: sends message to Object B
Object B: gets message, and sends message to Object A

If all of that were processed directly in order, there would be an infinite loop, and the game would stay locked in frame 1 forever.

I’ve considered re-wiring the messages so that they always get processed in the current frame, but I’m not 100% sure that the potential for easy crashes is worth it. I’m on the fence here.

Simple Feature Request 1
For subtracting from a number (feature request 1), can’t you just put a negative number into the input, or will this not work for your purpose?

Simple (?) Feature Request 2
I have added a “Right Click” option to the Mouse Click block’s settings panel. Not very well tested yet.

I understand that you can use backspace to delete stuff, but it doesn’t seem to work for my laptop mouse pad, I can’t move my mouse while I’m holding down the backspace key, and you can’t do that on mobile devices. A delete button next to the Clone button would be useful.

@grazer The gray lines though…


@Latif - yeah that’s a problem. I’m going to tweak that color to fix up the contrast.

Hey @grazer , so you know how you made those game examples? I was thinking, since of this update, that it would be a good idea to set up one for HTML5 with its updates to tell us how all of the new stuff works, with also a set example. You may not need to do this, but I’m just throwing suggestions out there.

@rcreger - unfortunately (or fortunately, depending on how you look at it) the HTML5 version is’t significantly different feature-wise from Flash.


Flash is just dying, so grazer spent a year rewriting the engine in HTML5. Everything works more or less the same. Some stuff couldn’t be duplicated perfectly, otherwise, there’s no difference. Future updates will bring new HTML5 exclusive features that Flash couldn’t handle.