User Tag List

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

Thread: Stable and coordinate movements to let players speedrun

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Stable and coordinate movements to let players speedrun

    Hi clickers!
    I'm developing an action game, which looks a bit like Super Meat Boy / Fenix Rage.

    Each level has its enemies, each of them moving along a specific pattern (i.e. along a line, a triangle, a circle, etc.); the hero must avoid all them, while collecting all the bonuses on the screen.

    My biggest concern is this: I need the movement of the different instances of each enemy to be perfectly coordinated with them and with the timer.
    This is required to keep a nice layout (i.e. enemies moving equally spaced) and to let players compete during speedruns (level configuration is exactly the same for all players).

    I tried different approaches for this:
    - colliders to change direction don't work properly: the margin of error is too big, some instances move before others - even with fastloops
    - position monitoring to change direction (i.e. if X enemy > X Left - 30 --> change direction), don't work properly for the reason above

    - till now, I've found that the most reliable approach to have a very stable movement is using clickteam's movements (i.e. path movement). The only downside is that every different movement, for every level, must be programmed. So I ask you if there's a better and easier approach to get the same result (possibily not involving Delta Framerate, which would require significant changes)

    P.S. Every level has a max 3-4 minutes timer, so it's enough that the movement and coordination stay stable at least for that period (the level then restart). I don't need any further level of precision for now

    Thank you for your precious help!
    Fabrizio

  2. #2
    Clicker Fusion 2.5
    Bertard's Avatar
    Join Date
    Jan 2014
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand what you want

    I make mfa and i post it on this thread

  3. #3
    Clicker Fusion 2.5
    Bertard's Avatar
    Join Date
    Jan 2014
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Hi Bertard,
    thank you very much for your reply.

    Unfortunately this approach (which is the first I tested, the 'colliders' one) is not precise enough: you can easily notice that if you increase the speed of enemies (see file attached)

    I'm actually looking for a more stable solution.
    Attached files Attached files

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your first experiments (not the path movement), are you using a Movement on the objects? If trying to do this myself I would go for moving the objects by altering their co-ordinates in an Always event - or even better, to work out the exact position they should be in using a formula based on a continuously increasing timer.

    For example: Always -> add 1 to TotalTime, Always -> Set Enemy X position to Sin(TotalTime/10) * 100

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Hi David,
    yes, I've tried to manage movement by altering coordinates in an Always event (without predefined movements), but still with some coordination problems.

    The second example ('work out the exact position they should be in using a formula based on a continuously increasing timer') at a first glance seem very reliable: I did a test in the file attached (red sprites)

    But in this approach, I wouldn't know how to define a change in direction, or how to manage the continuosly increasing counter.
    For example, in the file attached there's a blue sprite following the condition 'set X position to Global Value A', where Global is an increasing timer. The blue sprite just moves towards 'RIGHT' till the end of the frame, but how to make it, say, turn 'UP' before and then 'LEFT', when it reach the center of the screen? Basically I can't understand how to constantly define a connection between the value of the increasing counter and the changing position of the sprites...

    Any help is very appreciated
    Attached files Attached files

  7. #7
    Clicker Fusion 2.5
    Bertard's Avatar
    Join Date
    Jan 2014
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think i'v found the solution

    I work on a second mfa and i post it on this thread

  8. #8
    Clicker Fusion 2.5
    Bertard's Avatar
    Join Date
    Jan 2014
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    I've played a little with a somewhat interesting solution.
    Don't know if this may suit your needs...
    anyway, maybe this can be useful for someone.

    I've called this "timeline movement".
    You basically have a "timeline", which is a global value,
    value increasing >> time goes forward
    value decreasing >> time goes backward

    You can pre-program your objects movements by filling values in the list object in this way:
    ID | timeline | X | Y
    so that item id "n" will be at position X,Y in timeline moment "m"
    You must enter start and end of timeline positions (0 and "total_time" global value)
    The engine will calculate interpositions between all the "nodes" you will enter for your "timer.group" objects.

    Requires string tokenizer extension (not *completely* needed, just really handy to use in this situation).

    I don't know how this can be performant on a large number of objects,
    nor if this can actually be simpler than using path movement

    Positions will be pixel perfect because calculated on angles and distance on floating point values,
    and most importantly will be always the same in any given "timeline" moment.

    See example: green diamonds will always cross in the middle of screen at timeline pos. 250,
    red diamonds will always chase at a little distance from each other.

    Another advantage would be having the chance to go forward or backward in time, and to alter time "speed".
    Which you probably don't need

    So, here it is:
    timeline_movement.mfa
    (further instructions onscreen)

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    @Bertard: thank you Bertard, I tried your example: the new approach (I tried something similar before) is actually more stable than the first but still not 100% precise when changing FPS, number of character on screen and other variables. But I really appreciate your help, thanks!

    @schrodinger: your example is absolutely amazing, thank you very much! It's definitely what I was looking for (more than that, actually ).
    I've tested changing framerate in real time, in different Pcs and with more object, and till now it runs flawlessly. The only change I applied was checking 'Machine-independent speed', just to add an extra layer of security.

    I'm sure it could be useful to other clickers, It would certainly be a useful addition within the Tutorials/Example section of the Forums.

    Thanks again,
    Fabrizio

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Pick Instances at same coordinate?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 24th April 2013, 11:21 AM
  2. set coordinate expression bug
    By SoftWarewolf in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 11th May 2010, 09:42 PM
  3. Look at Coordinate without having an object
    By IY5 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 2nd February 2010, 02:32 AM
  4. Isometric X Y Coordinate Help
    By netninja in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 18th November 2009, 12:07 AM
  5. Coordinate to test?
    By BrandonC in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th August 2006, 10:05 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
  •