Search Unity

How to design input for mobile 2D top-down hack & slash game?

Discussion in 'Game Design' started by Sheikz, Nov 13, 2015.

  1. Sheikz

    Sheikz

    Joined:
    Nov 1, 2015
    Posts:
    24
    Hello,

    I am currently brainstorming about the mobile input for a 2D top-down game hack & slash.
    Think about a mix between Zelda and Diablo3, without any melee attacks. Only spells.

    How would you design the mobile input system for such a game?

    It is straightforward on PC with the combo mouse-keyboard: keyboard for moving the character, mouse-clicking to aim a spell.

    There are 2 types of spells:
    • Targetted spells: those are launched from the player to a target point in space. Examples: Fireball, frostbolt, ...
    • Untargetted spells: those do not need a direction. Example: shield, heal-self, ...
    Here is my current idea:

    Virtual joystick in the bottom left of the screen. This will allow for statically changing direction (for aiming), or moving by touching further from the center.
    Spells icons in the bottom right: tap the icons to cast the spells. For example, 2 targeted spells and 1 non-targeted spell may be available at any moment in time. The non-targetted spells are straightforward. As for targetted spells, they will be launched in the direction the character is currently facing.

    The problem I am facing is mixing movement and aiming in a flowing fashion. More specifically, I am afraid that the player may not know exactly where he is aiming, and how to aim while moving.
    For that, I am considering adding a straight line of sight in the direction the player is facing, crosshair-style.

    Do you know any similar games that use an efficient input system for mobile?

    Thanks.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm not a big fan of virtual joysticks on a touch screen (even though I've done exactly that, for Retro Robots). They often get in the way and can be tricky to use, since you can't feel them.

    How about touch-to-move? Turn directly toward the point touched (so, very fine grain control and easy aiming), and move after a short delay (that maybe depends on how far you had to turn). So a quick tap turns without moving; tap and hold walks or runs.

    Spell buttons in the corner still seem like an OK idea to me, as long as they don't get in the way of the play area.
     
  3. rchmiel

    rchmiel

    Joined:
    Apr 5, 2015
    Posts:
    49
    You will need:
    > Vector2 for joystic start position
    > Vector2 for current joy position
    > Vector2 for joystic area - margin around joy to easy touch
    > float for max radius - max joystic move

    Next:
    > you must calculate normalize: joy start position to current joy position
    > remeber that the joy can not move ouside max radious
    > next you must compare joy normalize to player normalize and then you will know whitch way player must go.

    You could use:
    > Vector2.Distance();
    > Vectro2.normalized;
    > transform.TransformDirection(Vectro3.forward);
     
  4. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    4 Setups:

    1. Twinstick shooter
    You may want to scrap the "Aim at point" aspect for mobile if you want to be controller-compatible (analog-sticks).
    What i mean by that is that every spell that is targeted only has one input: direction. Distance is fixed (e.g. your fireball explodes on contact or after 10m)

    2. Movement-pad, tap on scene to cast on point
    If you do it that way you should arrange your levels in a way that you never progress in the direction where your movement-pad obstructs casting

    3. Twinstick/gesture hybrid
    This is what i do for my game: basically it divides the screen into left and right. You can either hold/tap or flick those halves. E.g. i use the left side to move, but when i have to dodge i flick anywhere in this half of the screen and it detects it as a dodge into the flick direction. Problem is that is is a little bit tricky to implement, you have to track your touches, check when they have started, how long they where held, distance of start and endpoint, direction of flick. Took all my after hours for 3 weeks to make it work flawlessly. But now i don't need those multiple button setups that most games have, i can perform a lot of different actions without ever switching modes with a button. Actions: move(directional), dash(dir), quickcast(dir), channel(dir), 3 different melee attacks(dir), 2 chargedMeleeAttacks, block

    4. Download "Implosion" (Playstore)
    They have a neat feature to aim with the gun, hold attack and draw your thumb into shooting direction
     
  5. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    936
    I've considered building a game that would be played in a vertical screen mode and having the player hold and play it like a game boy.

    Maybe you could have a dedicated joystick at the bottom with a couple of spell cast buttons to toggle between and maybe you cast by using your other thumb to swipe in the direction you want to aim it. Or tap on the screen in the direction you want to cast.

    This way you can avoid the virtual buttons obstructing screen view. You won't be losing much screen space because your thumbs take up a bunch of room when you play it horizontally.
     
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You want an auto target system. Simply hit the target in the approximate direction the player is facing. The player should never be penalised for playing on an inferior device.

    You also should check out the input schemes of other successful games in your space and shamelessly copy.

    You should also consider your game might not be a fit for mobile devices. Mobile is for five minute diversions on the train or the toilet. Successful mobile games are typically ridiculously simple.
     
  7. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    What can you simplify? Like @JoeStrout, I'm not a big fan of these complex RPG control schemes for mobile devices. Either the phone is too small, or the tablet is too large. Either way, it's not ideal. My recommendation is to SIMPLIFY the input controls - less buttons, less inputs, less control. Find a way to simplify, while increasing the core element of fun.

    Gigi
     
    Kiwasi likes this.