User Tag List

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 48

Thread: set X to X -0.3 moves by -1.0 : bug or feature?

  1. #21
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,121
    Mentioned
    76 Post(s)
    Tagged
    0 Thread(s)
    Interesting, but fusion turns - 4.5 to - 5, so I guess it uses flooring after all

  2. #22
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS 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)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    97
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Interesting, but fusion turns - 4.5 to - 5, so I guess it uses flooring after all

    Sorry that stuff in italics was just extra interesting info..

    Here’s a link about the topic my understanding is that it’s a data conversion not a math function

    https://stackoverflow.com/questions/...uble-to-an-int

  3. #23
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS 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)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    97
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Seams like adding 0.5 might be a solution though

    V Edit v

    “Adding +0.5 to a negative input before turning it into an int will give the wrong answer. The correct quick-and-dirty way is to test the input sign for <0, and then SUBTRACT 0.5 from the negative inputs before turning them into an int. Most of the following answers do not explain this properly. Note high-accuracy procedures should use the new slower "round()" function. – DragonLord Aug 13 '16 at 22:37”

  4. #24
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,121
    Mentioned
    76 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fnkycoldmadeanr View Post
    Sorry that stuff in italics was just extra interesting info..

    Here’s a link about the topic my understanding is that it’s a data conversion not a math function

    https://stackoverflow.com/questions/...uble-to-an-int
    From what I can understand of that page they're talking about truncating numbers, as int() does. In other words, just chopping off the digits after the decimal so that 1.3 becomes 1 and -1.3 becomes -1.

    But that's not what Fusion is doing. Fusion is flooring the numbers, so that 1.3 becomes 1 but -1.3 becomes -2. That asymmetry what I've been banging on about in this thread. I wish it truncated/cast the numbers as int() does, but it shifts them 'left' to the nearest integer, as floor() does.

    You easily see this for yourself: Do the following event, and you'll see that the red object moves, while the teal object does not.


  5. #25
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProUnicode Add-on
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,020
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    really weird behaviour ... thanks for that insight, Vol. may @Yves bring some light into this topic? would be interesting, why fusion behave like this

  6. #26
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    308
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    You can use floor() ceil() round() int() abs() but you cannot use float() in the expression editor maybe we can have a function like that to preserve the decimal?! At least than we could set it at runtime and fusion would not floor it automatically.

  7. #27
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2017
    Posts
    308
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    This has been a thing for quite a long time iirc. Fusion can't handle anything but integers in the expression editor, i.e 0.3 turns into 0. This is why it's common practice to use values to handle floats. You can add 0.3 to a value constantly and set X of Active to X( "Active" ) + value and it will move correctly. Or in my opinion the "better" way is to set two values (xpos and ypos) to x and y of object at start, and treat these as the "real" position of the object that you modify, then always position the object at X = Round( xpos ) and Y= Round( ypos).
    Yes its true, the guy in the video also does this but its still strange acting, look at the example.

    Set varPos + varFloat = varFloat stack up NOT reflected on obj
    Set x("Active") + varFloat = varFloat stack up reflected on obj

    The varFloatSpeed is stacking up constantly like we tell it (look debugger), but why is it not reflected like that in both examples?
    Attached files Attached files

  8. #28
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Aug 2018
    Posts
    27
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Here is an mfa i made of the zentaco tutorial i posted. Its in 4 frames. When you go through the tutorial it shows a number of ways to do things.
    Instead of deleting parts and replacing them i made a new frame at each stage.
    There are a few parts where he identifies even more ways to do things like how to get around the float and sine limits.
    If a had a few more thousand hours in fusion id have a go at explaining it in detail. Im around the 500 hour mark. and never used any other engine. So i am still a noob compared to many.
    Maybe that's a plus as im not expecting Fusion to be like other game engines or be a scientific calculator, i hated math at school. If my teacher had told me that i can make a character move in relation to fps or game loop id of taken more interest.
    Any way for any that are interested in seeing the outcome of the video without doing the tutorial here is the mfa.
    I used a taco as the player in homage to Allmightyzentaco.sub_pixel_movement_Taco.mfa

    Taco64x96.png

  9. #29
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,121
    Mentioned
    76 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by c4t View Post
    Maybe that's a plus as im not expecting Fusion to be like other game engines or be a scientific calculator, i hated math at school.
    I don't think anyone's expecting it to work like a scientific calculator. Quite the opposite. I think those people who are surprised at this behaviour are surprised simply because it doesn't behave the way one would intuitively expect.

    I'm also not a maths wiz and have never used another game engine. I'm a regular person like you, and that's actually the problem here: I was expecting it to behave in an intuitive way, or in a way that seems like commonsense to a regular person. But it doesn't. If someone asked me last week: "hey, when you give Fusion the number 1.01, it will change it to the whole number 1. Now, what whole number do you think Fusion will change -1.01 into?" my answer would have been "-1, of course!. I think almost any regular person's answer would have been that. It's probably only the programming wizzes or computer science experts that might have predicted the correct answer of -2.

    Now, your answer might have been "-2", because you remember zentaco saying that Fusion floors everything a year ago and you have a good memory. But if you had never seen that video, and had to rely only on your regular person's intuition, what would you have answered? I'd be surprised if it was anything but "-1".

  10. #30
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Aug 2018
    Posts
    27
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't really know Vol. I can only comment on what i think myself really. My own thoughts are based on how i learn about this stuff. So far its a mix of tutorials and searching the net. Like i said i hated math so did not take much interest. That comment is more about my own lack of understanding than any one else. scientific calculators came in while i was stil at school and we were allowed to use them in exams. It did not help me as i had no interest in what sine min float and a whole bunch of other things meant. If i was asked any thing about this before i would of just said i don't know. Thanks to Taco i see something work and just excepted it to be what it is.It made sense only because it worked. Never challenged it or thought oh that should work another way. Id be the same with things like strings, delimiters alt values, flags and many other things ive never heard of before i started using fusion. Im just trying to get involved in the discussion and add what i think might be useful to some people that might think like me or not. I cant really define a regular person. To me any person can be any thing if they choose and have the drive to be it. Regular is a word i use to describe a size of coffee between small and large lol. ill keep reading and trying to learn and i really appreciate all the time you and many others put in here.

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast

Similar Threads

  1. Grass that moves when the player walks over it.
    By BrianK in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 12th July 2017, 07:25 PM
  2. Replies: 1
    Last Post: 28th May 2015, 07:12 PM
  3. Advanced Special Moves Example
    By N64Mario in forum Guides, Tutorials, Examples, Widgets
    Replies: 1
    Last Post: 4th March 2014, 12:58 PM
  4. Moves left more than right
    By Holden in forum File Archive
    Replies: 8
    Last Post: 28th March 2008, 02:47 AM
  5. space bar moves it
    By delusan in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 27th May 2007, 05:35 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
  •