News Forums RAIN General Discussion and Troubleshooting Rotation face problem

This topic contains 25 replies, has 3 voices, and was last updated by  Pavel 1 year, 9 months ago.

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #6590

    Pavel
    Participant

    Hi, I have rotation face problem with rain, my enemy/player moves sideways. When my Player controlling by Rain, he rotate on 90 degress and went sideways, may be because my model rotated on 90 degress(for platform game). How can i tune Rain correctly? How i can say Rain what my model rotated 90 degress and rotate to normal angle(-90)?
    On Unity Forum i was added images and some posts but nobody answered me for the time being.
    http://forum.unity3d.com/threads/167791-RAIN-indie-Free-Powerful-AI-Engine-Released/page15?p=1492933&viewfull=1#post1492933

    • This topic was modified 1 year, 11 months ago by  Pavel.
    • This topic was modified 1 year, 11 months ago by  Pavel.
    #6595

    prime
    Keymaster

    Looks like you are making a 2D game. Currently RAIN only manages character facing and movement when the world axis is Unity 3D default (Y up).

    #6599

    Pavel
    Participant

    Yes I make 2d game(with 3d graphics), and do nothing? Are you add change face angle in future?

    #6600

    Pavel
    Participant

    And i have problem with detect Enemy, when my player detected Enemy with 100 health and then(when he going to Enemy) detected Enemy with 0 health he stoped. How change this that Player don’t detect Enemy with 0 health and don’t stop?
    I create some fast kills when pressed keys and Enemy near went to the enemy and kill him with knife then do something…and this already worked(like Far Cry 3(more) or Assasian’s Screed) and this with help Rain.

    #6601

    Pavel
    Participant

    I think may be rotate all scene with all models, cameras on -90 degrees for now.

    • This reply was modified 1 year, 11 months ago by  Pavel.
    • This reply was modified 1 year, 11 months ago by  Pavel.
    #6605

    Pavel
    Participant

    And i have one more question. Can i detect ledges used Rain Navmesh(for ledge grabbing or climbing) or better use this post http://gamedev.stackexchange.com/questions/40302/how-do-i-detect-ledges

    #6626

    Pavel
    Participant

    I decided problem with face rotation. I create varible(Rain AI) in player controller script and this varible assign to face AI Actions(on move and face Actions in the Behavior Tree)
    Code on Player(in Update method)

    if(transform.rotation == new Quaternion(0,-1,0,0))
    {// Right
    	stateRight = true;
    	aiStateV = new Vector3(0,0,-180000);
    }
    if(transform.rotation == new Quaternion(0,0,0,1))
    {// left
    	stateRight = false;
    	aiStateV = new Vector3(0,0,180000);
    }
    aiRig.AI.WorkingMemory.SetItem<Vector3>("stateRight", aiStateV);

    I add more angle because if use 90 or 180 degrees my Player model does not turn to the end.

    #6632

    prime
    Keymaster

    I don’t think I understand most of what you are asking. However:

    1) If you want to stop detecting something, disable its Aspect (set aspect.IsActive = false)
    2) No, the RAIN NavMesh doesn’t currently keep meta information about jump points, ledges, etc. You would need to do that with either Sensors/Aspects or some custom code (or use some other navigation system that does support it.)
    3) Maybe the Face problem is caused by your close enough angle being too large?

    #6638

    Pavel
    Participant

    My close enough angle = 0.001
    Thanks it’s working aspect.IsActive = false, but i have got access in code

    using RAIN.Entities;
    ...
    EntityRig tRig
    ...
    start()
    tRig = gameObject.GetComponentInChildren<EntityRig>();
    ...
    update()
    if(health <= 0)
    tRig.Entity.IsActive = false;

    But now my Plyer kill everything 😀 if detect. But i want one by one. If i can not handle with this i post correct question, i think it’s may be behavior tree problem.

    #6639

    Pavel
    Participant

    Ok I decided this problem in behavior tree i have selector -> and two constraint (move and attack like your soldier tutorial) sometimes attack constraint stuck and don’t return to main constraint(when check enemyhealth and resolution variable), and this attack constraint i set repeat forever and done)

    #6732

    Pavel
    Participant

    But all the same i have some bugs. If Player sensor detect Enemy and Enemy go out from sensor, Player attack on near Enemy but if near Enemy havent Player stuck or if Player detect another Enemy he attack and kill him but without animation(on Enemy). When player go to enemy and attack him on enemy playing animation but if there is something that I have described above on Enemy didn’t playing animation.
    Animation on Enemy need for fast kill if “fastkill = true” one on Enemy playing animation and then -> ragdoll else(if some bullet) ragdoll at once.
    I have this code for choice transition to the animation(and then ragdoll) or ragdoll at once:
    if i pressed keys and have enemy on sensor then

    if(aiRig.AI.WorkingMemory.GetItem("enemyhealth").GetValue<float>() != null)
        if(aiRig.AI.WorkingMemory.GetItem<GameObject>("aimTarget") != null) 
    	aiRig.AI.WorkingMemory.GetItem("EnemyP").GetValue<GameObject>().GetComponent<Health>().fastkill = true;

    How correct this? May be like that if Player detect Enemy and Enemy go out “fastkill = false” or if Player detect another Enemy kill him with animation or go to the detected Enemy.

    • This reply was modified 1 year, 11 months ago by  Pavel.
    • This reply was modified 1 year, 11 months ago by  Pavel.
    #6838

    Pavel
    Participant

    Anyone answer, Prime

    #8198

    Pavel
    Participant

    #8408

    prime
    Keymaster

    Sorry - I’m still having trouble following your description.

    Here’s one thing I can tell you: Don’t do this

    if(aiRig.AI.WorkingMemory.GetItem(“enemyhealth”).GetValue() != null)

    Instead, do this

    if (aiRig.AI.WorkingMemory.ItemExists(“enemyhealth”))

    #8409

    prime
    Keymaster

    Maybe it would help for you to post or send your BT XML. You can export it from RAIN 2.0.10

Viewing 15 posts - 1 through 15 (of 26 total)

You must be logged in to reply to this topic.