1.2 C
New York
Friday, December 5, 2025

How can depth be effectively represented in a top-down indirect view? "2.5D" sport?


I am making a 2.5D sport in Pygame with a high down indirect viewthe place you possibly can see each the highest and the entrance of objects/setting, much like top-down JRPGs and 2D Zelda video games:

(SharkD Graphical Projection Diagram.screenshots from A Hyperlink to the Previous, Mario & Luigi: Celebrity Saga, Pokemon Ranger: Guardian Indicators)

I’m not referring to an isometric or dimetric projection as utilized in 3D sonic explosion, q**Berto* or radioactive mudnor video games which are actually from high to backside like grand theft automotive and Robotron 2084nor these with true 3D like, properly, most video games today.

I’ve had points with render order since day one. If I perceive accurately, most isometric video games merely type sport objects by their worth and, however this appears to cease working when objects may be on high of one another. Since all my terrain is objects, there are issues.

I discovered a trick that allowed me to depth-sort cubes by factoring z-position, however the cracks on this system are displaying increasingly more clearly because the challenge progresses. The angled containers present some glitches that might most likely be fastened, however the conical terrain appears to interrupt them utterly. The system could also be limping alongside for the needs of the challenge, however fascinated about the longer term (and a correct rebuild of the system) leaves me uncertain of what to do to get depth sorting working correctly.

The very first thing I considered was to do depth mapping much like 3D rendering. In principle it will work like this: earlier than rendering a form, attempt drawing the depths of every pixel in a depth map. Solely pixels nearer to the digicam than the pixel you are attempting to overwrite will probably be drawn. Pixels that might not be drawn on the depth map shouldn’t be drawn on the display screen.

This could resolve my issues, but it surely additionally sounds a bit costly. It is certainly appropriate for contemporary {hardware}, but it surely’s not one thing any of the outdated isometric video games would have carried out, at the least not in actual time.

So my query is that this: Did older 2.5D video games have a extra environment friendly technique for depth sorting or did they only precompute depth values?

Additionally, simply to make clear: sure, many elderly video games certainly solved this downside by both dishonest (i.e. inserting a set off underneath the bridge that places it on high of the participant when it crashes) or avoiding (i.e. with none bridge). It is a legitimate strategy, however I would relatively not do it.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles