TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

GGMAX - Problem with mammals #2609

Closed Necrym59 closed 1 year ago

Necrym59 commented 2 years ago

I have a Deer animated model trying to use the MAX mammal script. Everything seems to work ok except there is no movment of the model. The model has all the correct animations that match the others and it animates correctly as it should, it just does it on the spot. All the setting are identical i just cant seem to find the reason, is it the model or something in the script im missing.
deer.zip

AmenMoses commented 2 years ago

The models animations need to have motion included and the .fpe settings need to match the stock models.

i.e. look at one of the stock animals and make sure yours match.

Necrym59 commented 2 years ago

Hi Amen, if you look at the sample i included its exactly the same as for example the 'fox' all animation names match and are called corrrectly what is this motion you speak of this is somthing im unfamiliar with, isnt movement handled by the script - how can it be handled by the animation and over what possible distance there are no specs to work with??

fearlesswee commented 2 years ago

It's called "root motion animation", where the animation itself includes the motion data of the character; moving the "root" of the model hence the term. The primary benefit of doing it this way is it's extremely easy to include "uneven" motion that would be otherwise hard to replicate in script in a way that matches the animation, such as a zombie with a shuffling gait where they take a quick step, then slowly drag their other foot forward.

The default mammals (and every character included with GGM come to think of it) uses root motion, so you'd have to animate your deer with root motion as well if you wish to use the stock scripts, or adapt the stock script to use the "old school" way of moving a character.

AmenMoses commented 2 years ago

Yep, what he said. :)

The fish and birds don't have it btw, but that is because it doesn't suit them but the mammals script requires the motion to be part of the animation.

Necrym59 commented 2 years ago

Ok thanks guys for for the explanations, ive done some reading on it all too. So essentially every mammal model that doesnt have it is useless in MAX, unless they are animators or write specific scripts - seems an unhelpful messy way overall, to me it it seems a script should cope with alternative scenarios of game developers models. Similar sort of restrictions seem to apply to models that arnt part of character creator. Not what people want to hear especially if they have a lot of models, from what ive seen so far this is mainly an unreal/unity thing, i can understand its useage though (at least they have included the tools for it). So the only way forward now is to find a way to get RM bones and movement in on every model owned. I have no idea how to do it and blender is an abomination, dont know if there are other progs out there to do it, so i guess i either wait until models are made available for GG or pay an animator to do it - great but unhelpful choices.

LeeBamberTGC commented 2 years ago

@Necrym59 You do not need to use "root motion animation", you can set the nav mesh following character to NOT use the spine tracker and use regular movement speed to follow the path if you like :)

Necrym59 commented 2 years ago

Thanks Lee, but im not sure how that is achieved? Im dumb when it comes to animated models i think. I understand what your saying but how/where do i impliment it, others will have to know as well i think. Sorry to consume your valuable time with this.

LeeBamberTGC commented 2 years ago

@Necrym59 Check out "scriptbank\animals\fish.lua" as that shows how to use a script that relies on movement speed.

Necrym59 commented 2 years ago

Thanks Lee, i do or will understand how to script for it,m i was hoping not to have to script for every model. My original point was if MAX is going to have a plug in behaviour for 'mammal-generic' then it should have dynamic script options or a script available for models that dont use rm bone motion. Its misleading and just plain wrong, theres nothing generic about it for most peoples models. Its a useless behaviour for people to select as most people wont have that capabiliy or knowledge and will only lead to frustration. Thanks anyway mate, i appreciate the response.

AmenMoses commented 2 years ago

The -generic bit means it works with all the stock mammals provided with MAX (i.e. the ones I was given to work with).

Custom models that don't have the same characteristics as the stock ones will need their own scripts as the script will be particular to the model itself!

If I get some free time I will see if I can adapt the script to work with your model.

AmenMoses commented 2 years ago

mammal_new.zip

That's how easy it is to change the script to work with the deer model but the speed of motion will need to be worked out to suit it properly.

Necrym59 commented 2 years ago

Oh i didnt expect that, thankyou Moses, I wasnt having a dummy spit, I was just pointing out the strangeness of having a behaviour there that people wouldnt be able to use out of the box so to speak. I was actually doing seperate scripts for each animal anyway but using a plug in script to suit what you have done with wildlife is even better. You are a scholar and a gentleman, sir.

AmenMoses commented 2 years ago

The advantage of using the 'spinetracker' system (I think that's what Lee calls it) is that the motion is captured with the animation so there is only one variable to play with, i.e. the animation speed. If you want a character to move faster then simply animate faster and the engine does all the magic under the covers to move the entity the right distance to match the animation.

Without that you have to adjust the speed to match the animation in the script and it is almost impossible to get it perfectly right, which is why in GG the characters either appear to be moonwalking or skating around.

One script handling all the stock mammals would not have been possible doing it the other way.

Necrym59 commented 2 years ago

Its a good idea i just wish there were more tools around to make it easier to edit models tro suit it, im no animator but hopefully MAX will create an animal DLC with all the features done. :) - now that i would buy! Saves me writing about 30 animal scripts :)

AmenMoses commented 2 years ago

You can still do it with one script (assuming all the animation names match) by having the script select the appropriate animation/movement speed combo using the name of the model.

Necrym59 commented 2 years ago

but the script wouldnt know unless in the script it has a list of animal type/specs or perhaps an external readable list file, would it? Although if we had parameters for the FPE file that could be passed through it would solve it all. Is the commands in there now available t.tryfield_s="speed" t.tryfield_s="animspeed" would they do the job?

AmenMoses commented 2 years ago

Yes, I would put a list in the script with the key being the name of the animal.

I would have the script Prompt if it is attached to an animal that is not in the list.

The list should have the max speed value and animation speed, then some math in the script to determine the appropriate values for 'walk', 'run' or 'flee'.

Necrym59 commented 2 years ago

HI Amen, I have the mamal_new script working as is fine with these ones so far, just in case you wanted to look standard_animals.zip so far any speed/turn settings can be done in the character settings in MAX. It would be nice if those were brought in from the FPE but they dont seem to be. Some FPE settings like 'animspeed' seems to be ignored (should get fixed) and an added one for 'speed' and 'turnspeed' should be implimented. I have made these ones conform to the same anim names as this one used in the fox model. animal_anims It would mean you dont have to create a list only account for possible animation names to fit within the fixed list of status/anims eg: make 'run' or 'flee'='move', if no 'eating' then use 'idle' etc. pretty much makes a one fits all script virtually! Awsome work by the way with that script.

Necrym59 commented 2 years ago

The only thing i can think of for the above is an 'alert' and an 'attack' animation as part of the standard mammal state/anims so as to account for attacking mammals. Other than that its a damn near perfect script to be honest.

LeeBamberTGC commented 1 year ago

Our mammal behaviour is working great with all our little creatures :)

Necrym59 commented 1 year ago

oops sorry forgot all about this old one i will close it