frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Update: New Physics Engine

edited December 2018 in Announcements
As part of the move to HTML5, I needed to replace the physics engine with something much better performing in order to run acceptably in Javascript. This update contains that new engine. In addition to significantly better performance, there are a few improvements and new features as well:
  • improved performance
  • scaled collision shapes: Now collision shapes are scaled along with sprite when an object is resized using a Scale block
  • removed 100% limit on scale: Scale block can scale objects up as well as down
  • fixed capsule: Capsule collision shape is now a proper capsule instead of two circles. It fits and works much better than the previous version, but be aware that the size (and therefore mass) is slightly different, so objects currently using a capsule shape may need a bit of tweaking
  • polygon collisions: a new collision shape option. This generates an arbitrary polygon that is the shape of your sprite. Any shape you want! (finally!) image
  • density setting: often requested feature - adjust the density of your object to increase/decrease its mass
Also, some bugfixes:
  • spawned objects reset correctly when returning to editor
  • fix class names getting extra numbers appended when not needed
  • gravity settings update without reloading game
  • updating physics settings of one object updates all of its clones
[EDIT]:
* There is no more Drag setting for objects. I may end up adding a global drag setting, but the new engine does not support this feature on a per-object basis.

I did my very best to make the new physics calculations to align as closely as possible to the previous ones, but it's entirely possible that I either missed something or messed something up. Let me know in the thread if I broke something in your game and I'll try to fix ASAP.
«1

Comments

  • My game Guraga is not working now. The enemy's come way to fast now.
    https://flowlab.io/game/play/1055138
  • edited December 2018
    Hey Johnny Boy,

    I failed to mention that the Linear Drag setting has been removed, which is causing the issue with your enemies. To fix this, do the following:

    1) Edit your enemy object and deselect "affected by gravity"
    2) Add a downward force to make them move, like in the screenshot below

    enemy_drop

    This will also allow you to fine-tune how fast each enemy moves, so it's a better solution than gravity/drag. Sorry for the inconvenience.
  • Dude! This is bloody BRILLIANT!!
  • mortors X isnt working
  • edited December 2018
    Very interesting. I'm just in fear that if I work on something big, then the engine moves to HTML5, the game will be broken.
  • @CrimsonBlackGames - You're right, the motor was acting weird. I've fixed it, let me know if you see any more issues with it.

    @PixelStudios - I can't guarantee that the move to HTML5 will be 100% flawless, but I think that the most intrusive and riskiest changes (new renderer and new physics engine) are already complete and in place. The switch to HTML5 will now be mostly changes to the build process and website, hopefully.

  • @grazer looked thru the update, already made a new mechanic for SB3 using it. Thanks!
  • @grazer during level change the screen flashes white. Hurts my eyes at night. Can we get that changed to black or something?
  • Ooh neat! I've suggested all of these things before and you finally did it. :grin:
    Thanks a lot for removing the 100% limit on scaling objects too.

    Some small things I want to say:
    1. Polygon objects are always movable for some reason, even if you set it to non-movable.
    2. Why are the physics settings (density, bounce, friction) still those blue wheels? A number box with + and - buttons would be so much better, and is the max limit in density needed too?
    3. Is this forgotten? I expected it in this update. :(
    4. @CrimsonBlackGames What about making the bg color black?

    Thanks for the update @grazer :)
  • This is very exciting. Thanks @grazer !! I’m especially interested to check out the density adjustments and polygon collisions. Thank you for updating and improving the engine!
  • @Latif - yeah, some of these updates were way overdue :)

    1. I can't reproduce the Polygon issue you mention. Do you have an example with a polygon set to non-movable, but is moving?

    2. & 3. I didn't make any changes that required significant updates to the interface, because that would delay this already big update even farther. I have even more features that I want to add (e.g. object collision groups), and changes I want to make, but the engine update itself already took longer than I wanted. I decided I'd rather get the new engine in the hands of game developers instead of taking more time to design and implement ui changes first.

    4. I think he's talking about between levels, when one unloads but the next one hasn't loaded. This will just display a blank space (currently white). I'll look into this one.
  • Hi please help me!!! Ever since the update the music for my game is completely broken! (That might be because of my 43,743 blocks, though!) Thanks!
    https://flowlab.io/game/play/1031394
  • edited December 2018
    Also, is there a way to change the Density in-game? Thanks!
  • Hey @HumbleTumbler - I played it and don't hear anything wrong with the music. This update shouldn't have effected the music at all - what sort of issue are you hearing?

    Also, there's no way currently to update the density of an object while the game is running.
  • The game plays all the kinds of music at once. Thanks for looking into it!
  • I know i've already asked for a lot, but is Alpha changeable in-game as well? I would like to make a Hardmode version of the Brain of Chtulu in Terraria, which turns invisible some times.
  • edited December 2018
    PS My glitch with the music is when you summon the bosses. It doesn't stop the overworld music like it's supposed to, and the Boss music doesn't stop when it's killed, either.
  • edited December 2018
    Hey @HumbleTumbler - Please make a new thread for any issues unrelated to the physics update :)

    Yes, you can change the alpha in game - use the Alpha block in the properties section.
  • Ok sorry. Thanks for the help!
  • 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
  • edited December 2018
    Hey @Mhx Aîr - 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.
  • edited December 2018
    @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. :)
  • edited December 2018
    @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.
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch