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

Need feedback on a 2D sprite-based game using 3D level models

Discussion in 'Game Design' started by Fleetfoxx, May 22, 2015.

  1. Fleetfoxx

    Fleetfoxx

    Joined:
    May 22, 2015
    Posts:
    4
    I recently began working on a top down (45 degree technically) 2D sprite-based shooter game, and in order to achieve the level design, I decided to try and use 3D models. In order to get everything to work properly, I rotated the camera, along with all the sprites in the scene, by 45 degrees. THis meant that my 3D level models needed to be skewed by 45 degrees as well in order to avoid clipping and to look the correct height.

    I'm starting to rethink this decision, but I can't come up with a better way of achieving my desired result. Can someone recommend a better way of doing this? Or am I stuck with this skewed method?

     
  2. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    I would say it's your choice of perspective that's the real deal-breaker. Stick with either first person, third person (over-the-shoulder), sidescrolling, or top down. Anything else is likely to be irritating in a shooter. Shooters require precision, and weird projections just end up being a nightmare.
     
  3. Fleetfoxx

    Fleetfoxx

    Joined:
    May 22, 2015
    Posts:
    4
    Keep in mind that this is intended to be a 2D game. Think hyper light drifter, NES zelda, etc. Very basic shooting, just a straight line from player to cursor.

    I'd really like to know if there is a better way to approach this point of view where I don't have to skew my 3D models by 45 degrees.
     
  4. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    If you're using an orthographic camera, it really doesn't matter that you're using 3D models. Unless you go wild with dynamic lighting, the models with look flat just due to the nature of the camera.
     
  5. Fleetfoxx

    Fleetfoxx

    Joined:
    May 22, 2015
    Posts:
    4
    Right, but then the problem comes from the sprites clipping through the 3D models since they need to be adjusted to seem "flat" to the camera.
     
  6. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    I have no idea what you're talking about. Trying to make the models look flat? Kinda defeats the purpose of making models.
     
  7. Fleetfoxx

    Fleetfoxx

    Joined:
    May 22, 2015
    Posts:
    4

    I'm going for a look similar to this. Top down 45 degree 2D sprite-based game. I figured that making the level a 3D model would make it easier for the player to interact with the environment in a 3 Dimensional way, rather than having to use scripts to create the same effect.
     
  8. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    You shouldn't have to skew your models to make it look 3D though. Also bare in mind that the camera has more to do with how the player perceives dimensionality than how the level is constructed. If they can't move the camera (or more appropriately pivot the camera), then they can't properly gauge depth (which also ties into my warning about perspective in shooting).
     
  9. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,822


    ...What, you mean like this?
     
    Kiwasi likes this.
  10. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    Fleetfox: I think you are looking for oblique (or cabinet) projection. It changes the projection of the camera so that objects further away are higher up instead of shrinking, and flat objects that are perpendicular to the camera wont lose their proportions. Think old Zelda, Double Dragon, Castle Crashers and so on. They obviously didnt use this effect, but using it creates the same result but allows you to create your world in 3d without hacks.

    Please google it, there are both paid assets and free code examples available throughout the web.
     
    theANMATOR2b likes this.
  11. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    Found a really good GitHub repository. Save the scripts, and experiment with the angle value in the inspector depending on your needs :)
     
    theANMATOR2b likes this.