Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075922 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:48:45 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Looking for beginners guide for a psuedo 3D game
Pages: [1]
Print
Author Topic: Looking for beginners guide for a psuedo 3D game  (Read 660 times)
Bursar
Level 0
**


View Profile WWW
« on: September 10, 2011, 01:46:58 AM »

I'm looking to create a psuedo 3D game (think OutRun, Space Harrier, even Pole Position), but I'm struggling to understand how to achieve the desired effect.

I've found a couple of links:
http://www.gorenfeld.net/lou/pseudo/
http://active.tutsplus.com/tutorials/games/create-a-racing-game-without-a-3d-engine/

They both look great, especially the second one, but I'm not having much luck trying to recreate the effects. I'm trying to port the effect to another language using sprites.

Following the second link, I can get the road drawn in perspective (Step 7), but it's adding the alternate lines in Step 10 that's confusing me.

I'm using two sprites for the road, one for the dark section with the red outline, and another for the light section with the white outline.

I can get the two colours to alternate every other line (so you get like a scanline effect), but it's the bit about scaling the sections of road so that they're thin at the top and thick at the bottom that's confusing me.

Is anyone able to explain what's going on in Step 10 and what I should I be looking to do, or alternatively if you have any links to share that cover this type of effect, I'd appreciate it.
Logged
ink.inc
Guest
« Reply #1 on: September 10, 2011, 01:50:04 AM »

Google Mode 7.
Logged
Bursar
Level 0
**


View Profile WWW
« Reply #2 on: September 10, 2011, 12:33:20 PM »

Thanks - I know how to use Google, and Mode 7 isn't really what I'm after. I was hoping someone might be able to take the time to explain the concept, or would have some links that explain it in fairly simple terms.
Logged
Nix
Level 10
*****



View Profile
« Reply #3 on: September 10, 2011, 01:15:57 PM »

and Mode 7 isn't really what I'm after

It sure is

You just draw stuff that's farther away smaller and closer stuff bigger
Logged
Zaphos
Guest
« Reply #4 on: September 10, 2011, 11:16:05 PM »

This is simpler than what I associate with mode7, because you don't need to change the view direction.

Following the second link, I can get the road drawn in perspective (Step 7), but it's adding the alternate lines in Step 10 that's confusing me.

I'm using two sprites for the road, one for the dark section with the red outline, and another for the light section with the white outline.

I can get the two colours to alternate every other line (so you get like a scanline effect), but it's the bit about scaling the sections of road so that they're thin at the top and thick at the bottom that's confusing me.
Okay, step 10 adds two blocks of code.

First block of code in there, they have an array with the z position of each line on the screen, and they scale those z positions by a constant -- this scaling just changes the thickness of the sections, you can play with the scale factor as you like.

The second block of code appears as they're looping through the lines, and it decides which type of road the current line will be.  It gets the z position of the line from the zMap array (which they scaled in the first block of code).  Then it says, assign which type of road it is based on that z value -- using the modulus operator so every 50 units in z it'll toggle the section it draws.  Because lines at the top of the screen are 'further apart' in z, it takes less lines to move 50 units in z, so the sections are spaced closer together.

Does that make sense?
« Last Edit: September 10, 2011, 11:22:50 PM by Jimmy » Logged
Bursar
Level 0
**


View Profile WWW
« Reply #5 on: September 11, 2011, 12:53:39 AM »

Brilliant, thank you. I now have a screen that looks like Step 10. Now onto the next stage!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic