User Tag List

Results 1 to 8 of 8

Thread: Does the physics engine have a limit?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does the physics engine have a limit?

    physics.jpg

    These are zombies (well they are going to look better of course). They have ragdoll physics and I've managed to have them walk from left to right in a rather silly manner. As time goes by, more and more are spawned just outside the left side of the screen.

    Their heads, bodies and limbs are seperate objects jointed together. Upon creation, all body parts share the same unique value. So you can pick them up and drag them around the screen. (upon creation: set value A to number of zombies + 1)

    I noticed that when the screen is very full of zombies, you can no longer pick them up and they are immune to the fan physics object. When most of them are destroyed, both work again.

    What do you think might cause this? I can't find any flaw in the events. This is what I've considered so far:

    • There are too many physics objects for the physics engine to handle
    • When too many zombies are created at once, the value appointment gets messed up
    • When too many zombies are in the screen, the value appointment gets messed up

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How many objects are there in total when you start noticing the errors? (The debugger will tell you when you are running the game)

    If it's over 1000, then adjust the object amount in your frame properties to something like 10,000.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sparckman's Avatar
    Join Date
    Feb 2011
    Location
    Planet of the Kangaroos
    Posts
    1,423
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    all depends it might be okay with a PC with a nice amount of memory but for a slower processor in a mobile phone it sometimes it might be too much -- so it all depends what's your target device.
    I think it's best to make your game work on slower hardware so you can port the game to PC and mobile. Solution #2 is make two versions PC and mobile.


  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm the number of objects hardly ever exceeds 215. The amount of memory used is a solid 71Mb, but very slowly climbs up without going down (regardless of how many objects there are in the screen). There are no frame drops; not even on my mobile device.

    Maybe this event clogs something up..

    event.jpg

    The following happens:
    • The invisible black box always follows the user's touch/mouse pointer
    • to help user's aim, the body of the zombie turns on the "I'm being picked up" flag on, when user clicks/touches while black box is overlapping the blue zombie body
    • It checks if the black box is not overlapping another object (rock) because in that case the rock should be picked up.
    • all the body parts with the same value A of body now behave as "picked up" (zero gravity, always following the box until user no longer clicks/touches)
    • "repeat when mouse key is pressed" instead of simply "user clicks" because for some reason that unfortunately didn't register in Android. Not with the overlapping black box system that is.
    • Pakkend=0 means that this event should only be triggered when user is currently not picking anything up


    This considers all the zombies in the screen, so I'm pretty bothered by the fact this isn't a green condition. Maybe that is the culprit.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    The "only one action when event loops" line does make a condition essentially green, but I tend to put those last in the Conditional stack. Not sure if the order inside a condition matters so much, like the order of events themselves, but it just tends to be a good practice on my end.

    For PC testing purposes, I would copy the lines of the conditional into an OR statement, and have a (green) User Clicks, along with an Android touch command. While they are nearly the same, I can tell you that at the very least my Galaxy S3 prefers getting a touch command than a click command.

    You might also want to think about separating this out into two events, one for triggering the flag if the flag is off, and one for carrying around a zombie when the flag is on.

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I just copied the event and made a version using multitouch for android, and the original for PC testing (and with the green User Clicks condition). The event I showed already only toggled the flag, while a seperate "repeat while left mouse is pressed" event causes the zombie to follow the mouse pointer.

    But even though the code is slightly more sturdy now, so thanks a lot for your thoughts . However, it sadly didn't make the problem go away.

    [add]

    I managed to condition the cause a bit more. It's in the unique value of the zombies. Each time a zombie is created, global value Zombie Count goes up by 1, and the value B of the created zombie with all its connected body parts will be set to Zombie Count.

    I made an event that, when clicking on a zombie's head, a counter shows its Value B. During the problem, the counter does not change no matter what zombie I click on, until some are destroyed and I can pick them up again. That's when the counter properly shows the Value B of the zombie heads I click on.

    [add]

    play sound.jpg

    I'm really at a loss here. Upon "user clicks on zombie head" I now added a test sound to be played, but that doesn't happen either. It's like only the joints are still intact, but the body parts are completely immune to most events (except, strangely, walking stuff like torques and impulses and being stopped by obstacles). This only goes for Physics objects. Fans also no longer influence Physics. All non-physics objects respond normally.

    This might be a bug, but I have no idea how to specify what the problem really is. It's so vague.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    man! taking advantage of you thread. How do you do to ragdoll characters walk? I've tried a lot in the past but without success

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha I might have to disappoint you. My zombies don't actually "walk". That was my first intention though. They kind of roll over the ground, stand on their legs for 1 second and then topple over again. It looked so funny that I decided to just keep it that way.

    However here's a checklist of what I've got:
    • Body parts are connceted through Revolute Joints
    • The head has slightly negative gravity, so the whole tends to stay upright
    • Mess around with Upper and Lower angle of the legs. Helps maintain upright position and natural flexibility of legs. I haven't tried this out yet because I'm happy with the zombie silly walks as it is, but this might be why they aren't walking naturally.
    • Apply torque in arms when they touch the ground. Neat little trick I found that causes the character to pick itself up after falling over.
    • Play around with Angular Force when legs are in contact with the ground. You'll eventually create a walking motion


    I hope this helps, and I sure hope that someone can help me out with the problem I wrote in my previous post.

Similar Threads

  1. Replies: 1
    Last Post: 18th May 2015, 02:37 AM
  2. help with physics engine
    By JRP in forum Fusion 2.5
    Replies: 2
    Last Post: 10th November 2014, 02:02 AM
  3. Replies: 5
    Last Post: 31st August 2014, 02:58 PM
  4. Car Physics Engine help
    By Vetmora in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th July 2012, 03:08 AM
  5. Possible to make some simple object fall physics without physics engine?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd March 2012, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •