Critique => Pixel Art => Topic started by: benreed on January 19, 2018, 08:15:49 pm

Title: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: benreed on January 19, 2018, 08:15:49 pm
I wasn't sure whether this or the 2D&3D forum was more appropriate, but I just have a quick question about the perspective in this stage mockup I'm trying to do.

I wanted to do a simple wooden pier of perfectly aligned planks a la Blanka's stage in Street Fighter 2, but got very confused very quickly about how to maintain perspective and keep the planks of reasonable width.

Here's a quick look at the crude method I picked to draw my planks:

1. Find the vanishing point. In this case, I started by picking a vanishing point at the horizon of the ocean background, vertically centered with the display width of 480px.

2. Pick a uniform length for the edges of the planks nearest to the viewer. Out of pure superstition, I picked a number by which the display dimensions were easily divisible (in this case, 12px), in case it made any difference. (I had neither mathematical nor artistic premises to base that on.) Copy and paste as desired. These were going to be the "anchors" for the seams between my planks.

3. Use a line tool to interpolate a 1x1 line between the vanishing point and the near edge of the plank. Repeat until as many planks as I can fit into the shot are defined.

Here's a quick drawing of my method applied, with one of the sprites I drew for scale:


As you can figure out both from the image and better common sense than mine, I quickly ran into a big problem with my perspective. The planks nearest the vertical center of the image look better, but farther towards the sides, their far edges start to look more and more pinched, and the planks start to look warped.

When I realized this, these are the first things I could think of to troubleshoot:
1. Re-evaluate the vanishing point. In the image above, I've marked two potential one-point vanishing points. I started by working with the one relative to the horizon, but I'm not sure whether it would have been more correct to use a vanishing point relative to the center of the display window. All I know is I'm still missing something for figuring out where my plank lines meet.

2. Refer back to my primary reference (SF2 Blanka stage), which either cleared something up for me or confused me further, I'm not sure which. I used the line tool to try and find what I thought was the single vanishing point in the stage, and I seemed to find that...there were multiple? (Two? Four, even?) Here's the result of my crude "study":


(sorry for the .jpg artifacts, I couldn't find a .png of the stage in native resolution)

I'm sort of confused here. On the one hand, the planks furthest on the outside definitely appear to converge on a horizon-relative vanishing point. But the ones closest to the center appear to converge on a vanishing point slightly off-center and decidedly below the horizon. And since the planks are perfectly mirrored (shape-wise, at least) along the stage's vertical center, it looks like there's a total of four vanishing points, two on each side of the vertical center. I can't quite articulate why this perspective works in-game beyond a suspicion that it has to do with the screen scrolling (you'll never see more than half the stage at a time in-game), but I'd sure like to learn the logic behind it.

Additional context:

What are some other things I should look for (besides immediate stuff like "one-point or two-point perspective? where are the vanishing points?") when I study other fighting game backgrounds?
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: eishiya on January 19, 2018, 09:31:39 pm
One-point perspective is a simplification that is only accurate for small fields of view. The further away on the canvas/screen an object is from the vanishing point (VP), the more distorted it'll look, because in real life, things are much more complicated. In real life, a long boardwalk/pier won't appear parallel to the view plane for its entire length. Instead, the further away it is, the closer to perpendicular it will seem, since the near edge of the pier gets to be nearly as far away as the far edge of the pier once you're looking at far-away points/planks. This effect results in the characteristic curve of panoramic photography (http://static.panoramio.com/photos/large/79348924.jpg).

This isn't to say that you should have more VPs and try to emulate the panoramic look (as that could mess with the gameplay plane), but rather that you shouldn't worry too much about obeying a specific mathematical perspective. Use it as a guide for planks towards the middle, and towards the edges, focus more on what reads clearly than on perfectly obeying your VP. As long as it's roughly right, people aren't likely to notice.

Another option is to ignore/break perspective in the foreground. This is common with brawlers and other games that have very wide maps where one-point-perspective produces distorted results. With such a wide stage, this might be a good option.

You could also do a mix - have correct perspective in the middle of the map, and then switch over to just tilted, perspective-less planks beyond a certain point:
This method makes sure the planks look nice even if the action moves to the edges of the map, where true one-point perspective would be very distorted. Their direction also makes it visually very clear where the middle of the map is.
In this case, where the perspective part transitions into the parallel projection (perspective-less) part, you'll want to employ some trickery to make the transition less obvious. The easiest way is to put damaged planks or some objects there, but it can also be achieved with clever shading and AA, or by very gradually shifting the vanishing point that each plank boundary obeys.
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: benreed on January 19, 2018, 11:00:43 pm
Thanks, eishiya, for the feedback.

I think you're right about having to shift perspective towards the outer edges to avoid the panoramic look. Still trying to figure out at what point to try and cleanly fudge (oxymoron?) that transition, but I did figure one important thing out a couple minutes ago.

My earlier "study" of Blanka's stage was a little too hasty. I was whipping it together at work in a scrunched window, so I didn't take the time to properly plot the lines across the whole height of the stage. I looked for the vanishing point(s) again at home, with a whole monitor devoted to the full-width image, and came up with a much more sensible result:


It's much clearer from this study that the vast majority of planks are, in fact, converging on one single vanishing point perfectly aligned with the vertical center of the stage. (One of the outer ones looks like it might be going elsewhere, but that was probably me drawing the line wrong.) I do notice one key difference, however -- the vanishing point is well below the horizon, which was where I targeted my vanishing point.

I also need to hit up Youtube and take a closer look at how much the pier scrolls when characters jump. I forgot to account for that, but so long as I make the planks proportional, it should look okay in motion.

This might make a key difference for my piece, so it's the next thing I'm gonna play with today. I'll try a first attempt by picking a vanishing point roughly proportional (vertically) to where it is in Blanka's stage and see how it looks.
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: SilverBrick on January 21, 2018, 02:08:57 pm
You could always make all the boards uneven. That way any imperfections will look like they're just part of the scenery.

In fact, I think that's what Blanka's stage is doing. The boards, especially near the edges, have uneven ending lengths, widths, gaps between them etc, which I think was at least partially a way to obscure the perspective issues.
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: yrizoud on January 21, 2018, 02:33:31 pm
The actual Blanka stage probably has "wrong" vanishing point because the elements were drawn before the screen composition was finalized. The error is barely visible, especially since the actual screen window moves to shows only 320 pixels wide.

In your case, you also have the option to move the horizon line up. More sea to draw, less sky. This mimics a camera being higher than the characters, however, so it's not the most impressive way to show a duel.
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: benreed on January 21, 2018, 06:44:19 pm
Thanks yrlzoud and SilverBrick for the feedback.

Here's where I decided to go with the plank perspective:


You guys were right, I had basically no choice but to disobey the vanishing point to some extent. So what I did to adjust was to find the smoothest possible transition between the center plank seam vertically aligned with the vanishing points and the outermost planks from eishiya's suggestion, which indeed looked just how I thought they should look. I think I pulled it off?

Once I figure out some quick and dirty posts for the pier, I'll start looking at how to detail the planks. I've been mostly going off photo references because while piers are definitely a thing in pixel art/game assets, they're considerably difficult to search for on PJ, spriters-resource, etc. with simple keywords like "pier", because they're never the primary focus of whatever piece/sheet they're in. I've been recalling a couple other games with nice-looking piers, though -- pretty sure Metal Slug had more than a few levels with them?

Most of my pixel work is usually characters. This is the first time I've put so much work into background/prop assets, so it's definitely a challenge. But I'll try and finish my thought just to see what I learn. My main goal is just to improve my "programmer art" to a point where I can bear to look at it when I actually code crude games, heh.
Title: Re: Find the correct vanishing point(s) for pier planks in stage mockup?
Post by: eishiya on January 21, 2018, 08:16:28 pm
At a glance, it looks good! Looking at it a little longer, the uneven widths of the planks become more apparently, but I think once there's texture and other details, it'll be a lot harder to spot.

Rather than limiting yourself to piers when you look for ref, look at how people have done wooden objects in general. There are a lot of works out there that have wooden flooring in houses, etc.

Metal Slug and Shantae both had some piers. Chasm has some lovely scaffolding. I'm not sure, but I think Frogatto & Friends has some piers or scaffolds.