Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Weird animation problem.

Author
Message
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Apr 2011 19:49
I'm working with the RPG7 weapon and hand animation from ErrantAI, and in a standalone program I wrote everything animates just fine.

In the actual game where I'm putting it to use, I'm using the exact same model file, and animation file (extracted using Enhanced Animation) but some of the animations are "off".

The biggest one is zooming in to the sight for the rocket launcher. When I start that animation in the standalone program it does what it's supposed to and comes up to the camera and brings the sight and cross-hairs into view.

In the game, it moves way over to the left, almost totally off screen, and when I fire, the zoomed-reload animation is way over there as well.

I've gone through all my code at least a hundred times and can't seem to find the issue.

Has anyone seen this before, or have any ideas what might cause this behavior?

TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 15th Apr 2011 20:11
I would suggest offsetting the weapon/character, preferably do the whole aiming using offsets, then you can use the same animation when aiming and holding the weapon on hip.

Problem might be because you have the camera in animation software in different place compared to DBPro camera.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Apr 2011 20:17
No, that's not it.

In the standalone DBP app with nothing loaded but the animated hands with the weapon, the animation works perfectly.

It's only in the game where the animations are doing strange things.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Apr 2011 22:06
The only thing I can suggest is to systematically comment out chunks of code till the problem disappears. That should help identify the culprit and whether it's a bug or a coding error.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Apr 2011 00:32
I suspect interference from a plugin, but I'm really not sure yet.

Working on narrowing it down.

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Apr 2011 02:01
Sounds like it could be anything. I've had similar things in the past that took ages to track down. The last time that happened to me was an array over-spilling into other data. For the life of me I could not work it out until I'd deleted everything and practically started again. And there it was. A stupid 'for' loop that caused a not often used variable to be changed.

Warning! May contain Nuts!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Apr 2011 02:21 Edited at: 16th Apr 2011 02:51
I hate those kind.

I attacked this one from the other direction and started putting things into the little sample program I made to test the animation.

It turns out that if I step through the animation using,

EnAn_oacSetFrame

Everything works fine.

The problem shows up when I use,

EnAn_oacPlayAnim

So there's another setting I'm not using right, or there's a bug in Enhanced Animation's PlayAnim command.

Making the change to the game now. Will post back if it worked.

[edit]
Very strange. I can duplicate the problem in the little app, but using the cure from it on the game doesn't work.

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Apr 2011 04:07
FINALLY figured it out.

I thought that Enhanced Animation (like the built in DBP animation commands) would handle a float for a frame number so you could smoothly transition from one frame to another, but it doesn't like it. I think the PlayAnim command is using floats internally to track the frame number, so that's why it has a problem.

Once I put the advancement of frames on a timer and used an integer, it all worked fine...

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Apr 2011 06:17
Wow, I bet your glad it's sussed?

The worst thing about bugs like that is you had lots of other ideas to work on too.

Since all this C++ started I've had to become a more 'cleaner' programmer. I used to assumed that a 'define' in assembly could mean anything from a byte to a float.

Now get some work done man!!! (thumbs up!)

Warning! May contain Nuts!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Apr 2011 06:21 Edited at: 16th Apr 2011 06:22
Puts me one step closer to having some serious work done on this FPS. Now all the animations run perfectly.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Apr 2011 15:38
Good news.
Ron Erickson
Moderator
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Apr 2011 21:20
KISTech,
If you ever get stuck on something where you suspect Enhanced Animations is to blame, send me an e-mail. I'll be glad to look at the problem for you. It may take me a day or two, but I will do my best to look at it.
I am kind of suprised myself that the command doesn't take a float. I'll have to look at that!

Ron

a.k.a WOLF!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Apr 2011 23:39
Well, it does take the float, but it screws up the position of the object being animated when you use floats.

I'll clarify that by saying I'm still using a float datatype, but incrementing by a whole number.

This also occurs with the EnAn_oacPlayAnim command, which I assume uses floats internally.

I'll email if I run into anything else. Thanks.

Login to post a reply

Server time is: 2026-07-18 06:41:15
Your offset time is: 2026-07-18 06:41:15