XNA RPG 2.5D Game Engine - Updated WIP

9of9 · 281K views · 2009 · 9:12

Open on YouTube

Computer graphics & renderingGame programming & enginesIndie game developmentdemo

Why Game Development Stack Exchange recommends it

Game Development Stack Exchange users link it as the standard example of 2.5D sprite lighting using normal and height maps, in answers about 2D lighting, depth testing and isometric engines.

Recommended by 2 people across 2 different months, 2012 to 2014.

What it is

A 2009 work-in-progress demo of an XNA RPG engine that moves from flat 2D to a 2.5D look. Sprites are pre-rendered with matching normal and height maps, then combined in shaders to get dynamic lighting and per-pixel depth without rendering any polygons. The developer (9of9) explains the pipeline in the description.

What people said

Recommends John McDonald · 2012-01 · Game Development Stack Exchange · on “Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?”

Normally, lighting in 2D games is done by having a Normal Map [LINK] for all of your sprites, then calculate the 3D lighting effects on your 2D sprites. This is known loosely as "2.5D". I would however not recommend doing this in your first game as it is complex. Here's an awesome video of someone who has done this in XNA: [this video] That said, there are probably ways to cheat and get a pseudo-lighting system that could work with various assumptions.

Recommends David Gouveia · 2012-04 · Game Development Stack Exchange · on “When does depth testing happen?”

Depth testing happens in what is known as the merging stage after the pixel shader (also check this link [LINK] ). There's however an optimization technique called the "Early-Z Test" which is available in some graphic cards, and it consists of moving the check before the pixel shader so that it can be skipped completely for occluded fragments. As for whether you can modify the depth value of a fragment in the pixel shader, yes you can and this source confirms it [LINK] . although I'm not sure how to use it correctly. Quoting: The DEPTH output semantics can be used to change the destination depth value at the current raster location. As for your confusion regarding 3D, you should know that th

Cites Kiada · 2012-07 · Game Development Stack Exchange · on “Does anybody know of any resources to achieve this particular "2.5D" isometric engine effect?”

I understand this is a little vague, but I was hoping somebody might be able to describe a high-level workflow or link to a resource to be able to achieve a specific isometric "2.5D" tile engine effect. I fell in love with [this video] this engine. Especially with the lighting and the shaders! He has a brief description of how he achieved what he did, but I could really use a brief flow of where you would start, what you would read up on and learn and the logical order to implement these things. A few specific questions: 1) Is there a heightmap on the ground texture that lets the light reflect brighter on certain parts of it? 2) "..using a special material which calculates the world-space normal

Cites VaTTeRGeR · 2013-07 · Game Development Stack Exchange · on “using heightmap to simulate 3d in an isometric 2d game”

I saw a video of an 2.5d engine that used heightmaps to do zbuffering. Is this hard to do? I have more or less no idea of Opengl(lwjgl) and that stuff. I could imagine, that you compare each pixel and its depthmap to the depthmap of the already drawn background to determine if it gets drawn or not. Are there any tutorials on how to do this, is this a common problem? It would already be awesome if somebody knows the names of the Opengl commands so that i can go through some general tutorials on that. greets! Great 2.5d engine with the needed effect, pls go to the last 30 seconds [this video] Edit, just realised, that my question wasn't quite clear expressed: How can i tell Opengl to compare the ex

Cites Tara · 2014-05 · Game Development Stack Exchange · on “Zelda-style top-down RPG. How to store tile and collision data?”

For collisions I would simply store a polygon per tile. I don't know if you need three degrees of movement, but for two, this would be very simple. In that case I would simply store a convex polygon per tile. For example a triangle, quad, hexagon or whatever shape you need. Then simply do circle (player) vs polygon (tile) or box (player) vs polygon (tile) collision detection. This can be done with SAT (Separating Axis Theorem). Maybe XNA already offers you something like that. With this approach you'd automatically get nice sliding on slopes and stuff. If I wasn't clear enough, I mean something like you see in this video (the red lines around the objects): [this video]