User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Custom Movement and Collision System

  1. #1
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom Movement and Collision System

    I'm in need of a reliable, fast and easy to use and reuse system for lots of moving objects. As I couldn't find anything that I a) understand and that b) fills my requirements, I started making one of my own. It's already easy to use (imho) and doesn't seem to slow my system down (yet). It is reliable as no objects go into or through obstacles, but I have a problem with objects that suddenly stop moving.

    So. If you're an MMF(2) genius, please take a look at the file, maybe you can improve it's performance, make it simpler, or fix that dreaded hanging object problem.

    Thanks in advance!
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Jun 2006
    Location
    Melbourne, Australia
    Posts
    765
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    Your engine would start to break down as you get more objects on the playfield.
    When designing an engine try avoid the use of the condition "always".

    For example only start a loop when the previous one has finished by testing the loop index number. This stops your code for restarting half way through a loop and never finishing. There is a danger of unstable code occuring IMHO so I tend to avoid using the "always" condition.

    Try recoding with that philosopy in mind and you'll see your code becoming more robust.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    whats' wrong with always?

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    []For example only start a loop when the previous one has finished by testing the loop index number. This stops your code for restarting half way through a loop and never finishing. There is a danger of unstable code occuring IMHO so I tend to avoid using the "always" condition.[/]As far as I know the MMF's next loop only occur when all the fastloops have finished, this is why MMF crashes when a loop is set to infinite. Am I wrong?

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    you sound right to me

  6. #6
    No Products Registered

    Join Date
    Jun 2006
    Location
    Ohio, United States
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    Making an infinite fastloop makes little sense to me. In programming, that would be the equivilent to launching an infinite FOR loop. It just doesn't work, unless you plan on exiting the loop early, which doesn't make a whole lot of sense either, because if the loop exit fails, then your game will freeze. When I work with collision, I tend to stick to limits such as 128 for fastloop length. That way, they can fall back to non-instant collision. In games, you want to make things progress as smoothly as possible, and not have random freezes or errors that can throw you out of the game. Things like that are no fun.

  7. #7
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    FoxBlitzz, are we actually talking about my file? I don't have an infinite loop in there. Concerning infinite loops, here is my advice: always have an event in that loop that is like this
    Code:
    LoopIndex("myInfiniteLoop") > 10000 THEN stop Loop("myInfiniteLoop") AND display error message saying the loop "myInfiniteLoop" did not terminate.
    Thus you can have infinite loops, your game never freezes and you get told which loop causes problems.

    And joewski, I do not understand your point. A new frame will NEVER start while a loop is still running, so loops can not overlap - thus there is no need to check that the loop has finished. Go check - all loops always finish.
    Only problem you could eventually have is that running the loops every frame takes too much performance. But if you want accurate collisions that is the prize to pay.

    Concerning the use of always - this is the way to go. I use always wherever possible, because it ensures that the code is executed each and every frame, nothing skipped.

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    How do I download the file?

  9. #9
    No Products Registered

    Join Date
    Jul 2006
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    Hey Random,

    I've got an idea that would vastly improve the performance of your engine. You are using lots of MMF loops to accomplish the movement. MMF loops are slow compared to prewritten loops that are part of MMF runtime. Therefore to avoid these MMF loops, use bouncing ball movement!

    This isn't as stupid as it may seem. You can still have your X/Y velocities for physics, but just convert the X/Y velocities into a speed and direction and you're sorted.

    Here is a link to an engine i made that demonstrates this concept.

    http://www.create-games.com/download.asp?id=5557

    You may need to save this zip file to disk if it won't open.

  10. #10
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Custom Movement and Collision System

    Sounds intriguing. Can't wait to get home to see this. Also I can't wait for someone to make a MMF movement called "Custom movement" that internally stores the object's position as floating point, and accepts x and y speed that it uses to update that position. Then it will check for collisions like boucing ball would, takes care of pushing the object out of obstacles and provides functions for the direction of the collision and the position relative to the object where it collided.
    Because that's exactly what I have to code over and over every time I make a custom movement. And this way it would be faster too.... *drool*

    PS: Everyone capable of making MMF2 movements look here ^^^! *hint hint*

    PS2: I don't care how expensive that would be, because in any case it'd be faster than my loop solution that eventually even needs extra "detector" objects.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Custom Movement Collision
    By Nathanial_B in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 24th February 2012, 09:36 AM
  2. Custom movement Qualifier collision bug
    By Fanotherpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 23rd February 2012, 08:57 PM
  3. Custom Backdrop Collision Help
    By Martin_Bodger in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th May 2008, 09:49 PM
  4. Custom movement -- collision detection problem
    By Poprocks in forum File Archive
    Replies: 1
    Last Post: 17th May 2007, 12:58 AM
  5. Collision in custom 360 movement
    By Pancra in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th October 2006, 10:12 PM

Posting Permissions

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