Search Unity

Tutorial Requests

Discussion in 'Community Learning & Teaching' started by GargerathSunman, Apr 4, 2010.

  1. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    I'm starting a new setup for Unity-Tutorials.com as of this weekend. Basically, in addition to the normal tutorials that I make, I'll provide a Q&A tutorial for all the people that ask specific questions inside this post. These are the smaller questions that most tutorials miss like "How do I make a homing missile?" or "How do I get a normal rolling ball?" and answer them one after the other.

    So, feel free to ask! I'll be releasing them as fast as I can. Just try to keep them as smaller topics. "How do I make an RPG?" is a little large for a 5-10 minute time slot.
     
  2. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    I would like to know how i can make a spaceship (with some speed foreward) fly in all directions in a 360 degree loop with no constraints?

    I mean how can the Spaceship fly up and down in a circle, reight and left in a circle and also make a roll around its own axis in 360 degree?

    Rotating around the x, y and z axis.

    Thank you.
     
  3. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    Ok, so a free-flying spaceship that can rotate on every axis? I can do that. It'll be a little nostalgic, as that's how X-Wing handled flight.
     
  4. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    While at it, add a working horizon instrument. That`s where i failed ;)
     
  5. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    Working horizon instrument?
     
  6. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    AI for FPS

    Thanks
     
  7. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
  8. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    Ok, so a measurement of tilt relative to zero z-degrees? I'd probably use a Vector3.Dot that always points straight up and compare it to the Vector3.Dot of the one that's transform.up from the aircraft. That would give me the difference, so the absolute tilt. After that, I'd compare it to a second Vector3.Dot for a static right from a hidden object facing straight. The two combined would give me how tilted the plane was and in what direction it was tilted without ever having to rely on euler angles.

    AI is a bit broad, don't you think? Do you mean camera AI, turret AI, basic charge the player while dodging pieces of terrain AI, etc... There are a lot of different setups for NPCs in a first-person-shooter. So what in specific are you having problems with?
     
  9. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
     
  10. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    Well yes, but I'm not making these for general purposes. The purpose is: "What in specific do you need solved?" So, I'd like to solve whatever issues/questions that Shader had, not a general tutorial on what AI is.

    Yeah, I'll include calculating the horizon in the first Q&A. No worries.
     
  11. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Well, it is one of the common misunderstandings that AI is something like put in your AI code, and everything works fine then. Something like Cut n Paste.

    But AI is of course very special and always different, dependand of what you want to achieve. And so, to answer the question about AI ends in either something very general. Or something this specialized that it ends in more than one book. Nothing that somebody who has no idea about AI is aware of. That`s why i suggested a more general approach to teach the basics first. Pac Man is the mother of all AI :)

    And thanks for including my issue in the Q&A. Looking forward to it :)
     
  12. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    With respect to AI, sorry I was initially too vague.
    What I meant was :

    An enermy following or chasing you, even knowing you are behind a wall etc.

    I have tried various methods but none seem particularly good. I need to understand how it works rather than blindly coping code.

    Thank you

    Gareth: What happened to the Advanced tutorials that you mentioned some time ago ?

    Cheers
     
  13. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Don`t want to hijack the thread, but that seems to be the wrong approach to me. AI is made of several subsituations. It`s a complex bunch of code, connected by variables. When your pathfinding fails doesn`t mean that the rest of your AI is bad. It just means that the pathfinding part needs a better solution.

    So instead of searching for a complete new AI i would search for fixes where the current AI fails. You don`t give away your whole car just because one of the tires is loosing air :)

    It`s always the same story. Divide your needed AI into its smallest possible steps. Then solve them one by one. Chasing or not are two different situations. To switch between them you could measure the distance fo the enemie to your character. When distance lower a value then start to chase. When distance greater a value, then stop chasing.

    The rest all heavily depends of what you want to do in particular, and with what solution you are happy. You could for example use different path finding methods. You could even use some kind of a sensor system instead of pathpoints. Or a array solution, or ...

    Nobody can give you a complete AI solution or a tutorial for it. But you can get help with the subparts.
     
  14. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    Is this really true ? Damn. :)

    But seriously, your advice is good. I am lazy :(
     
  15. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    The advanced tutorials are still going strong. I've just been on a long break in order to pursue consultation contracts and create a few academic setups for the tutorials.

    I even recently released one on Optimization, so there you go!

    I've got no problem with creating a chase AI setup for you. Keep in mind, however, that my pathfinding will be relatively primitive. The focus seems to be on keeping track of a player even when the player is out of sight and continuing to attempt to track him.

    Reminds me of one setup I had where my guards had a box trigger attached to their head bone that scanned a certain area in front of them. Wherever they look, if the trigger hit a player, it then checked to see if it had line of sight. If it did, it initiated chase procedures.

    Inside the chase procedure, it continually stored the "last seen" position for the player. When the player went out of sight, it then ran to the last known position and started looking around. If it saw the player, it continued the chase. If it didn't see the player, it returned to its patrol route. Worked pretty well for indoor AI.
     
  16. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    Oh, and people were asking whether I'll be making this for free, so I figured I'd expand a bit.

    This first Q&A will be entered in the tutorial contest Armagon started ages ago and extended to April 15th. As a result, it will be 100% free to all.

    The subsequent Q&As, though, will be sold at about $10 each. It'll be darn cheap, and each question will be something useful to know, so I'm hoping the value will be more than enough.