Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

New 2.5D "Pseudo 3D" Racing Game Engine

Discussion in 'Works In Progress - Archive' started by POLYGAMe, Jan 8, 2013.

  1. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Hey guys and girls, here's an early WIP vid of my current project. I've always loved these kind of games, so figured I'd make one :D



    No hills yet, only one roadside object and I haven't implemented the corner forces on the car. Getting there, though!

    Any and all questions welcome.
     
    cl9-2 and FBTH like this.
  2. Hakimo

    Hakimo

    Joined:
    Apr 29, 2010
    Posts:
    316
    Brilliant. Brings back memories when playing outrun. How did you do the the bended road effect? Shaders?
     
  3. hizral

    hizral

    Joined:
    Apr 27, 2010
    Posts:
    568
    Nice, how do you do the curve track, do you used wrap shader to bend the track?
     
  4. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Hey guys, nope, not shaders... wouldn't know where to start with that! I basically did it the same way as it was done on the old consoles, shifting each line of pixels... but instead of a line of pixels, I use a custom 2 poly plane. So there are 100 planes making up the road that I shift about to give the effect of the curve.

    There is a combination of shifting the planes back into 3D space and adjusting their scale to give the depth effect... probably much better ways of doing it, but it works.

    As for the movement, I just used one road texture and gave each segment only 100th of the texture visible, so the whole texture is spread across the 100 quads. Then I adjust the texture offset to make it look like the road is scrolling. That's why I had to put the farther away quads back along the Z axis, or the lines on the road would be the same width, losing that depth.

    As I said, probably better ways to do it... I couldn't figure out how to make the roadside objects work properly because of how I set the road up, so I just interpolate them between waypoints. It seems to work, though. I get around 200fps on my barebones Mac Mini and it runs smooth as silk on iPad. I haven't tested on iPod Touch or iPhone, yet... may need dual core processor.

    I chose to do it this way as all the other 2.5D games use spline systems (which I have no idea how to do in Unity) and don't quite manage to capture the same feel as the original games...
     
    Last edited: Jan 10, 2013
  5. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Am now doing this game as an homage to C64, rather than an NES type game... check out the new gfx :) Have authentic SID chiptunes for the ingame music, too.

     
  6. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Here's a new vid. Things are progressing nicely :)

     
    0tacun likes this.
  7. Yuecake

    Yuecake

    Joined:
    Mar 25, 2013
    Posts:
    2
    Hey, your work is awesome!

    I need a little help, I want to get this effect in my own Unity game. I just started on Unity scripting, so I'm still learning. But how would I begin to go about getting this effect? I'm not asking for hand holding just a push in the right direction. I am guessing I'd need to do it with C-Sharp?
     
  8. Numonic

    Numonic

    Joined:
    Mar 22, 2009
    Posts:
    241
    Wondering if you would be able to make a tutorial of this? Currently studying the techniques on this and would like a little more enlightenment on the work flow and approach to this through video tutorial format? I'm currently trying to fake this via rendering 6 frame sequences of road turns and bends and what not.
     
  9. gallenwolf

    gallenwolf

    Joined:
    Mar 11, 2012
    Posts:
    118
    Awesome!!! Love it :3
     
  10. Cheburek

    Cheburek

    Joined:
    Jan 30, 2012
    Posts:
    384
    this looks very cool and nostalgic. But I don't understand why even use Unity at this point :)
     
  11. iko

    iko

    Joined:
    Mar 19, 2014
    Posts:
    9
    Good job!!

    Scaling for straight road is clear, but how did you do for turn? I think that you didn't apply only scaling but a warping/distorting transformations too, am I wrong?
    Did you use pre-calculated sprite for straight roads and turns ?
     
  12. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Hi! Sorry guys, I haven't been receiving notifications on this thread!

    Basically it's just a bunch of quads that I shift left and right (simply by increasing the X offset slightly from quad below's X offset) to get the corners working.

    For the forward movement I just split a single texture over the 100 quads and scroll it. The quads are also "stepped" into the background to give the 3D effect.

    It's not an efficient way of doing it, but it works and gives a more retro look than manipulating vertices on a plane, as I'm guessing they did in Final Freeway and the like.

    I hope this helps!

    As for "why use Unity?" Well, why not? It's the tool I use for all my game dev ;)
     
  13. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    There's no scaling going on at all, other than with the roadside objects :)
     
  14. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Web player? :)
     
  15. Ashment

    Ashment

    Joined:
    Aug 9, 2013
    Posts:
    48
    Looks cool. Would like a webplayer too.
     
  16. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    No web version, sorry. The last time I released a game online, within a day it sprung up on a bazillion different sites under someone else's name (various people, actually), despite my logo/splash screen still being at the head of the game. Haha. Learnt that lesson!

    EDIT: In saying that, this is a really short demo, not a full game (yet), so I guess I could...
     
  17. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Most people here are good people. Use dropbox, not a game site. Should help.
     
  18. iko

    iko

    Joined:
    Mar 19, 2014
    Posts:
    9
    To make easier you made something like that ?
     

    Attached Files:

  19. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Yup, exactly.

    I've actually been looking deeper into this, as I didn't do it a very good way.

    I'm going to make a version of my game Project Downforce for Sega Genesis and I was alerted to this site.

    http://www.extentofthejam.com/pseudo/#sprites

    Wish I'd found it earlier as it explains really well how to do it the "traditional" way.

    Another way would be to simply texture a plane and shift the verts left and right in sequence but you wouldn't get the pixelised road edges.
     
  20. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Okay, here's how it looks in my Unity project, if that helps. The road segments are generated at runtime. It looks like I didn't actually stack them, not height wise, I just raised the camera.
     

    Attached Files:

  21. iko

    iko

    Joined:
    Mar 19, 2014
    Posts:
    9
    Wow, that's interesting.
    May you post some screenshots of the curve scene ?

    Thanks
     
  22. GarethIW

    GarethIW

    Joined:
    Jun 24, 2014
    Posts:
    50
    This is really awesome! And from those editor shots, it looks like you came across the same method that I ended up using when I tried the 2.5D racer thing last year (in XNA): http://bit.ly/1DfkFmu

    I tried doing the math to draw the track fully in 2D to start with (based on Lou's Pseudo 3D page) and then gave up and used actual 3D like you :) Except I wasn't brave enough to attempt generation, so I made an editor and ended up going for something more like Power Drift than outrun.

    Cool to see it being done in Unity, will be following your progress with interest!
     
  23. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Haha, I'm actually gonna try attempt it on Mega Drive now. No doubt I'll finish a game using it in Unity at SOME stage. lol.
     
  24. illuzion987

    illuzion987

    Joined:
    Oct 17, 2014
    Posts:
    2
    Did you copy this from Rad Racer? They will probably be a little upset...
     
  25. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    hehe brilliant loon :)

    ah.... the old outrun and chaseHQ days... keep it up, lookin sweet
     
  26. iko

    iko

    Joined:
    Mar 19, 2014
    Posts:
    9
    Excuse me,
    Do you move the camera or the quads to simulate the speed effect?
    May I see other screenshots of your scene ?

    Thanks
    Bye
    Fred
     
  27. Peter Ples

    Peter Ples

    Joined:
    Mar 12, 2013
    Posts:
    237
    This is rad! Great music too.

    illuzion987, All I can think of while watching your video is Strongbad! Oh memories...
     
  28. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    598
    would you release the unity project publicly or sell on the asset store?
    I wanna make an outrun type game but do not wish to program the stuff u already figured out.
    I'd drop a few bucks on it if you sell it.