Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Parallax Engine for MMF


Damizean

Recommended Posts

Here's a new parallax engine I first made as proof of concept demo for TDR, but I though it was good enough to give it to everyone. What is different about this parallax engine from others it's the fact it calculates the optimal size for the Background System Boxes, resulting in better perfomance and sexyness in-game, as it doesn't need large 10000x10000 boxes. This method also seems to fix the precission problem with ultra large levels, so you now can do a level of the size you want!

The engine itself does mostly all the work for you. It gets the Background System Box pieces that are under the group "Group.99", and create theirs values based on how they're positioned in the editor. After this, you'll only need to input a X and Y Scroll Relation Factor values and X Scroll and X Scroll Speed (if you want to do stuff like Moving Clouds or Water Ripple).

It comes with a GHZ example, so enjoy it and have fun!

P.S. There's no need to credit me for this example.

Download and stuff. Could also resource mods upload this to the main site? Thanks.

  • Like 4
Link to comment
Share on other sites

That almost works the way I do paralax backgrounds except that after scrolling to the left of the screen a certain amount it positions itself back to prevent it extending any further.

Nice tutorial dami. =D

Also, I don't agree with not giving credit. Whether you want it or not, I'm giving it. =P

Edit: Sometimes I wish I was good with figuring things out. =/ I can get tid bits and all but not really comprehend it. I usually get it quick though when I actually experiment with it. I'll give it a try when I get the chance. Thanks again.

Link to comment
Share on other sites

I can't get it to work. =/ I tried using the mod function to get the remainder of the current bg X divided by the width and it continues to extend off the screen as if I didn't even add it. What am I doing wrong?

Here's the code:

 ( ( X Left Frame * 0.6615 ) - ( Alterable Value A( "Background Water 6" ) / 100 ) ) mod 32[/CODE]

Link to comment
Share on other sites

I can't get it to work. =/ I tried using the mod function to get the remainder of the current bg X divided by the width and it continues to extend off the screen as if I didn't even add it. What am I doing wrong?

Here's the code:

 ( ( X Left Frame * 0.6615 ) - ( Alterable Value A( "Background Water 6" ) / 100 ) ) mod 32[/CODE]

I've faced the same problem. It's because MMF doesn't like to mod floating point values. You have to convert the values into integers before using mod:

[code] int( ( X Left Frame * 0.6615 ) - ( Alterable Value A( "Background Water 6" ) / 100 ) ) mod 32[/CODE]

  • Like 1
Link to comment
Share on other sites

D= Tried it and it works. I also found though that part of the problem was the way I made the dimension of the bg change. =P It's working perfectly now, so thanks a lot dami. Funny how all I did was saw that you used a mod equation and that's it. I didn't bother to see exactly how you did it, I just wanted to see if I could do it on my own to better understand it.

+One rep for you

Link to comment
Share on other sites

  • 1 year later...
The link doesn't work anymore. Would like to see that example too.

First post now. :P

Hi, i'm Blazean. Sorry if i'm breaking the rules, but the link of SFA developed by BlueFrenzy is not working. All the links using this directory don't seem to work anymore.

Just thought you should know.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...