Search Unity

Creating a character controller like "Devil May Cry 4"

Discussion in 'General Discussion' started by KazYamof, Sep 15, 2018.

  1. KazYamof

    KazYamof

    Joined:
    Jun 26, 2015
    Posts:
    59
    Hi fellas,

    I'm creating my on Third Person Character Controller, and I very curious how Capcom made DMC, one of my favorites games.

    See:


    For now, I have an XBOX One gamepad giving the direction input throug left stick (green ray), then I convert this direction to camera space (red ray) so when the player press left, the character moves left relative to screen and not to the world (which would give a stranger sensation in this kind of game). The red ray is the current forward direction of the character.



    I've made a camera to orbitate around the character using LerpAngle to be smooth. The camera always moves to stays behind the character.

    But looking at the DMC4, it's not like that. Camera seems to have a personalized behaviour on each ambient. Sometimes follows the character, sometimes doesn't follow completly.

    Another thing is when you are face forward (0,0,1) and give and perfecrt input to move backward (0, 0, -1), the character rotates back fast and start moving facing the camera, and the camera doesn't rotates to face his back.

    Also seems like they have multiple cameras on the scene, and depending where the character is, they activate one of them as default camera.

    I'm very curious about how can I make this behaviour while keeping my mental sanity.
    Any ideas?
    Thanks!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    KazYamof likes this.
  3. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Devil may cry is doing a lot of stuff w/ that camera. There are at least 3 modes.

    Relative character: anchor the camera relative main character off center
    Targeting: bind the camera to character but face target
    Anchored target: anchor the camera to a point while following character

    Although they might be switching cameras, I think its more likely they simply have a smash cut to new anchor point when the character hits a trigger. Although frankly, both approaches can be fairly simple to set up and the results would be seemingly identical.

    Really good quality camera work is really hard. I think it's one of the harder technical challenges in game dev.



    This video goes over some of the considerations, techniques and pitfalls. I think it's the best overall discussion of camera work I've found.

    I think you can emulate a good deal of the camera work in devil may cry, but getting the level of quality they do may take quite a lot of work.
     
    KazYamof likes this.
  4. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I've done a good amount of work on 3rd person camera and input, so if you have any kinda specific questions I might be able to help, but I donno exactly how the camera + input works in DMC, since I never played it.
     
    KazYamof likes this.