edited May 2017 in ORK Support
100% Grounded, 100% of the Time, that's my goal. i want all my characters flat on the ground, all the time, NPCs and player group characters, in and out of battle, in life and in death, in heels or with flat feet, and in any situation where i haven't actually asked them to jump up and wave their arms in the air like they just don't care

so, that's the goal. for a number of reasons i don't think it would ever be 100% attainable, still, after a heap of experimentation i'm quite close now, except for one particular circumstance, which i'll come to in a moment

first, how the characters are currently configured:

NPCs use the NavMesh for their MoveAI. it gives the most natural path-finding. they're not forever bashing into the scenery, but it's at the expense of a certain amount of sinking into the landscape under some environmental conditions. however, because most of the NPCs in my game are either static (where it's irrelevant, because i've manually plonked them flat on the ground), or they're moving at some distance from the player, i can live with that

but i can't live with it for the player group characters, who have to move a lot closer to the player character, and where any sinkage is quite distracting. so, they're all set for their MoveAI to use Ork's in-built path-finding. they get lost quite often, but they move flat against the ground, and they always catch up the player to join in battles, so that's ok

so far so good. i turn off the NPC's NavMeshAgent in battles, and do some extra position adjustments for dead characters (to compensate for what prefab each character is currently using, and some other factors), and everything's dandy, except (and there's always an except):

if one of the player characters dies in battle, then once you come out of the battle, there they are, floating up in the air like they're a balloon on a piece of string or something. (that doesn't happen if i use NavMesh AI for them, but like i've said, that's not ideal for normal movement)

now, if i then revive them, they drop back down to earth and move around normally, so, you'd think i'd be able to do something like that (without the reviving them part obviously) to force dead characters to exit the battle on the ground, but i can't seem to get anything to work

i've set up an event that gets executed every time a battle ends, and i've tried to do a Search Combatants to return all the dead ones, but however i set it up it always returns zero, and even if i could get it to work i'm not really sure what i'd do after that

so, as always, any help or suggestions welcome

Post edited by HarryOminous on
  • edited May 2017
    Have you checked the position of the Capsule Colliders on your characters? (Or the generic Character Controller, which has its own capsule collider)

    Usually when a character appears to be floating it's because the capsule collider isn't centered properly.

    If you're normally using the NavMesh Agent then the character controller may not be present at design time and is added at run time, which could be centering it incorrectly.

    Also, have you adjusted the Base Offset value on the NavMesh Agents? This will raise the character models above the navmesh so they don't appear to be sinking. If you've done this and still get the sinking, you could use a foot IK solver to place the feet more correctly.

    EDIT: Unless you're using the Battle Grid, the NavMesh should be able to handle any other AI character movement. What is it giving you problems with?
    Post edited by Keldryn on
  • thanks for the reply

    as i said above, my current configuration (navmesh ai for npcs, and ork ai for the player party) is working pretty much perfectly, except for when one of the player group dies

    then, on returning from battle the dead character is flying at about head height from the ground (until you revive them, at which point they return to earth)

    i can solve the problem by using navmesh ai for the player party, but even with the base offset adjusted (something i've already done for npcs) the actors' feet sink into, or float over, the ground. not all the time, just often enough for it to be noticeable, and in a way that doesn't happen when using ork's native ai (which i'd guess uses raycasting to keep the actors grounded)

    it possibly doesn't help that i'm using an object-based game world, not just a terrain, so it's got steps and platforms and whatnot. i'll probably experiment with the navmesh bake settings to see if that helps any, but i'd still like to know if there's any solution to the dead character floating problem
  • Did you check the capsule collider/character controller component on the party member when floating in the air to see if it is centered correctly? I have seen times where the top of the collider is at the character's midsection so the bottom of the collider is resting in the ground, appearing to push the character up.

    Also check that they're not getting stuck on a collider that is supposed to be a trigger.

    It's low hanging fruit, but these are common causes of such behaviour.

    Re: Navmesh baking. It's simplified geometry, so it's never going to conform perfectly to the environment. Do you have Height Mesh checked in the bake settings?

    Otherwise, use foot IK to fix the visual placement of the feet. Final IK's Grounder works well, as does Bone Controller's Foot to Ground motor.
  • edited May 2017
    i'm using a character controller, and it seems to be positioned in death exactly the same as it's positioned in life, so that's unlikely to be the cause

    the dead characters float over any piece of scenery, but i've double-checked the one thing that could conceivably be an unwanted collider in my testing configuration (the battle generator) and it's set as a trigger, so that's unlikely to be the cause either

    i've got FinalIK and i use it in some other of my non-Ork projects, but i really don't want to further complicate this one, and particularly because under all other circumstances the player group characters move around the scene perfectly aligned to the ground when using Ork's in-built AI option

    ...

    BUT. one thing i'd not tried was to bake the NavMesh with "Height Mesh" selected, so i've just tried that, and set the player group characters to use NavMesh AI, and... the extra precision in the navmesh makes a BIG improvement to how accurately the player group characters (and i'd guess the NPCs too) move around on top of the scenery

    i'll need to rebake all my scenes and retest the various different battle/non battle scenarios, but i'm cautiously optimistic that might be a solution, so a big thanks for that suggestion
    Post edited by HarryOminous on
  • Dead combatant's aren't moved by their move AI (since they're dead :D) - try adding a Place On Ground component on your combatant prefabs if this is still happening :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2017
    how odd. i could have sworn that i'd already tried ork ai + place on ground, but i've just tried it again now and that does seem to stop the floating effect on dead player group characters

    however, as per the earlier discussion with keldryn, i've just gone through all my scenes re-baking the navmeshes to use the "height mesh" option, and that, coupled with navmesh ai for the player group, and some tweaks to all my battle events to account for the new configuration, seems to give me almost the 100%/100% i was looking for

    (i say "almost" because there's a non-ork related problem whereby some of the death animations i'm using don't leave actors quite flat against the ground, but i can just about live with that, and for my next project i'm planning on using ragdolls for dead actors anyway, which should solve that particular problem)


    oh, and as a small p.s., there's a similar floaty problem in the template game. return blue pants's underpants and get him to join you, and when you go to the field scene, he's floating above the ground (although, he drops to the ground again when you start to move)

    that looks like it can also be solved by adding a "place on ground" to his prefab
    Post edited by HarryOminous on
Sign In or Register to comment.