User Tag List

Results 1 to 9 of 9

Thread: Safely-Does-It Platformer open-source collaborative idea

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Safely-Does-It Platformer open-source collaborative idea

    I have no idea if anyone's interested but @Edel got me thinking about making a pixel-perfect collisions platformer engine with Move Safely 2.

    I've put in the absolute basics so far, with commenting:safelydoesitplatformer.mfa

    It's rough, but it works and it doesn't use anything but a player sprite and Move Safely 2. If anyone wants to improve it, rewrite anything or extend it (my wall-jumping idea could be implemented!) feel free, I'd be interested in anyone's thoughts!

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    142
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I'll be messing around with it this whole week see what I can improve on. Then I'll be posting it here. I think this is a good idea.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    142
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    So here's what I have done so far:

    It's very basic with simple physics. Feels pretty good but I can't seem to figure out how to test for Wall's x left / right edge collision with 'Move Safely 2 object'. I'm trying to not get stuck on walls!!! There's a whole bunch of ways I can improve this but it's the collisions that are throwing me off... I need a fresh pair of eyes on this:

    Note: [A = left] [D = right] [space = jump]
    Ed's Platformer Engine 2019 revision 4.mfa

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Edel View Post
    So here's what I have done so far:

    It's very basic with simple physics. Feels pretty good but I can't seem to figure out how to test for Wall's x left / right edge collision with 'Move Safely 2 object'. I'm trying to not get stuck on walls!!! There's a whole bunch of ways I can improve this but it's the collisions that are throwing me off... I need a fresh pair of eyes on this:

    Note: [A = left] [D = right] [space = jump]
    Ed's Platformer Engine 2019 revision 4.mfa

    You just need to ensure there's an alt value check for both left/right and up/down collisions, as you're not checking against an alt value, you're also only making one collision check, so when you get pushed out horizontally, your vertical movement is also being ignored. Take a look at my example to see how to properly structure move safely events.

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    142
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I finally got it working thanks to you. I'm surprised there isn't more info on the ms2 object.

    Ed's Platformer Engine 2019 revision 5.mfa

    It's basic but I think it's much better than using FastLoops !

  6. #6
    Clicker Fusion 2.5 (Steam)

    Join Date
    Nov 2017
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it, though? What's wrong with a FastLoop movement? From what I can see, this requires an extension (I try to minimise reliance on extensions unless absolutely necessary, personally) and it still uses a guide with a mask and maybe a sensor for the "feet"(though I can't see any code for that right now).

    It seems a FastLoop movement would give a greater element of control over the player speed and things like that. Furthermore, using the MiS extension is rather opaque and unwieldy - or maybe I'm just too used to the logic of FastLoops! For multiple objects, wouldn't you need to bring in FastLoops to cycle through each object to have it work with the MiS extension!?

    I'm probably missing something glaring here... but if this was an alternative to a FastLoops-based movement that eliminated the need for a guide/mask system and had "fine" collision with no getting stuck on backdrops ever, then maybe this is something... but even then, a player/mask type set up is probably still necessary for most games, because your game may have a player sprite play an animation, such as a sword slash move, for example, where it goes beyond the consistent "hitbox" of the player. Furthermore, things like, that sword slash will cause you to latch onto platforms and such.

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Progject View Post
    Is it, though? What's wrong with a FastLoop movement? From what I can see, this requires an extension (I try to minimise reliance on extensions unless absolutely necessary, personally) and it still uses a guide with a mask and maybe a sensor for the "feet"(though I can't see any code for that right now).

    It seems a FastLoop movement would give a greater element of control over the player speed and things like that. Furthermore, using the MiS extension is rather opaque and unwieldy - or maybe I'm just too used to the logic of FastLoops! For multiple objects, wouldn't you need to bring in FastLoops to cycle through each object to have it work with the MiS extension!?

    I'm probably missing something glaring here... but if this was an alternative to a FastLoops-based movement that eliminated the need for a guide/mask system and had "fine" collision with no getting stuck on backdrops ever, then maybe this is something... but even then, a player/mask type set up is probably still necessary for most games, because your game may have a player sprite play an animation, such as a sword slash move, for example, where it goes beyond the consistent "hitbox" of the player. Furthermore, things like, that sword slash will cause you to latch onto platforms and such.
    There's no mask guide or feet sensors, that was just an old object I didn't delete, this is entirely running with just one object and MS2, like I said. Of course you'd put an animation on top of this, until fusion actually has separate collision masks for animations, there's no alternative.

    There's plenty of fastloop based movements, but not everyone wants to learn to use them, once MS2 is set up, you can just forget about it, and no you don't need to use fastloops for multiple objects, I'm using MS2 for my entire enemy qualifier, that's what MS2 is designed for, forgetting about fastloops.

    Don't be afraid of using extensions, they run at a lower level than events anyways, so technically you're getting the performance of a c++ written extension rather than the events of an interpreted language.

    This is an experiment, to see how far it can be taken as an alternative to fastloops, and I'd be more than happy for you to add anything you like to it and include it here in the thread for others to learn from.

  8. #8
    Clicker Fusion 2.5 (Steam)

    Join Date
    Nov 2017
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, when you put it like that... good point! I'm working on a side scroller, it's way too far in production to change my movement now, but I have everything I possibly can assigned to Alt.Vals so they can be changed on the fly - friction, speed, acceleration, etc. I think the FastLoops give an ability to have sub-pixel movement, as opposed to just "Move it 1 pixel every tick" sort of thing. Can that still be achieved without FastLoops?

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Progject View Post
    OK, when you put it like that... good point! I'm working on a side scroller, it's way too far in production to change my movement now, but I have everything I possibly can assigned to Alt.Vals so they can be changed on the fly - friction, speed, acceleration, etc. I think the FastLoops give an ability to have sub-pixel movement, as opposed to just "Move it 1 pixel every tick" sort of thing. Can that still be achieved without FastLoops?
    Movesafely always checks movements as "steps", so if you are moving an object at the speed of 10 pixels per second, you can define if MS2 will check all 10 pixels within that distance, or you can check more or fewer if you need to (the extension has a setting for the amount of steps).

    As long as your movement is being set in an event, just wedge it between the safety prepare events, then in the "on safety" event, retract the movement, ie:
    "safety prepare"
    move player [player x + 10]

    "on safety"
    move player [player x + 0]

    safety prepare is checking all the time for pixel-perfect overlaps, and if it finds one, the "on safety" is really just saying "let's spin back the clock, what do you want to do instead of going inside the wall?", so we tell it "don't move".

    I'd recommend having a look at the mfa I posted, or @Edel 's and getting an idea about how it works. It's really simple once you figure it out, and it's extremely powerful, I've used it for PMO-based characters on moving platforms, you're not limited to how you move the object at all with MS2, you just need to sandwich any movements in the correct places (as you would with fastloops).

Similar Threads

  1. Pew Pew - Now open source
    By aenever in forum Fusion 2.5
    Replies: 6
    Last Post: 4th January 2018, 02:58 AM
  2. Replies: 9
    Last Post: 31st May 2017, 02:30 AM
  3. Replies: 7
    Last Post: 20th December 2011, 07:27 PM
  4. XLua Open Source
    By Retriever2 in forum Extension Development
    Replies: 5
    Last Post: 25th July 2011, 06:37 PM
  5. Rpg open source
    By Master_Maker in forum File Archive
    Replies: 1
    Last Post: 1st January 2009, 08:11 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
  •