MODULE: Smooth Scrolling & Parallax v1.7.1

Started by Ali, Fri 07/12/2007 21:14:09

Previous topic - Next topic

Ali

Quote from: largopredator on Tue 16/09/2008 14:33:01
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.

Sektor 13

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

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ali

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..

Sektor 13

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

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

Quote from: Sektor 13 on Mon 19/01/2009 14:10:41
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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ali

Quote from: Dualnames on Tue 20/01/2009 09:04:46
Quote from: Sektor 13 on Mon 19/01/2009 14:10:41
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

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ali

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?

Dualnames

Because they get visible on after fade in section from the module,so I have to turn them off after they get.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Sektor 13

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


Nickel

Hi everyone!

Thanks for the module, Ali.

Quote from: Ali on Thu 13/12/2007 12:51:56
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

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.

Nickel

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.

Ali

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



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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ali

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!

SMF spam blocked by CleanTalk