Author Topic: MODULE: Smooth Scrolling & Parallax v1.7.1  (Read 55997 times)

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
I have no idea how it's all coded exactly, but isn't there a way you could toggle the scrolling on/off?

I have no idea either... at least I don't have it in front of me so I can't remember. I'll check and let you know if there is. If not, I'll change it for the next version.

Hey

Being using this module wiht AGS 3.1 and in one of the rooms works OK, but when I use it in another room in work OK when player visits room for the first time !!! BUt when I re-enter the room background object dissapears !!!

So I used DISPLAY function to display coordinates of the object, original are 69,206 - but when I reenter the room it changes to 115,445 (thats why object isn't visible)!! I really don't get it !
Game resolution is 800x600.

help

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
I've notice that the module is appearing all room objects when you re-enter too, but I reset the room after I leave. So all is fine.
No more military army stuff. I'm alive and back.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Hmm...

Yet again I'm not at my home PC so I can't sort this out immediately. It sounds like the module isn't resetting the objects to their original places for some reason. I thought I'd fixed that problem... but perhaps not! I assume you're using the newer version at the top of this thread.

I'll see if I can recreate your problem and get back to you. For now, you could follow Dualname's suggestion and manually reset the object's position when exiting a room..

I do reset object position after you RE ENTER the room, or EXIT room, but after you re enter the room you can see object for half a second and than it dissapears !? Strange.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
largopredator
I've uploaded a new version which allows you to suspend smooth scrolling by setting scrollOn to 0. You would need to use SetViewport to position it wherever suits you, though I think using a dummy character is likely to be more effective.

Sektor 13
I haven't been able to recreate your problem. In the demo game it is possible to exit and return to a room without that problem occuring. Setting the game to 800x600 didn't cause any problems either.

Try using the version I've just uploaded. You shouldn't need to reset the object positions at all, so please remove any code from your room script that does that. The module should record the original positions of the objects and reset them when you leave the room.

If the problem persists once you've got rid of the code affecting object positions, let me know. It might be easiest for you to send me the game in progress, if you'd be happy to do so.

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
I do reset object position after you RE ENTER the room, or EXIT room, but after you re enter the room you can see object for half a second and than it dissapears !? Strange.

I get that too. But, I'm using a black GUI which opens at room load and it closes at after fade in so people don't see the object disappearing.
No more military army stuff. I'm alive and back.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
I do reset object position after you RE ENTER the room, or EXIT room, but after you re enter the room you can see object for half a second and than it dissapears !? Strange.

I get that too. But, I'm using a black GUI which opens at room load and it closes at after fade in so people don't see the object disappearing.

I don't get that... are you using fade in / out transitions? Do you set the position of the objects at the start / end of your room script?

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
When you enter a room that is using the module (yours) objects visible property gets to true. So if you had an object you woudln't want to be show it gets appeared. So I close those objects after fade in(because if i do it on before they will be up), but they get visible for a blip and then disappear. So to solve that I'm opening a black GUI on the room load then fade it on the after room fade in so people don't see the object appear and disappear in a blip.
No more military army stuff. I'm alive and back.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Ah...  so if I understand you correctly the 'blip' problem arises because the module controls the visibility of parallax objects (this is in order to allow all parallax objects to be hidden on slow computers). I'll try to find a way to allow for this in future, but until now your workaround sounds smart.

Sektor13, If you're seeing blips without manually setting parallax objects' visibility, do let me know. That would mean there's a bigger problem...

EDIT: On second thoughts, Dualnames, why not use a Transparency of 100 set clickable to false on objects you don't want to be visible on entering a room?
« Last Edit: 23 Jan 2009, 11:52 by Ali »

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Because they get visible on after fade in section from the module,so I have to turn them off after they get.
No more military army stuff. I'm alive and back.

Hmm i have the same problem ! Object just goes away :).


Nickel

  • For a carrot, I'd take you anywhere.
Re: A Smooth Scrolling & Simple Parallax Module
« Reply #52 on: 06 Feb 2009, 23:08 »
Hi everyone!

Thanks for the module, Ali.

I'm afraid this module is pretty simple and just moves objects around. To create parralax with large background images would require very big objects, which might be too much for the AGS engine.

On the other hand, I haven't tested the D3D version much, so larger objects may prove to be less of a barrier in the future.

So something like this will probably not be possible?



Did anyone test it with 800x600 and large objects yet?
What is the D3D version? Of AGS?

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Something like that might well be possible with the newer versions of AGS, which support DirectX 9 (which is what I meant by D3D). I've tested it at 800x600 with reasonable large objects, but nothing quite as object-heavy as your example. I suspect that that might work on some computers, but it would definitely slow down on older machines.

Also, the parallax effect doesn't apply to characters, so they'd only be able to walk around the bottom of the screen in your example.

Download the tech demo of Nelly Cootalot II to see parallax at 800x600. A Second Face also uses a bit of parallax at 640x480 (I think). The Jackyard uses very large parallax objects, but it's low res.
« Last Edit: 05 Mar 2009, 13:45 by Ali »

Nickel

  • For a carrot, I'd take you anywhere.
We (Mr Matti and me) just tested it with DirectX 9 and 800x600 pixels and it worked fine on a 2x2 GHz with a bad video card (sis mirage 3)! There is no slowdown.

We used 6 objects with the PxPos -3 to 2 with the factors 1, 0.9375, 0.875, 0.75 and 0.5 in order to have each object scrolling with half the speed of the previous one which creates the effect seen in the picture above.

With every object exept one it works fine, we didn't succeed to get it do what we want and now we are close to getting mad. It seems to be not affected by the lines of code that we think are the right ones...
Honestly we have problems to fully understand that crazy move-with-scrolling-speed-in-opposite-direction-than-scrolling-math-thing.

We uploaded the game folder here. It would be nice if you could take a look at the script and tell us what obvious mistake we made.
« Last Edit: 07 Mar 2009, 19:12 by Nickel »

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Hi Nickel,

Sorry I'm not able to check this thread more frequently. I'm glad the effect runs smoothly on your system.

I'm afraid I can't download the file you posted, after waiting 60 seconds it only lets me download a .rar file of 0 bytes. It might be the computer I'm on, but could you try re-uploading it on another site, like filefront?

Matti

I've uploaded the data again here and here. I hope one of these will work.

Thanks for having a look.

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!


For a reason in Sierra speech on a scrolling room this happens if the player character walks to a hotspot. To solve it which I have I've put StopScrolling on every of the hotspots. Just saying you might want to put this on the module's readme file.
No more military army stuff. I'm alive and back.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Nickel & Mr Matti: That looks really cool, and it ran very smoothly for me too. I like the way you've modified the numbers, and there's nothing wrong with the maths. The problem is that objects with PxPos of 0 are ignored by the script and aren't added to the array of parallax objects. It's the default value, so it's needed to create non-parallax which stay in place.

To make it work, use a PxPos of 1 in the script for the segment where you currently use 0, and use 2 where you currently use 1. Changing the corresponding numbers on the nearest two objects made it work properly for me.

Hope that helps!

Dualnames: Thanks for the tip. I always disliked Sierra Speech, but now it's personal.

*Shakes fist at Sierra style dialogue*

I'll add that note the next time I update the module. Thanks!

Matti

Thanks Ali, it works perfectly now!
« Last Edit: 23 Mar 2009, 18:45 by Mr Matti »