User Tag List

Results 1 to 8 of 8

Thread: Parallax Scrolling without relying on Layer Coefficients?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Parallax Scrolling without relying on Layer Coefficients?

    Besides relying on using a Parallax Object, or using a layers coefficient to scroll slower than the rest of the objects, is there an alternative to do parallax scrolling effect? I'm wondering because I may try to do an experiment on an idea that may consist of 64 pieces of 100x1 objects placed together to give the same effect as using the Parallax Object, but without the need, or requirement to have it. So if I went with the layers coefficient method, that would mean I'd have to use 64 layers with 64 different velocities to give the same effect.

    My idea is to position all the 64 pieces of 100x1 line objects first on one single layer. Then manually move the pieces at different speeds based on the position/movement of the player, or players on screen to reduce the amount of layers needed for the same effect. Is this something that can be done?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mate, I'm not sure what the parallax object is, but I've done parallax scrolling before and the way I did it was pretty easy - it may or may not work for you. I just set a global speed variable, and I set the background objects as active objects, and individually set them to move at relative speeds to the global speed variable.

    So what I mean is, the foreground would move at the value of "globalSpeed", then the midground at "globalSpeed / 2", then the layer behind that at "globalSpeed / 3", and behind that at "globalSpeed / 4".

    And if it was a game where you wanted the player to be able to move either forwards or backwards (mine is on rails), you would need a way to set the speeds to be either positive or negative depending on which way the player is facing. To do that, I would create a separate variable (let's call it positiveNegative) that was positive 1 if the character were facing left, and negative 1 (or -1 ) if the character were facing right. Then what you would do is "(globalSpeed /2) * positiveNegative" or in other words "(6 / 2) * -1".

    That way, the background will scroll the opposite direction to the way you're facing. I may have got the left and right mixed up, about which should be positive and which should be negative, but I think you get the idea.

    The only problem with that method is finding a way to get the elements to stop scrolling when you reach the edge of the screen. But I've never had to program that, as my game was on rails. Shouldn't be too hard though. Hope that helps.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Well, this is basically a follow up on a previous post I made before. But it's been pushed down somewhere, and I didn't get the right response that I needed.

    This animation is kind of what I'm going for here.
    So the bottom layer of the floor would move faster than the top of the floor tile that would move slower. The way you described your method, it could work that way. But I was thinking like the bottom layer would move 1.0 speed, and the top most floor tile would move at 0.01 speed. So I'm not sure how much math I would need to correct to make exact positions.

    It's for the SF game project I'm trying to work on. In the previous post, they recommended using the Parallax Object for this effect, but I'm thinking I could at least try getting away with this without the need for it by doing a scrolling movement trick based on position of said players.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hang on, so you're saying you want that 3D effect, like in Super Mario Kart? To be honest, that animation you sent looks like it was done in 3D. I believe a lot of people use unity for that, fake 2D in a 3D world. It is possible in 2D though.

    The way they did it in Super Mario Kart was to use Mode 7, but I'm not sure how to create that effect in Fusion. I was referring more to typical sidescrolling like you'd find in Sonic 3. There's no way you'd get that smooth 3D effect with my method on its own - you need something to create that 3D effect. Unfortunately, not sure how to help you there except to encourage you to look in to Mode 7.

    From what I gather, you not only need to move the image, but have it scale and rotate. I believe that is essentially what Mode 7 does to give a 3D effect. Try this on for reading: http://en.wikipedia.org/wiki/Mode_7 Do let us know if you come up with a solution. If you google "how to achieve mode 7 in mmf2" you should come across someone whose done it before. I found this article, for example: http://www.create-games.com/forum_post.asp?id=294701 Not sure how good it is, but there's a starting place for you to look.

    Btw, not that I've done it, but I would assume it was possible without an extension and some clever programming. There may be an extension though, which would make life easier.

  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    There is a example on my website that does not use layers or extensions.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I don't think I need a Mode 7 effect. The game was entirely in 2D. The only part that looked 3D was the stage floors, and some ceilings. Though I'll see what I can come up with. I'll take a look around the site Marv.

    EDIT: Didn't find any Mode 7 type of examples, or fake 3D examples, though I did find 2 parallax examples.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I understand you don't want the whole game in Mode 7, just a section of it with a similar 3D effect. I thought maybe if you understood more about how Mode 7 worked, you might be able to apply some of that logic. Have you tried asking the game creator how he did it?

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    You do realize that animation I made is from an official SF arcade CPS game, right? Just so you know, why contacting them would not be a good idea.


    Actually, I found an interesting parallax background in a full Sonic fan game done in MMF2 that I might could try, except there are some things I don't understand about it. So I may try something similar, but different that could work the way I need.

    Also, in Marv's parallax scrolling example with Sonic, there is some errors with that one. First of all, the conditions of X positions of player are absolute, instead of building it with math calculations. Secondly, if you change the trigger conditions in this, you could still scroll off the stage background objects incorrectly, even if the camera stops scrolling at the player due to the end of the level map.

    I'm trying to find a way where I could save the positions of the background first, then keep positioning them on screen, but change the offsets of them when the camera moves around at 2 players. As I said in my first post, I'm just doing some experiments with this. So far what I've seen there are alternative ways of doing it. I just need to do some more testing and stuff.

Similar Threads

  1. Parallax Scrolling
    By Edge in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th April 2016, 03:57 PM
  2. Event to adjust layer parallax?
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th January 2014, 12:05 AM
  3. Top Layer not visible for Parallax Scrolling
    By WEich1213 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 16th November 2013, 02:20 AM
  4. Scrolling with coefficients
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd February 2010, 09:23 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
  •