View Issue Details

IDProjectCategoryView StatusLast Update
0003146The Dark ModAIpublic30.07.2012 18:24
ReporterArcturus Assigned ToSpringheel  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Product VersionTDM 1.08 
Summary0003146: walk and walk1 - randomisation
DescriptionWe have two walk animations: walk and walk1. In my test map I have couple of NPCs of different kinds. When map is loaded all NPCs play the same walk animation, except for builder priest which plays the other one. When I reload map (sometimes it takes couple of reloads) animations are swapped but again all NPCs play the same animation except for priest. It's not the kind of random pick we wish. Each NPC should play random animation each time, if possible.
TagsNo tags attached.

Activities

Springheel

Springheel

29.05.2012 16:31

administrator   ~0004639

It should be random each time the character starts the walk animation, not just once on map start.
grayman

grayman

27.06.2012 16:34

viewer   ~0004672

Last edited: 27.06.2012 16:36

Where does TDM decide which anim to play?

Other than in the *.def files, I can find no reference to "walkN" anywhere in the TDM files, scripts, or the SDK.

The scripts only set up the "walk" anim.

I notice that some AI have "walk" and "walk1" defined. Others get "walk1" and "walk2", so I guess that gives them "walk, walk1, and walk2".

But I can't figure out how TDM decides to randomly play one of the available walk anims.

Springheel

Springheel

27.06.2012 21:30

administrator   ~0004673

Last edited: 27.06.2012 21:35

My understanding is that the number in an animation name is ignored by the code. A code reference to "walk" will accept "walk", "walk1", "walk03", etc. If there is more than one such animation, it will randomly pick from the list. My experiences have generally born this out. Where or how it decides which to pick I have no idea, but it should happen every time the animation is called.

Which AI have "walk" rather than "walk1"?

Springheel

Springheel

27.06.2012 21:55

administrator   ~0004676

Last edited: 27.06.2012 21:56

I just did a test in idle_animations where I substituted a clearly different walk animation for walk2 so it was clear which one they were using. I can't confirm the original issue. Everything worked as expected...AI randomly picked a different walk animation each time they reached the appropriate path_corner.

grayman

grayman

28.06.2012 02:28

viewer   ~0004677

For the normal 'walk' anims (not counting things like 'walk_blind', etc.) ...

Rats - walk, walk2

Builder forger, Elite guard, Proguard, Beggar, Revenant - walk1, walk2

Everyone else - walk

--------------

I found the randomization in the animation code. It looks for anim names ending in numbers to recognize there are multiple anims, so I'm wondering if the rat has a problem because it uses 'walk' and 'walk2' instead of 'walk1' and 'walk2'.

Don't know w/o debugging.
Springheel

Springheel

28.06.2012 20:44

administrator   ~0004679

"Everyone else - walk"

All humanoid characters with the new skeleton use walk1, walk2.

"I'm wondering if the rat has a problem because it uses 'walk' and 'walk2' instead of 'walk1' and 'walk2'."

No, there's no problem there. I recently tested play_lute_idle2 and play_lute_idle, and they get randomly selected properly.
grayman

grayman

28.06.2012 20:46

viewer   ~0004681

So can this issue be closed?
Springheel

Springheel

29.06.2012 00:26

administrator   ~0004682

I don't see why not.
Arcturus

Arcturus

24.07.2012 19:45

reporter   ~0004724

The bug is not fixed. I uploaded test/walkcycle.map. All AIs play the same animation on startup, except priest.
Springheel

Springheel

24.07.2012 20:38

administrator   ~0004725

I switched anim walk1 to the blind walk animation so it was easier to see who was playing what.

1st run: 3 AI playing walk, rest playing walk1.
2nd run: All AI playing walk1 except for priest who plays walk
3rd run: All AI playing walk1 except for priest who plays walk
4th run: 3 AI playing walk1, rest playing walk
Springheel

Springheel

24.07.2012 20:46

administrator   ~0004726

Another round of testing:

1. all 'walk' but priest who uses walk1
2. same
3. elite, priest, inventor & archer use walk, rest use walk1
4. elite, priest, inventor & builder use walk, rest use walk1
5. ALL use walk
6. all 'walk' but priest who uses walk1

So the randomizing might not be perfect, but it is there. In the 10 tests, all AI played both walk animations at least once. Don't know why the priest seems to be the odd man out so often.
Springheel

Springheel

24.07.2012 20:53

administrator   ~0004727

Last edited: 27.07.2012 20:41

After watching them for a while, I've also seen AI change their walk when they get to the end of their path and turn around. So the randomizing seems to be working there as well.

Is there any reason to keep this open?

Arcturus

Arcturus

30.07.2012 18:16

reporter   ~0004733

Last edited: 30.07.2012 18:23

Ok, I close it.

Issue History

Date Modified Username Field Change
28.05.2012 22:04 Arcturus New Issue
29.05.2012 16:31 Springheel Note Added: 0004639
27.06.2012 16:34 grayman Note Added: 0004672
27.06.2012 16:34 grayman Note Edited: 0004672
27.06.2012 16:35 grayman Note Edited: 0004672
27.06.2012 16:36 grayman Note Edited: 0004672
27.06.2012 21:30 Springheel Note Added: 0004673
27.06.2012 21:31 Springheel Note Edited: 0004673
27.06.2012 21:35 Springheel Note Edited: 0004673
27.06.2012 21:55 Springheel Note Added: 0004676
27.06.2012 21:56 Springheel Note Edited: 0004676
28.06.2012 02:28 grayman Note Added: 0004677
28.06.2012 20:44 Springheel Note Added: 0004679
28.06.2012 20:46 grayman Note Added: 0004681
29.06.2012 00:26 Springheel Note Added: 0004682
29.06.2012 00:26 Springheel Status new => closed
29.06.2012 00:26 Springheel Assigned To => Springheel
29.06.2012 00:26 Springheel Resolution open => fixed
24.07.2012 19:45 Arcturus Note Added: 0004724
24.07.2012 19:45 Arcturus Status closed => new
24.07.2012 20:38 Springheel Note Added: 0004725
24.07.2012 20:46 Springheel Note Added: 0004726
24.07.2012 20:53 Springheel Note Added: 0004727
27.07.2012 20:41 Springheel Note Edited: 0004727
30.07.2012 18:16 Arcturus Note Added: 0004733
30.07.2012 18:21 Arcturus Note Edited: 0004733
30.07.2012 18:23 Arcturus Note Edited: 0004733
30.07.2012 18:24 Arcturus Status new => closed