BlackPhoenix 0 Junior Poster in Training

Hello everyone,

I have been studying SDL for some time now, and would like to exercise my brain a bit. I think this particular challenge would be lots of fun, and I'd love to show off whatever I achieve when finished.

Basic 2D maps
Creating a basic 2D map (for a game, or just for basic image display exercises) is pretty straightforward. On the screen, we would create a surface named background, or map, or terrain (whatever we want), and would draw tiles to this surface, then flip the screen to render what we applied to the buffer. In a program loop, we would have to remember to clear the screen before flipping!

Isometric Perspective
With isometric, it gets a bit more complex. Similar to a standard 2D tile map, we create the map like this:

Map = [\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
[tile, tile, tile, tile],\
]

The difference is that with Isometric perspective, we must draw starting from the top tile and make our way from left to right heading down. (The offsets and other features need to be taken into consideration when creating Isometric perspective, but that is not really the point of this topic.)

An image of this drawing illustrated looks like this:
http://www.lingoworkshop.com/images/ISO-diag0.gif

2.5D, or 3D backgrounds with 2D entities/objects
What I am interested in doing is creating a program that will simulate an image similar to that produced in the game Ragnarok Online, which many refer to as 2.5D. Ragnarok Online, RO from now on, uses 3D backgrounds with 2D characters to produce a really neat graphical style.

I am interested in how this is achieved, and can be reproduced in SDL.

Here is an image of RO:
http://4.bp.blogspot.com/_pZFjXEmHs3M/Rou7BDYiOXI/AAAAAAAABDE/cR13ptDxfuQ/s400/Ragnarok-Online-DS.jpg

Actual Topic Questions
From my own experiences using SDL, I have an idea about how this is done, but I am not ENTIRELY sure. What I do know is that images are rendered to the screen in the order the surfaces are applied.

Does this mean I would have to apply a background surface of the 3D image I want to use, then apply a copy of the particular background sprite as a foreground sprite to be used in collision detection with the player's character, which is drawn last (first layer of three total layers)?

There must be an easy way to do this that I have no thought of yet.

I would like to add that once I have the basic 2.5D map working, I would like to implement the features of RO that make it magical. RO allowed the user to rotate his camera, and change the viewing angle from a little bit above the character, to a higher angle which was pretty close to top-down, but not quite.

Rotating the camera in Ragnarok Online basic meant every object could be drawn forwards, backwards, left, and right.

I have set a goal to achieve this functionality in a basic SDL window.

** Chances are slim that I can get you to click this link, but I would recommend it. It has a mouse-over sample of the angle/camera tricks I am explaining in the last few paragraphs**

http://iro.ragnarokonline.com/game/interfacecamera.asp

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.