Search Unity

Developing a Game like Infinity Blade in Unity?

Discussion in 'General Discussion' started by Randize, Sep 4, 2013.

  1. Randize

    Randize

    Joined:
    Sep 4, 2013
    Posts:
    7
    Hi people, I'm a freelance artist, I have good understanding in game development pipeline, but not the programming site. I'm looking to develop games like Infinity Blade in Unity, partnering up with a programmer or maybe learning to do it myself.

    So just solely looking at Infinity Blade's fighting mechanics, how hard is it to develop? Is it expensive? Any template available for this?

    As I'm planning to do this, I want to gauge whether this idea is too ambitious that requires a long time line to produce. Looking to hear opinions from both beginner's and professional's point of view.

    If anyone does see an interest in partnering up, feel free to hit me up.


    Regards,
    Randize
     
  2. LucasDaltro

    LucasDaltro

    Joined:
    Oct 31, 2010
    Posts:
    236
    The gameplay mechanics are quite simple,your problem will be with the graphics
     
  3. Randize

    Randize

    Joined:
    Sep 4, 2013
    Posts:
    7
    Thanks LucasDaltro! Are there any kit or template that you know of available in the unity asset store that could help me with the mechanic?
     
  4. Borderline Chaos

    Borderline Chaos

    Joined:
    Aug 7, 2012
    Posts:
    47
    Beginner here.

    It looks like object animations triggered by user input and collisions. I'm designing something similar but on steroids so I have a good grasp in theory how this works.

    You have set animations for all the attacks you want. Those animations are triggered when certain commands are met, such as sliding your finger left to right for a left to right slash. Most of your time will be spent modeling, unless you purchase a model, and animating your models to do what you want them to do. Like Lucas said, your focus will be in building sets and nice looking graphics.

    As far as the mechanic goes (again I'm a beginner) it doesn't look too complicated. Each of your animations coincides with user inputs. You'll set up what those inputs are (I assume you're going to be doing a touch input like on the iphone). From that you'll have a library of possible inputs such as left to right, right to left, up to down, down to up, tap, double tap, targeted tap locations which can indicate the location with a 2d GUI for more variation in input options. You'll link your animations to mirror those inputs. You'll want to restrict the animations to when you want your players to be able to use them. Like you don't want them to be able to attack right away after being clobbered. Boolean toggles would be useful to limit what animations you want the players to use at any given time. Set up object collision so when your models actually hit each other they will trigger damage values and animations that indicate the models being struck.

    I'm sure someone will be able to program that! :p
     
  5. Randize

    Randize

    Joined:
    Sep 4, 2013
    Posts:
    7
    Massive thanks for the explanation Borderline Chaos, as I was figuring out the draft AI with logic, object collision never came to my mind!
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    13,846
    Is collision even a thing? I've only played Infinity Blade a little, but from what I remember it was all canned animations with outcomes based on timing. Why detect actual collisions when you know from input and timing whether you want to apply a hit or miss?
     
  7. Randize

    Randize

    Joined:
    Sep 4, 2013
    Posts:
    7
    Good point, tho I was excited thinking what if I could implement collision to parry the enemy in real time... maybe not, still can be an turn based, but good initial spark nonetheless.
     
  8. HuskyPanda213

    HuskyPanda213

    Joined:
    Mar 24, 2013
    Posts:
    37
    Yeah, here is a basic script, it works ok. Still some glitches with up down. Though it should work. You will still need timers, for attacking, and the attack function, but that is not as hard, graphics, and iOS input is hard!

    using UnityEngine;
    using System.Collections;

    public class TouchSwipe : MonoBehaviour {

    public Vector2 lastPosition;

    public swipepath swipedir;

    void Update(){
    ManageInput();
    }

    public void ManageInput(){
    float fxoff = 0;
    float fyoff = 0;
    if(Input.touchCount == 1){
    Vector2 curpos;
    curpos = Input.GetTouch(0).position;
    if(curpos.x > lastPosition.x + 10){
    fxoff = curpos.x + lastPosition.x + 10;
    }

    if(curpos.x < lastPosition.x - 10){
    fxoff = curpos.x + lastPosition.x + 10;
    }

    if(curpos.y > lastPosition.y + 10){
    fyoff = curpos.y + lastPosition.y + 10;
    }

    if(curpos.y < lastPosition.y - 10){
    fyoff = curpos.y + lastPosition.y + 10;
    }

    //If the x absolute value is bigger.
    if(fxoff > fyoff){
    //Swings right
    if(curpos.x > lastPosition.x){
    swipedir = swipepath.right;
    }
    //Swings left
    if(curpos.x < lastPosition.x){
    swipedir = swipepath.left;
    }
    }

    //If the y absolute value is bigger.
    if(fyoff > fxoff){
    //Swings up
    if(curpos.y > lastPosition.y){
    swipedir = swipepath.up;
    }
    //Swings down
    if(curpos.y < lastPosition.y){
    swipedir = swipepath.down;
    }
    }

    lastPosition = curpos;
    }
    }

    }

    public enum swipepath{
    up,
    down,
    left,
    right
    }
     
  9. Randize

    Randize

    Joined:
    Sep 4, 2013
    Posts:
    7
    Thanks for taking the time to show your attempt, HuskyPanda213 Appreciate it very much. There's a few input touch script in the asset store, hopefully I'd be able to pick one that's good for this type of game. Right now, I'm having a problem figuring how's the structure of the code should be.

    From what I've gathered from Infinity Blade, there are at least a few types of enemies and each of them have a set of attack patterns or chain of attack. Say for example, Attack Type 1 for Enemy 1 consists of attack from Right, Right and Up. And then type 2 will have different set of array of attack pattern.

    This is what I've figured out so far:

    Touch Input script - More like yours or getting one from Unity asset store
    Enemy AI script - Different type of enemy uses different script. Containing attack patterns and public methods to check the attack patterns in boolean. Also the constant and variables for each of the attacks power and speed (duration or timer).
    Player Battle script - Responding to all attack patterns when they are true, either dodging, blocking or parrying (also public methods for Enemy AI script to check in condition), and if fail, subtract health point.

    As to where I should insert the player's attack strength and speed, and it's mathematics to get the correct value for the attack point is still a bit foggy to me. Anyway, I'll simplify things up and just do 1 type of attack for enemy and player, 1 respond from player to figure this out.

    I'm still learning C# as I go, but would love some input from all you pros out there, whether I'm heading to the right direction or if there's a better way of doing it.
     
  10. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,378
    Indeed. There is really no movement (except as part of the animations). The game knows what animations you and the opponent are playing and where in the animations they are. Just need to compare the two when moves are made to determine where/if they hit. I think in a game like this, collision would just add an extra layer of complication and the potential for things to go awry, especially since it is all about timing.
     
unityunity