Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a basic camera system #1071

Closed
parasyte opened this issue Sep 5, 2015 · 7 comments · Fixed by #2951
Closed

Implement a basic camera system #1071

parasyte opened this issue Sep 5, 2015 · 7 comments · Fixed by #2951
Labels
feature It's a feature, not a bug.
Milestone

Comments

@parasyte
Copy link

parasyte commented Sep 5, 2015

I'm not certain how useful this will be in the general case.

When using parallax scrolling layers, the editor becomes an enormous time saver to get the layers behaving appropriately as the viewport scrolls in-game. Having a basic camera system built into Tiled would be useful for evaluating layer positioning without a long guess-and-check process between the adjustments in the editor and play testing.

This feature request would add a moveable "camera" object to the map, which the editor would display as a rectangle (of configurable size) that can be dragged by the mouse. In addition, a new layer property that specifies the scrolling ratio would enable parallax layer evaluation while moving the camera object.

The following article contains a description of the process, and a video at the end shows it in action (within the Unity editor) http://www.gamasutra.com/blogs/DavidDionPaquet/20140601/218766/Creating_a_parallax_system_in_Unity3D_is_harder_than_it_seems.php?print=1

@bjorn
Copy link
Member

bjorn commented Sep 6, 2015

I think the idea to use a movable viewport object for this is very nice, though I do think it would make sense to have an option to automatically synchronize the position of the camera to match the center of the editor viewport.

Of course, first of all Tiled will need to support parallax scrolling layers in the first place. :-)

@bjorn bjorn added the feature It's a feature, not a bug. label Sep 6, 2015
@karai17
Copy link

karai17 commented Oct 6, 2015

I don't think a camera is actually that useful for Tiled. I think that Tiled should be used to load in backgrounds and set their initial position, but the parallax speeds and such should take place within the game. Perhaps setting custom properties for final values would be fine for each Image Layer, but I think it is out of scope for Tiled, which is primarily an editor, not a scripting engine.

IMO the appropriate workflow here would be to load the background images as Image Layers and offset them to an appropriate value, then write some debug code that allows you to change the values on the fly within your game. When you fine tune your values, create custom properties for each layer.

@bjorn
Copy link
Member

bjorn commented Oct 6, 2015

@karai17 I do think it makes a lot of sense to support parallax preview within the editor. As @parasyte has pointed out, without this it can take a lot of trial-and-error to get things lined up as desired. The main other way to speed that up is to have a live reload feature in your engine/game, but this is rarely available.

@parasyte
Copy link
Author

parasyte commented Oct 6, 2015

Well, that's the thing. At the moment, we have little choice but to build the visualization/debugging tools ourselves on the engine side. In a way, we are already doing that much. This ticket is a feature request to make the state of level design (in the context of parallax layer scrolling) a little bit more user friendly.

And that it can be done within the level editor benefits many more people than individual implementations in game engines would.

@tiamistiam
Copy link

tiamistiam commented May 22, 2016

To risk being a nag: is parallax scrolling a feature that you plan to implement in the near future, or is it likely a long way off?

Realtime, in-editor support would be an incredible time saver -- even a simple implement without layer scaling and/or variable tile sizes. It's easily my most desired feature, and its absence leads to a lot of back and forth between Tiled and my engine of choice (Construct 2).

@bjorn
Copy link
Member

bjorn commented May 24, 2016

@tiamistiam I'd first like to finish Tiled 1.0, which is a milestone that aims to include only a minimum of missing features. I do think I'll get around to finishing those tasks in coming months. After that, parallax support is definitely one of the features I'd like to work on, though it of course competes with a lot of other requests. I will aim to get around to it this year.

@tiamistiam
Copy link

@bjorn Good to know -- thanks again for all your hard work on Tiled, looking forward to 1.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants