Parallax Origin point

Discussion and feedback on Construct 2

Post » Sat May 25, 2013 8:57 pm

Hello!

I would like to know if there is a way to change the point of origin for the parallax's point of view.

As I understand, the origin from which everything begins to offset in relation to the layer's parallax value, is the layout's 0,0 coordinates. Everything is fixed in that point and as you start to move away from it, the graphics on the layers "above" or "bellow" (with greater or lesser parallax values) scale or move away from that point faster or slower, depending of their parallax value.

For me, most of the time this is inconvenient, because I can't really predict the actual offset of a layer the further I go from the 0,0 coordinates. I know that there is a "Parallax in the editor" option but that doesn't work as I would expect it, it feel's like it is depended of the editor's layout view zoom level and not from the layer's actual z depth position.

Further more, at some times I would like to have a fixed "0,0 like" parallax focal point, which always scroll with the camera.

A great example of what I am trying to say can be seen in the Space Ship Demo at the Construct Classic Demo page. The walls and the floor seem to be on a different depth, but they always move accordingly to the player's position, not a fixed 0,0 point.

Is there a way to achieve a similar result in Construct 2?

Contrasting the example above, here you can see in action the problem I am talking about:

http://www.eli0s.com/Tests/parallax/index.html

The starting position of the player is on the top-left of the layout and his shadow/bulletholes are being generated in a layer below, with lower parallax values (90,90). At the beginning, everything seems to work ok, the shadow is in place and the bulletholes appear at the mouse.X, mouse.Y. The further you stray away from the starting point though, the more you can observe the offset I am talking about.

Oh, and turning "Unbounded Scrolling" on doesn't do any noticeable difference to my eye.

I would appreciate any input on the subject!

PS: Sorry for my lengthy and probably poor written post    eli0s2013-05-26 16:29:54
Last edited by eli0s on Fri May 29, 2015 11:42 am, edited 1 time in total.
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Sat May 25, 2013 10:27 pm

+1

Being able to change the parallax origin at runtime will make parallaxing BGs for Metroidvanias (or any game with multiple rooms per layout) much easier. Currently I'm making my own with events and families and it's kind of a pain with the different object types and so on.

It'll also allow you to set the parallax origin to the middle of a room or layout like it should be in the first place ;)Tokinsom2013-05-25 22:30:19
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat May 25, 2013 10:33 pm

[QUOTE=eli0s] ...

Contrasting the example above, here you can see in action the problem I am talking about:

http://www.eli0s.com/parallax/index.html

The starting position of the player is on the top-left of the layout and his shadow/bulletholes are being generated in a layer below, with lower parallax values (90,90). At the beginning, everything seems to work ok, the shadow is in place and the bulletholes appear at the mouse.X, mouse.Y. The further you stray away from the starting point though, the more you can observe the offset I am talking about. You can download the capx file here if you like:

http://www.eli0s.com/parallax/ParallaxExample.capx

...[/QUOTE]
@eli0s
Why are you wanting the shadow/bulletholes to have lower parallax rate than your player?
parallax would start out being fine because little variation in layers' position but parallax is meant to create that offset that you are saying is error

That's my take on parallax anywaysDrGreenThumbCAN2013-05-25 22:34:30
B
39
S
12
G
6
Posts: 136
Reputation: 6,322

Post » Sat May 25, 2013 11:05 pm

Hello DrGreenThumbCAN, thank you for the reply,

Well, in the particular example the shadow is being used in order to illustrate the problem. The bulletholes on the other hand should appear on the floor layer and stay there, that should create a pseudo-3d feel, just like in the Space Ship Demo example I was referring to.

My main argument is that having the layout's 0,0 coordinates being a fixed point that everything scale and move away from, in some cases is limiting and at least in my case somewhat disorienting, since I don't really understand where everything I put on stage actually exist in the game. Perhaps my background with 3d software has made me to expect a "look thru camera" view of the scene/stage, where the world x,y,z, coordinates doesn't affect the result of what you see.       
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Sat May 25, 2013 11:09 pm

Mr Tokinsom,

Could you care to elaborate on that? Are you describing a workaround that achieves a similar result to the one that I am referring to?

Can you please be more specific, I am a newbie to all this      

Thank you in advance!eli0s2013-05-26 05:32:02
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Sat May 25, 2013 11:48 pm

Basically I use 2 global variables "X_Origin" and "Y_Origin" and system expressions ScrollX and ScrollY to make my own parallaxing backgrounds...

+Every tick
-Set Background.X to (X_Origin+ScrollX)/2
-Set Background.Y to (Y_Origin+ScrollY)/2

That's the same as setting a layer's parallax to 50, except with this you can change the parallax origin (the 2 global vars)

It's an alright workaround...but you'll probably want to use a family for all objects you want to parallax, and if you have a lot..well..it gets messy. That's why I'd love for this feature to be added!
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun May 26, 2013 12:53 am

+1

I've wanted more functionality regarding parallax for quite a while. Say you want something to appear in the fore/background at a specific point in a level. Currently, parallax won't help you achieve that, so you'll have to do it all manually anyway.

It's not really a huge priority, compared to other things, so not surprising it has less functionality than I'd like.

[QUOTE=eli0s] Hello!
use I can't really predict the actual offset of a layer the further I go from the 0,0 coordinates. I know that there is a "Parallax in the editor" option but that doesn't work as I would expect it, it feel's like it is depended of the editor's layout view zoom level and not from the layer's actual z depth position.
[/QUOTE]

Quite a while ago I wrote about the "parallax in editor" feature and how it's not really useful. I suggested adding a frame the size of the window size of the game on the layout, similar to the one in the upper left corner, but this one would move with you as you scroll around, acting as a 1:1 preview of how the game would look at that position. That way you could use it to predict how parallax would look, etc.

I don't really care if that particular feature was actually implemented, as long as some form of more in depth parallax control is implemented.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sun May 26, 2013 3:06 am

+1
For 2D platformer type games, parallax is an absolute necessity if you want to achieve any sense of depth. I guess you could always do the "pseudo-3D" route by having 3D backgrounds and the 2D overlaid over it, but I doubt Construct 2 can even handle that.Infinitys End2013-05-26 03:07:25
B
13
S
1
G
1
Posts: 16
Reputation: 1,566

Post » Mon May 27, 2013 3:09 am

Tokinsom,

Thank you for your kind reply! As I understand it, by using families you are actually creating something like a precomposition (in after effects terms) or a symbol (in flash), in order to manipulate all the sprites as one element..?

In my example, I tried to make a family with both a floor sprite and the bullet holes (in essence the objects that I want to be on the same parallax level), but the bulletholes are being spawned on the family's origin point, not at the collision point which is at mouse.X, mouse.Y.
So, I am guessing that your method applies on static elements only..?

Never the less, it's a brilliant workaround that I am sure I will put in use!

Thank you again!

Elias    
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Post » Mon May 27, 2013 3:22 am

inkBot,

You are absolutely right!Although I did search the forums, I hadn't had the chance to read the post you are referring to, however, the particular method that you suggest will surely help staging all the sprites at the correct position while being in the editor.

Ideally, a real 3D workspace and a camera (like the one that can be found in Toon Boom Animate or Hitfilm) would be perfect, at least for me, based on how I have used to work.

I know nothing about programming but I am curtain that this isn't an easy task to tackle though..

I'll keep my finger crossed nevertheless
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,127
Reputation: 8,095

Next

Return to Construct 2 General

Who is online

Users browsing this forum: bclikesyou and 13 guests