Search Unity

Something Like Final Fantasy XV But In Unity

Discussion in 'General Discussion' started by makoto_snkw, Nov 20, 2014.

  1. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Have you tried running the terrain? If you generate a single giant mesh, the performance shouldn't be bad at all if that's the only thing in the scene. If my 2012 apple crapbook can generate & move 400,000 rigged and animated *squid aliens while maintaining 79fps, I'm sure your computer can handle a single large mesh :D

    *The head was a rectangle, but the legs were subdivided in blender 3-4 times so they could bend smoothly.
     
  2. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    Wait, wait wait!
    Squid alien with tentacles?
    I mean tentacles? XD

    Okay, back to the discussion.
    But if you large mesh like that, how you gonna generate the nav-mesh for the AI?

    I'm sticking to Unity terrain instead of using meshes from other 3D software because I want to make use of the nav-mesh.
    It's free, it's there already.
    I don't want to spend more and more money to buy plugins if I don't really have to.
     
  3. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Yes, tentacles. They were subdivided to a point beyond necessary so they could smoothly bend and appear soft and slimy!

    nav-mesh? PFFF. I roll my own node system & A* solution for everything. But seriously, you only need a nav-mesh around the objects that are in the way, yes? Bake your nav meshes into complicated slopes and areas that have a lot of clutter to get around.

    I'm actually making a system now for path finding... something new, something unique, something... stupid! The ai sends out a little cube which spazzes all over the screen and tries to put down pathing nodes for the ai to follow.

    You should have fun with your ai and path finding. It's pretty easy to do, especially in unity where you can raycast to make sure you can move somewhere without hitting a wall. Ultimately, I would suggest that each of your world objects contain a list of nav points. Then you can check when an ai is near them and give them those points. If you're going somewhere, it's fine to give the ai a straight path. If you're navigating around an obstacle, you only need a few points.

    Right now my new crazy genius-stupid idea looks something like this...

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class flyscript : MonoBehaviour {
    5.  
    6.     /*reference to the main ai*/
    7.     public Transform parent;
    8.  
    9.     /*The current mode in use*/
    10.     public int fly_state;
    11.  
    12.     /*time delay for all operations*/
    13.     float tick;
    14.     float tick_limit;
    15.  
    16.     /*motion influence variable*/
    17.     int step;
    18.     int miss;
    19.     int allowed_misses = 5;
    20.     public bool done;
    21.  
    22.     /*points being collected*/
    23.     public Vector3[] points;
    24.     Vector3[] candidates;
    25.     int count;
    26.  
    27.     void Awake()
    28.     {
    29.         points = null;
    30.         fly_state = 0;
    31.         step = 0;
    32.         tick_limit = 0.02f;
    33.         tick = 0;
    34.  
    35.         miss = 0;
    36.         done = true;
    37.  
    38.         //candidates = new Vector3[Random.Range(1,10)];
    39.         candidates = new Vector3[20];
    40.         count = 0;
    41.  
    42.         Debug.Log(candidates.Length);
    43.     }//awake
    44.  
    45.     void Update ()
    46.     {
    47.         if(!done)
    48.         {
    49.             if(tick < tick_limit)
    50.             {
    51.                 tick += Time.deltaTime;
    52.             }
    53.             else
    54.             {
    55.                 tick = 0;
    56.                 switch(fly_state)
    57.                 {
    58.                 case 0:
    59.                     //idling
    60.                     return;
    61.                 case 1:
    62.                     spiral();
    63.                     break;
    64.                 }
    65.             }
    66.  
    67.             if(count == candidates.Length)
    68.             {
    69.  
    70.                 points = new Vector3[candidates.Length];
    71.                 for(int i = 0;i < points.Length;i++)
    72.                 {
    73.                     points[i] = candidates[i];
    74.                 }
    75.  
    76.                 resetVals();
    77.             }
    78.         }//done
    79.  
    80.     }//update
    81.  
    82.     void resetVals()
    83.     {
    84.         if(miss > allowed_misses)
    85.         {
    86.             points = null;
    87.             Debug.Log("Failed");
    88.         }
    89.         else
    90.         {
    91.             Debug.Log("Success");
    92.             for(int i = 0;i < points.Length;i++)
    93.             {
    94.                 GameObject g = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
    95.                 g.transform.position = points[i];
    96.             }
    97.         }
    98.  
    99.         miss = 0;
    100.         done = true;
    101.         fly_state = 0;
    102.         transform.parent = parent;
    103.         transform.localPosition = Vector3.zero;
    104.         count = 0;
    105.         candidates = new Vector3[Random.Range(1,10)];
    106.         Debug.Log(candidates.Length);
    107.     }
    108.  
    109.     void spiral()
    110.     {
    111.         transform.position += transform.forward*Time.deltaTime*step;
    112.         transform.Rotate(0, step, 0);
    113.         step+= Random.Range(-30,31);
    114.         if(step > 100 || step < -100)
    115.         {
    116.             step = Random.Range(-60,61);
    117.         }
    118.  
    119.         if(step % 13 == 0)
    120.         {
    121.             int mask = 1 << 9;
    122.  
    123.             /*if the number of candidates is more than 0*/
    124.             if(count > 0)
    125.             {
    126.                 /*if the fly can see the previous position*/
    127.                 if(Physics.Linecast(transform.position, candidates[count-1], mask))
    128.                 {
    129.                     miss++;
    130.                     if(miss > allowed_misses)
    131.                     {
    132.                         resetVals();
    133.                     }
    134.                 }
    135.                 else
    136.                 {
    137.                     candidates[count++] = transform.position;
    138.                 }
    139.             }
    140.             else
    141.             {
    142.                 if(Physics.Linecast(transform.position, parent.position, mask))
    143.                 {
    144.                     miss++;
    145.                     if(miss > allowed_misses)
    146.                     {
    147.                         resetVals();
    148.                     }
    149.                 }
    150.                 else
    151.                 {
    152.                     candidates[count++] = transform.position;
    153.                 }
    154.             }
    155.         }
    156.     }
    157. }
    158.  
    The end result will be an ai that generates it's own nodes to wander. The motion is so random and crazy so it can appear more lively than a series of lifeless RTS bots using the same path every time ;)

    The next phase is to actually make use of the nodes this little object creates. And since they're connect based on their generation, I don't even need to use A* to navigate them :D

    --edit to clarify

    This object will be invisible and is only making the paths to use. The object following these nodes will smoothly move between them.
     
  4. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    For wind you have speedtree plugin for example ; for monsters, textures and gorgeous 3D assets that's industry veteran 3D artists ;)
     
  5. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    Speedtree is awesome!
    But only for Unity 5.

    Unity 4.6 haven't released yet... let alone to wait for 5. Haha
     
  6. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Unity 5 is actually planned to be released before 4.6 xD
     
  7. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    Really?
    Where's the news link?
    I already have one project already running (not mmo let alone RPG) using the 4.6 beta.

    Btw, Tomnnn, you don't have thread for that tentacle game of yours?
    I would like to check them out.
     
  8. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Source there on that theory. Everything I've read said if anything they would do same time not a major release before an update to the existing. Nothing about releasing 5 before 4.6. That would be silly.
     
  9. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I read it in a forum post, it's best to consider it only a rumor. Maybe they were referring to the GUI system not being out of beta until after 5.x is out.

    --edit

    I found posts similar to the one I was referring to. The rumor was already cleared up, 4.6 is coming first but 4.6 features (uGUI and the associated bugs) will be continued in 5.x.

    The alien thing is from an old project for school. It's a couple years old now and I'm not exactly proud of it :)



    --edit

    Probably could have warned you about the music. I was inspired by house of 1000 corpses in that, that song is the most suited for serious fights :)
     
    Last edited: Nov 24, 2014
  10. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    That's make more sense now.
    Well, your game is not bad, but that look hard to play.
    Like it's on ULTRA HARD mode.
     
  11. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I didn't show it off much, but you could use 1-4 to control squad members, or press Q to make them all come to your position. It wasn't too hard if you had the maze layout memorized haha.