Jump to content

  • Log In with Google      Sign In   
  • Create Account


First person 2D Dungeon Crawler


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Moonkis   Members   -  Reputation: 273

Like
0Likes
Like

Posted 25 November 2012 - 08:51 AM

I'm inspired to make a 2D FPV Dungeon Crawler like Arcana, Eye of the Beholder.
You know when you see a psuedo 3D dungeon in a first person perspective like this:
Posted Image

Now, I'm note sure that SNES supported 3D so I suppose it was all done in 2D, I know that all tiles are drawn to look 3D when pieced together.

It's just that I have no idea on how to code this, at all, not even the simplest clue. I have done 2D top-down and side-scrolling but not a 3D-looking 2D dungeon with "depth". I know this can be achieved through 3D-programming with z-depth and all that fancy stuff, but I'd REALLY just like to do it in 2D, the classical way.

I figured some of you old foxes might know how to code this, and might nudge me in or explain it. I'v tried googling it but I came up with 0 topics around first person view in 2D.

The harders part I can imagine is scaling and positioning the walls, floors and ceilings that's further away so it looks like a complete hallway that you can see a defined amount of "cells" into.

Items, Monsters and other stuff is just plain scaling and not much piecing together with the other tiles so it shouldn't be hard to do.

So how do you do a 2D first person view for a Dungeon Crawler using strictly 2D?

I'm going to use SFML and C++ and I'd like to avoid 3D programming as much as possible, strictly using 2D skills.
So anyone got any ideas on how to achive this?

Edited by Moonkis, 25 November 2012 - 06:30 PM.


Sponsor:

#2 valles   Members   -  Reputation: 172

Like
0Likes
Like

Posted 25 November 2012 - 12:34 PM

Hello Moonkis,
I'm assuming you want smooth scrolling like Wolfenstien 3d correct? You might be able to find someone to help you build a basic 3d engine for this purpose. If you do not allow the person to spin, so he can only move forward and back:
For this solution your field of view is 90 degrees, facing a wall would cover the entire screen at depth 0. At depth 1, the wall would be half the size, at depth 2 a fourth,... The distances from the center would also shrink in this manner.

Also, if you don't allow the person to move forward and back, you could precompute the shapes like and old school rpg and have the player jump forward or back.

#3 Zipster   Crossbones+   -  Reputation: 580

Like
0Likes
Like

Posted 25 November 2012 - 01:33 PM

What you're describing sounds very much like Legend of Grimrock.

From what I've gathered, SFML has a window package that integrates with OpenGL, so all your 3D graphics needs should be covered. Unfortunately there is some level of 3D graphics programming and knowledge required to get even the most basic scene up and running, regardless of whether or not all the gameplay itself takes place on a 2D plane.

The best online resource I know of for learning OpenGL (and 3D graphics along the way) is NeHe. The first dozen or so legacy tutorials should give you enough information to get started. There are also a bunch of other links and references you can follow from there for advanced topics.

#4 r1ckparker   Members   -  Reputation: 387

Like
2Likes
Like

Posted 25 November 2012 - 02:03 PM

The old 8-bit games used bitmaps representing a wall from every different view. The image on screen is then pasted together, using these pre-drawn walls, to give a 3d image. Enemies, items etc are scaled depending on how far away they are from the player. More modern games use a 3d engine which just replicates the view, but in real 3d.
My own game uses 3d blocks which are placed within a level to make a maze. However movement is restricted to 1 unit 'steps' and the view is restricted to 90 degree views, making it 'feel' like an old-school game, even though there is no reason why you couldn't run around the maze and view it from any angle.

http://www.deepfall.moonfruit.com

Posted Image
Posted Image

#5 Moonkis   Members   -  Reputation: 273

Like
0Likes
Like

Posted 25 November 2012 - 03:49 PM

The old 8-bit games used bitmaps representing a wall from every different view. The image on screen is then pasted together, using these pre-drawn walls, to give a 3d image. Enemies, items etc are scaled depending on how far away they are from the player. More modern games use a 3d engine which just replicates the view, but in real 3d.

This is exactly what I want to do, and I know how it's represented just not how to achieve it, and I really don't want to do it with a modern approach using 3D ( After all that is what I asked in my first post ). Since the old games didn't use 3D ( Did they? Did SNES support 3D? ) it must be possible without using 3D strictly using 2D? If so, then how would you achieve that code-wise? Think Eye of the Beholder and Arcania for SNES.

Edited by Moonkis, 25 November 2012 - 05:36 PM.


#6 BitMaster   Crossbones+   -  Reputation: 3790

Like
0Likes
Like

Posted 26 November 2012 - 04:25 AM

There are two ways to go at this within the SNES-constraints.
1) Create a lot of pretransformed versions of your sprite. So for example <sprite>_frontal_distance0, <sprite>_frontal_distance1, ..., <sprite>_left_distance0, <sprite>_left_distance1, ..., <sprite>_right_distance0, <sprite>_right_distance1. Then you just have to blit the right sprites in.
Advantages: can take the non-planar nature of the sprites into account if the sprites are prerendered instead of just pretransformed.
Disadvantage: you will need a lot of space for each sprite; need to write/find/buy a tool to automate the sprite creation or it is a real lot of work.
2) Have one sprite and do a perspective projection on the fly (just a simple blit from a 2d rectangle to a 2d trapezoid). I'm unfamiliar with the exact capabilities of the SNES but I remember it had a lot of fancy 2d blitting implemented in hardware, if it can do something like that you get a (very) reduced version of modern 3d graphics.
Advantages: does not require extra work doing asset creation.
Disadvantages: might not look very good; math to be implemented probably requires a decent understanding of how 3d graphics work.

Edited by BitMaster, 26 November 2012 - 04:26 AM.


#7 jbadams   Senior Staff   -  Reputation: 17749

Like
0Likes
Like

Posted 26 November 2012 - 06:43 AM

Try this link: www.permadi.com/tutorial/raycast/

...or search using the terms "ray casting", "2.5d".

(Posted from mobile - apologies for the brevity and any errors.)

#8 Amadeus H   Members   -  Reputation: 1180

Like
0Likes
Like

Posted 26 November 2012 - 06:58 AM

This technique is know as "Ray Casting". Will make it easier for you to search for tutorials and whatnot. Posted Image

Edit: Woops, was beaten to it!

Edited by Amadeus H, 26 November 2012 - 06:58 AM.


#9 AticAtac   Members   -  Reputation: 313

Like
0Likes
Like

Posted 26 November 2012 - 07:38 AM

You might also look at the doom-engine (sources are available). It doesn't have the limitation of "90° walls" and there are tons of rersources for it, e.g. editors which you could use to create your own worlds. And there are different ports of "doom" with using OpenGL.

#10 Moonkis   Members   -  Reputation: 273

Like
0Likes
Like

Posted 26 November 2012 - 08:03 AM

WOW awesome guys thank you so much!
I'll look into it! You are all so very helpful! Damn! :D




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS