User Tag List

Results 1 to 10 of 10

Thread: Smooth scrolling.

  1. #1
    No Products Registered

    Join Date
    Nov 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smooth scrolling.

    Hello to all.
    This is my fist post here so please go easy on me

    For a long time now I have been potting around with a game in the style of Diablo/most ISO RPGs with good graphics (no 16 color goofy RPGs where you can’t tell a leg from an arm). I have done a lot of testing and what I found is that MMF1 or MMF2 does not seem to provide smooth enough FPS when having your character walk the screen follows him.
    See I am of the philosophy that if you can’t make something that you yourself would not enjoy playing you may as well not waste your time. So, I have created a 4000X4000 JPG background, made my playing window 1024X768, decreased the color palette to 32K colors, changed the resolution to match it and had my character walk around. Well, had some strange graphical anomalies and even with my powerful rig (3.8 Dual Core AMD, 2 GIGs of very fast RAM and Gforce FX 7800) it really was not as fast as I thought it should have been. The scrolling was jerky although I made my scrolling update as “ALWAYS”. Just so that you understand I personally hate to use tiles…so this is why I tried to use one bulky background and then build on top of that. So here are my questions:

    1. Has anyone used any special techniques and used a huge background (4K+ X 4K +)and have it run at 1024X768 with 32K color palette smoothly on a decent machine (not a monster)?
    2. Would I be stuck using tiles? (which I know, are used a lot on games for a reason)
    3. I am still using MMF2 demo since I have not seen a significant increase in speed over my purchased MMF1 in this respect. Is this a mistake? Does MMF2 do something with “finished” application to speed it up vs. the testing mode?

    TIA

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    I think all scrolling seems jerkey if it is like 'center the screen on the player' type of scrolling. I think the scrolling is better if you use a weighted average on it. In short, what you do is you center the screen on the point that is 1 10th of the way to the character, so when the character is far away, it scrolls fast, if it is close, it scrolls smoothly.

    What I do with huge backgrounds is I load them from the disk using the picture object, as opposed to using the builtin backdrop object for something of that size. It is MUCH faster at runtime.

    Tiles can be a pain in the butt. I would only use tiles if you are planning on having a map editor, which I seriously doubt, because how many RPG's have map editors? (besides dink smallwood).

    From what I can tell, the testing speed and the finished application are the same speed.

    What do you mean by 'strange graphical anomalies'? Do you mean where part of the screen seems to have an invisible line running through it where below the line, there is the data from the previous frame, and above the line there is the data from the current frame? That's because the monitor updates the display at the same time the computer is updating the display. To get those two synchronized, turn on V Sync in the application properties window.

  3. #3
    No Products Registered

    Join Date
    Nov 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    Thank you for your response.

    Would you be kind enough to explain what you mean by:

    "I think all scrolling seems jerkey if it is like 'center the screen on the player' type of scrolling. I think the scrolling is better if you use a weighted average on it. In short, what you do is you center the screen on the point that is 1 10th of the way to the character, so when the character is far away, it scrolls fast, if it is close, it scrolls smoothly.

    I do not fully understand what you mean by it. Do you mean that you created an invisible point very close to the character and then you "always" center the screen on this object? I probably misunderstand as it does not seem like it would help.

    As to the anomalies...I sometimes have a bunch of horizontal lines breaking up the picture...it could be because I use the MMF2 demo. I will try with the V synch to see what happens.

    Would anyone happen to have a 32K palette scroller that runs at 1024X768 (or bigger *very optional to be bigger*) to show off just to see what can be done if some thought is applied. See it is hard for me to get excided about the project if I know that I will never be able to have smooth scolling which is the basic function of the game.

    Be well :0

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    What he means is that you have two objects, one is the player, the other is used like a camera (the screen follows the camera, and the camera follows the player).

    You move the camera towards the player smoothly by doing this:

    Find the distance between the camera and the player.
    Find, say, 30% of that distance.
    Always Move the camera by that 30%.

    As the object moves closer, the distance becomes smaller, so the 30% that we're moving gets less. This softens the movement, getting slower as it gets closer to the player. Eventually, the two objects are exactly touching.

    This results in a really smooth scrolling, where the camera gently follows the player with a more smoothed-out movement.

    The formula you use to move the camera is:


    Camera Position + (Player Position - Camera Position) * 0.3

    (where 0.3 is the 30%. You can use a different percentage if you want. Lower numbers are smoother, but they take longer to catch up with the player. Higher numbers follow the player more rigidly, but this means it's less smooth).

    You use that formula twice, once for the X position and once for the Y position.

    A little pitfall with this is decimal points. MMF obviously can't save an object's position as a decimal point. For example, you're either on pixel 5 or pixel 6. You cant be on pixel 5.25, it's just not possible.

    This means you have to use some other kind of variable (like a Counter Object, or the Alterable Values of the Camera Object) to store the object's position. These variables can hold the precise position, and its actual screen position is kind of based on them... if that makes sense!!

    To show how you'd do it, you'd basically do this (using 2 counters for the X and Y positions):


    [events]
    *Always
    -Counter X: Set value to: Value("Counter X")+(Xpos("Player")-Value("Counter X"))*0.3
    -Counter Y: Set value to: Value("Counter Y")+(Ypos("Player")-Value("Counter Y"))*0.3
    - [obj_active]Camera X Position: Value of Counter X
    - [obj_active]Camera Y Position: Value of Counter Y
    [/events]

  5. #5
    No Products Registered

    Join Date
    Jun 2006
    Posts
    1,630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    once I tested scrolling applications with a 3k background and worked fine on a p4 2.8 and 1GB of RAM. MMF2 is faster but when using alpha objects the system tends to slow down since it doesn't uses hardware acceleration yet. The only way you'll now for sure if it will work for you is making speed tests watching closely the fps in the debug mode

  6. #6
    No Products Registered

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

    Re: Smooth scrolling.

    I owe you, Dines, for the work you put into answering this. You basiclaly just wrote my game engine for me!

  7. #7
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    Hi i just want to ask, where is the camera object situated? I'm using the demo version, maybe it's not there on the demo version?

  8. #8
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Smooth scrolling.

    Quote Originally Posted by keokeo
    Hi i just want to ask, where is the camera object situated? I'm using the demo version, maybe it's not there on the demo version?
    You scroll using the Storyboard Controls->Scrollings actions. The storyboard control is the one which looks like a chess board and automatically appears in the event editor (you don't add it in the frame editor). For it to work the frame size has to be larger than the window size.
    .:::.Joshtek.:::.

  9. #9
    No Products Registered

    Join Date
    Dec 2006
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth scrolling.

    Ok thanks. Up to now I've been moving the background inverse of the arrow button I'm pressing to make it look like the character at the middle is moving.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is there any way of applying Dines method to center between two objects as well?
    im currently using his guide to create a camera following the player and it works very well on 1 player. but i also want the possibility to add a second player and center the camera between the two, just as smooth as with player 1.

    im currently using this:

    *IF 2 PLAYERS ON SCREEN:
    -Counter X: Set value to: "value( "Counter X" ) + ( ( X( "Player 1 Detector" ) + ( X( "Player 2 Detector" ) ) / 2 ) - value( "Counter X" ) ) * 0.1"

    and the same method for the Y-axis aswell. but it doesnt seem to center the camera between the two players. what am i doing wrong with this calculation?

Similar Threads

  1. No smooth scrolling.
    By blub in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th April 2012, 10:01 PM
  2. Smooth Scrolling.
    By Almightyzentaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th August 2010, 04:47 AM
  3. Smooth Scrolling Example
    By Docilemouse in forum File Archive
    Replies: 0
    Last Post: 29th August 2009, 05:31 PM
  4. Smooth scrolling
    By thps13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 14th December 2008, 11:44 PM
  5. Smooth Scrolling
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th June 2008, 11:43 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
  •