Page 1 of 1

animation variants

Posted: Sat Dec 29, 2012 4:48 pm
by wallasaurus
Hi all,

Just wondering, does the grimrock animation system support animation variants or extra slots over what is supplied in the asset pack?

If anyone has any ideas it would be great!

cw

Re: animation variants

Posted: Sun Dec 30, 2012 4:31 am
by germanny
Dont know exactly what you think of..
But i think you can import any animation sequence - if we have a working importer - that is possible.
The biggest prob are the bone weights, without it smooth animation is not possible.
The tests with new door models shows me that existing animations can mapped to other (new modeled) nodes that not match the vertex count, but anything in that node is animated then.

Re: animation variants

Posted: Sun Dec 30, 2012 12:27 pm
by wallasaurus
Hey there!

So I am fine with exporting bone weights and smooth animation from 3dsmax - that is all taken care of. :)

What I was curious about is the animation system under the hood.

In the monster definitions, there are different sets of anims specified on different monster types - ogre has some charging anims, skeleton archer has strafe anims where skeleton warrior does not - that kind of thing. I'd like to find out more about that stuff, how it is set up, whether we can script new sequences of anims and animation 'slots' if you like for new monsters.

Example - my mummy character - I would like to add 2 variations of attack animation - functionally identical but visually different - I don't know how to do that. If I wanted to add the scarab attack which somebody suggested, I would need a way to setup the slot for that, add an anim for it, and setup a script to spawn the scarab models and animate those - I don't know if this stuff is all possible with what we have access to.

If it is all available to script, i expect we can figure out how to do almost anything, but if the system is more hardcoded we will need to manage expectations and work within those constraints.

I was hoping there might be others looking into similar things, or even maybe if a friendly dev pops in we could get some insider infos. ;-)

Re: animation variants

Posted: Sun Dec 30, 2012 3:15 pm
by Skuggasveinn
If I'm not mistaken, then monsters action are a compination of 2 things.
The animation event system and the brain.

the brain is the AI that calls for action given whats going on.
the animation event system triggers attacks from specific key-frames

I don't thing we can create a brain, put we can assign existing ones to a monster

we have several brains to choose from

Melee
Ranged
Goromorg
Tenticle
Uggardian
Crab
IceLizard
Warden
Slime
HerderBig
HerderSmall
Ogre
SkeletonArcher
(warning, assigned a brain that calls for an action that is not defined for the monster will crash the game, like assigning the Ogre brain on a archer, and when the Ogre brain calls for "side attack" there is no such animation on the skeleton archer and booom you see desktop)

If we take a look at the Tenticles for example and the party was standing 2 squares from it
the Tenticle brain would know it can't attack us, its coing to idle or/and withdraw.

but if we are standing right in front of it, the Tenticle brain would call for an "attack" and the attack animation would play

if we look into the animation_events.lua we can see the following

Code: Select all

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 15,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 20,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
	event = "attack",
	frame = 25,
}
so on frame 15 of the attack animation it triggers an attack, having a change to damage the party, also on frame 20 and 25
That tells is we need to define on what frame something will "hit" the party, or in the case of ranged attacks on what frame a projectile will "leave" the monster.

Here is what I think is the bad news (I would love to be wrong), since we can't make a brain, we need to use existing ones, and there is not one monster in the game that can do both melee and ranged.
So I would thing that you need to create 2 mummies, one thats melee and another thats ranged and use the scarab attack on the ranged one and have the scarab attack as a spell, the monster only animates casting animation and triggers the scarab spell.

Melee attacks seem to be only one per monster, ranged attack seem to take multible values.

in the monsters.lua you can see something like this.
rangedAttack = { 45, "lightning_bolt_greater", 25, "ice_shards", 20, "fireball_greater", 10, "poison_bolt" },
so 45% it will use lightning_bolt_greater, 25% of the time ice_shards and so on.

but all this is new ground, and there is a good change that I'm 100% wrong here :D

Skuggasveinn.

Re: animation variants

Posted: Sun Dec 30, 2012 3:54 pm
by Neikun
This reminds me, next time Petri wants to script for us again, we should ask him for a "friendly" brain.
Then again, that might that the whole team to work on if it'll be tied to animations.

Re: animation variants

Posted: Sun Dec 30, 2012 4:42 pm
by germanny
I will try to set up animations that way in Blender:
One file per animation event for testing and i dont know how to export single animation sequences to separate files.
So if i have a monster i create a basic movement from first keyframe to last keyframe in ecspected still pose and save that.
From here i want to use the file to animate, say, move forward sequence - here i set keys inbetween first + last key, and save that.
Load basic file, create next.. and so on.
Think this is a safe way to make - we don“t know how export will do yet!

Re: animation variants

Posted: Sun Dec 30, 2012 11:12 pm
by Skuggasveinn
Neikun wrote:This reminds me, next time Petri wants to script for us again, we should ask him for a "friendly" brain.
This... yes
it would be sweet if we can do something along the lines of
friendlybrain = "true"
onattackbrain = "melee"

so a monster starts off friendly and if attacked it goes to the onattackbrain

also it would be nice to have
attackable = "false"
collisiondetection = "false"

that why we can make rats that just roam around the dungoen, snakes or other critters, that the party never collides with and can't be attacked.
not to mention of we can define idle animation for decoration objects :D

Skuggasveinn.

Re: animation variants

Posted: Mon Dec 31, 2012 2:09 am
by wallasaurus
Hey guys, great info - I had surmised some of these things from readin the given scripts, but it's great to have more clarity.

Hmm. So we are stuck with those brains - would be cool if we could create new ones with various combinations of the features present in the current set of brains, if not to be able to define whole new ones! Maybe for grimrock 2? :)

I will carry on with the mummy grunt basic animation set and I suppose we will go from there. If petri does gift us some code time for scripting stuff, it would be awesome if we can get him to take a peek in the code at how much work would be involved to give us more lego-like monster system stuff. :)

I should get back to the art though. Scripting makes me crazy. :P

Happy xmas and new year to you all!