Creating depth of field using point perspective



Full disclosure off the bat, I'm no longer actively building a game. I was pretty active about 2 years ago, using the VXAce engine. While working out a few prototypes, my mind kept considering how the golden era JRPGs created such simple and yet beautiful non-battle mechanics (e.g. FF7, FF8, Legend of Dragoon, Star Ocean 2, etc.). As I became more familiar with the mechanics and how those games played, I realized these particular games were not using any 3D engines and that in part was what made them so artistic, in my mind. Additionally, there was no reason RPG Maker couldn't be coerced in some way to create similar gameplay.

So, it's a little rough around the edges, but I managed to make a village that accomplishes this concept pretty well in my opinion (video). In general, the complications include:

  1. Changing the size and speed of the sprite according to moving up or down in the DOF (depth of field). Some ruby libraries were already written that I made some relatively minor alterations to (I can’t recall which anymore, I’ll put a list of all the user written libraries, or scripts, I extended from at the bottom here). The other slightly tricky part was controlling the rate of change when moving inside the DOF. To do this I put coordinates paired with a scalar in the Notes section of each map to calculate what size and speed a sprite should be when at a certain height within a DOF (i.e. range1 20,38,71,95 zoom1 80,250)

  2. Assigning the portions of the map that are considered DOF, which naturally always is some sort of triangle. I basically find the coordinates that make up the DOF triangle in the Notes section of each map to generate the appropriate affects (i.e. DOF1 2800,510,2292,1250,3134,1250 which describes the x,y coordinate for a single DOF triangle).

  3. Changing the direction of the movement of the sprite such that up is pointing towards the zenith point (the top point of the triangle) and down is directly away from the zenith point. The slope the sprite moves at is steeper the further they are left or right from the zenith of the DOF triangle. But, in the end it was just a linear algebra problem.

  4. Creating custom artwork that works well within the rigid top down square design. When creating the spots that move from the DOF triangle to standard movement, they need to line up with a square to make the passability and fluidity work right, which just takes some consideration when drawing.

Overall, I think it’s a great proof of concept. I would love to see RPG Maker include or create a spin off that allows people to do this in a GUI. The engine doesn’t need much tweaking to make this very simple for a user. The trickier part would be still making it customizable with artwork that comes with the game that still works in these scenarios. But I think that it is still very feasible. Let me know what you guys think!


Scripts I built off of:
Victor Sant: Basic Module
VS_Character_Effects
VS_Pixel_Movement
VS_Diagonal_Movement
CP_Terrain_Tags
Yami_Overlay_Mappingv2
Shaz_Passability_Setup
Shaz_Passability_Mod
Wow, that is so neato.
I would pay like $9 to Degica for something like this.. *Kitty eyes.*
Looks really, really cool, and I would love to do such a game in the future. Unfortunately, since RM does not allow you to set this up easily within the GUI, making an entire game this way would take waaay to much time and resources for me to even consider it at this point in time.

If there was an update, some DLC content or well made plugin to make MV do the perspective manipulation fairly easy, then maybe. Still, making all the custom artwork would probably mean hand drawing all the maps for the entire game. But I guess that's something I could at least consider (in the future).
Aw man, that looks really cool! I can imagine it's quite time consuming. I reckon this would be great for hand-drawn backgrounds (like in the video).
Moderator note: Reopened, as this thread was closed in error.
I feel like I recognize that soundtrack. Star Ocean 2? Maybe Lacour, or Hurley? (Also, I don't think I was active in the community at the time, but I remember reading TONS of stuff from you in the GameFAQs message boards! You are truly O.G.! Welcome to RMW and I hope you decide to stick around and talk a lot 😀)

I like the style a lot. It creates a wonderful sense of scale that is so hard to capture in most programs like RPG Maker, and lends a lot more visual interest to each map. The effect doesn't need to be extreme - even at its most subtle, it adds a lot. Also scaling the size of the sprite is necessary to perfect the image, and is a great little touch that you added.

It straight-up requires working with a fully-made art piece as the background (a big ask for indie developers), and it also doesn't provide a 1:1 scale meaning that action mechanics would be very hard to pull off tightly in such a view. Therefore it seems well-suited for medium-to-high-budget RPGs, especially ones without Visual Encounters.

I assume that each map requires a different "triangle" (or quadralateral) to be mapped, depending on the placement of the paths and severity of the depth of field, right? I'm trying to wrap my mind around a few special cases:
  • Would you map a "reverse" triangle (where the top of the screen contains the base and the bottom contains the point) for a map where perspective opens up as you move toward the horizon, such as a temporary worm's-eye view or a valley pass that begins at its narrowest point and opens up as you move farther away? (Would you ever want such a perspective in a DoF game?)
  • For areas where you want to present a Depth of Field but there are no major obstacles or walls (such as a path leading down a wide-open prairie), how would it work when the player moved near the top-right edge of the screen, then held Down? Wouldn't they walk past the boundary on the right side of the screen before they ever got to the bottom of the screen, due to the zenith-based movement? Would it be our job as the designers to obstacle that path, or would we just move the player to the next map over to the right (from holding Down!) once they hit the boundary?
Overall - very, very cool!!
Ha dang I wish I saw this comment a year ago, yeah man Star Ocean 2 is right on, the song is played in a few of the towns I think Cross and possibly Lacour as well. I was super excited to get this kind of thing working with not too much coding effort because it emulated my favorite type of games: Star Ocean 2, Final Fantasy 7. I took a lot of inspiration from Star Ocean 2 in particular.

You're also right on about the triangle being mapped. As for a "reverse" triangle, I can't imagine that being a thing as it would imply your character is larger and faster further "up" the screen? I'm not sure I understand your example about the perspective opening up toward the horizon, the key factor when considering speed and size of the sprite is the closeness of the sprite to the viewing point (where the user would be in relation to the sprite in the scene), and the further the sprite is from the viewing point the smaller and slower it would be. I think you might be talking about the collision detection and not the closeness to viewing point part? You could do something like 2 triangles on both the left and right parts of the screen, which would work well for say a perspective in the middle of a hall and the player walks toward the perspective down the hall (sprite getting bigger and faster), passes the perspective, then continues down the hall past the perspective (sprite gets smaller and slower).

For no major obstacles, I did run into that exact problem, where if you were far away from the viewing point and at the edge of the screen you could leave the screen walking back down. This is a little trickier of a problem that would need considered when making the backgrounds. If you really want a free roaming field, with no boundaries on the sides, it'd be best to not force the perspective toward a point or alter direction when pressing up and down, but you could still keep the sprite getting smaller and slower. Then the problem becomes the same as any game of which when do you end the area the player can walk? Personally, I find giving obvious boundaries feels more realistic instead of just ending the screen in the middle of the field implying "Yeah there's more field there, you can't go that way" instead of a field in a clearing, and it's clear the trees are a boundary, or even a separation in types of grass you can't walk in the tall grass, then use that as the perspective boundary and you're good to go.

Thanks man! Sorry for a crazy late reply, I really hope to pick it up again once life settles down.
This is truly awesome, and makes me tempted to actually maybe start developing my game, as I want it to have this same DoF effect. May I ask if this was VX or MV? Do you have any of the scripts available?

Cheers!
@studiolook The OP says that this was done in VX Ace , which is not the same as VX. However, it is unlikely that the OP will answer your query about the availability of scripts as they have not been on site since July.

Moderator note: As the OP is not available, I am closing this thread. If you want it reopened please Report this post and leave the reason why.

Original thread: https://forums.rpgmakerweb.com/threads/creating-depth-of-field-using-point-perspective.89366/