Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / How do you achieve 3D effects with 2D sprites?

Author
Message
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 25th Mar 2011 11:27
I've seen this done in a lot of games, especially Space Harrier and Outrun. Any suggestions as to how to do this? I've also heard that Duke Nukem 3D is 2.5D or something...

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Mar 2011 13:56
Usually these games will use sprite scaling, like rather than pasting the whole image, it will scale it down depending on distance. For walls, well there's actually someone (Cliff) making a 2.5D game like doom, and there are some wolfenstein style engine snippets too.

The walls tend to be treated as slices, so the sprite is still being scaled, but drawn one vertical line at a time.

Roads are similar, but the computers that ran Outrun and those other 2.5D racers were simply not capable of showing real texturing. So the roads would tend to be drawn in scanlines, these horizontal lines would be made from different images, usually bit-shifted for speed, as a lot of older machines had no blitter chips. This would allow the road to have quite smooth corners, white lines at the sides, white and red bits etc, all without using very much actual graphical data at all. In fact a lot of those games could get away with no actual graphics at all, the road could be constructed with pure code, setting the screen data directly. Roads in terms of todays hardware though, well I would just make a repeating top down road image and repeat that, scaling and offsetting each scanline to suit the road corners.

My favorite racers like that were Vroom and the Lotus games - much more fun than boring old Outrun.

Health, Ammo, and bacon and eggs!
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 26th Mar 2011 08:36
wow... so if I want to create smooth 3D effect walls/floors I just slice up the sprites into strips then scale each one with distance? I bet that must've been a headache long ago compared to the 3D polygons developers are working with today.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 26th Mar 2011 11:52
@Lonnehart: Out sprites came 3d polygons. And probs getting polys to work in a 3d matrix was not easy too, maybe even more difficult.

What you want to do is the basics of getting a 3d game... Direct X 3D does that for you...

Login to post a reply

Server time is: 2024-04-19 05:06:11
Your offset time is: 2024-04-19 05:06:11