Update: New Physics Engine

Thanks @grazer. The New update makes it way better. I did not like the drag in the first place.

@grazer
Couldn’t you make a mock drag with motor?

Yeah, that would work. Friction works in many cases where you’d want to slow things down as well.

I NEED drag, or something similar

@grazer Polygon hitbox seems to be off center, unless I’m doing something wrong.

asdf

Yeah drag is gone but aren’t drag and mass similar? I don’t know.

Drag made an object slow down on its own, mass makes something harder to change trajectory or stop something

@grazer Im in big need of a drag physic. The removal of Drag has made everyting in my game to just float around. Thanks in advance. Test My game to see what i mean http://www.flowlab.io/game/play/793955

Hey @“Mhx Ar” - that screenshot is showing a circle hit box, not polygon, unless I’m missing something obvious. It does look off center, but I’m not sure why - I’ll take a look.

@Battery, I checked out your game (awesome game, by the way, I want to play more when I get back to my office) and it seems like you need some drag for sure. Maybe the solution is just to add in a global drag setting.

The new engine doesn’t support per-object drag, but a global value should be easy enough to add. I really just need to find a good spot in the UI for it. I think this will work for your game, and hopefully for @CrimsonBlackGames as well.

@grazer (Tank you) I think I found a way to make some things less floaty, but if it’s not to much work a global drag setning would still be wery useful. :slight_smile:

@grazer it is a polygon, it is just taking the shape of a circle. The polygon hitbox is a lot more accurate than the circle hitbox, but it’s off center, so in game, I changed it to a circle for now, because the polygon hitbox appears to the top left of the object.

Hey @“Mhx Ar” - I looked at Soul.ar, and I’m assuming that the “Soul” object is the one we’re talking about? I changed it to a polygon, and it was a little off center, but not nearly as much as in the screenshot above for some reason.

When the object’s sprite is analyzed, the alpha channel is taken into account, so an object with a faded glow around it will probably not end up with the borders and position you expect. To solve this, you could remove the glow from the default sprite so that the borders are more predictable.

Also, keep in mind that a circle is the fastest collision shape (it can be checked just using distance), so if you’re concerned with performance, then it’s better to just use circles whenever you can.

@grazer I changed the soul to a solid white circle so it is no longer affected by the animation size, but it still is off center with polygon. I believe polygon acts odd if the object size is large, but the object image doesn’t fill the box.

Also, if in Play mode preview in the behavior editor, and hit OK instead of stop, it freezes the program.

@grazer The ramps are set to non-movable but they’re movable: https://flowlab.io/game/play/727096

Thanks for posting that, @Latif - Strangely they are not falling under gravity :confused:

I’ll fix it and post an update.

@“Mhx Ar” - I’m not sure I follow the polygon issue, but if you have an example of a sprite (with sharp edges, no glow/shadow/alpha fade) that isn’t lining up properly I can check it out. All the testing I’ve done seems to line up OK.

I think I know about that annoying behavior window issue - I think hitting escape to open the editor back up should sort it out?

Hey @Latif - the polygon shape moving problem has been resolved, thanks again for pointing it out and making an example :slight_smile:

@grazer I am not sure if I tested if hitting Escape gets you out of the frozen window, but if I had, it didn’t, and I just hit refresh.

As far as the polygon hitbox thing, I am aware of the glow, because I was aware of the original size, and I was aware that it was going to cause a problem with the hitbox being too big, which is why I turned it into a white circle, to make that the hitbox size, and the glow wouldn’t actually affect it. Here’s what I think happened. The original hitbox was correct when it was a 32 X 32 object, but then I uploaded an image that was much larger, but the image doesn’t fill the whole Space, so there’s a lot of empty air around the Soul image, and now the hitbox registers as if it would be in the top left like a regular 32 X 32 image hitbox. I will do some testing if I get home before 3 a.m., and I’ll let you know what I come up with if it can be recreated.

Ok, thanks for the update and reporting the polygon issues. I need to fix that weird play/close window interaction for sure, and just let me know if you can reproduce the polygon offset problem.

So I actually got off work after 3am, but I still wanted to try to help you out.
@grazer

So, as far as I can tell, for whatever reason, the polygon hitbox circle being way off center seems to only happen when I upload this image, not any other image I tried. I can’t even imagine why.
soul2

See?
asdf

Now, here’s something else even more bizarre. I managed to crash the browser with only 3 polygon circles. Try it here https://flowlab.io/game/play/1063643
The game won’t load, it is completely frozen at boot up. Hit ESC a bunch until editor opens up.
Now, try to move an object, it vanishes, and then your mouse gets stuck to the screen. Hitting play or ESC makes a frozen white screen. Maybe this gif will help.

Hopefully these images and descriptions will help you track the source of these bugs.