View topic - How do you animate your units?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

How do you animate your units?
I adapt existing COB/Lua scripts 55%  55%  [ 18 ]
I draw the key frames on paper then hard code COB/Lua 9%  9%  [ 3 ]
I code COB/Lua without drawing it 36%  36%  [ 12 ]
I use Upspring's animation editor 0%  0%  [ 0 ]
I use an other animation software suite (Please specify) 0%  0%  [ 0 ]
Total votes : 33
Author Message
PostPosted: 28 Sep 2010, 07:36 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
So Ive been thinking of getting into animating some units, but find the whole COB thing a nightmare. I would like to know if anyone has found a more streamlined/visual approach to animation.

I also am baffled by all the movements being at constant speed. I would very much like if I could use constant acceleration instead of constant speed. I believe it could offer much more realistic animations.

Also, Im in search of some kind of method to rig the models; in my words, it would mean that I loaded up the model in 3d, and maybe set each joints degree of freedom and movement limits, and if I push and pull a peice, it would move the peices. Kind of like if i dragged the left foot forward, it would also adjust calf and thigh positions to accomodate for that movement.

Please offer any advice/experience you have in this matter.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 09:10 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
I animate by building the key frames in UpSpring, writing down all the numbers, then building the animation steps, then adjusting the timing via a constant. It's the easiest way, really- it rarely takes me more than an hour to do animations for simple stuff like a typical robot with walkcycle and firing animations.

You don't need to use constant speeds. What you need to do is to have constant time.

There's no rule saying that during a period of 1000, one rotation event can't take 700, another 300, for example. Using constant time means that you have a value that everything else is relative to, and lets you adjust timing for the whole sequence by changing just one number. If you want it to be faster, divide the constant in half, and now it's 350 / 150, for example.

Getting fancier than that is pretty expensive. The cheapest way to do true acceleration would probably be to build a series of move-now / sleeps and use smoothAnim interpolation, but I avoid it like the plague, because it's relatively expensive. Even fancier than that would be a ratcheted move-now that did true acceleration per gameframe with interpolation... you don't want to know how much that will cost, though. It's something you could use for a super-unit or a demo.

As for rigging, UpSpring is about as easy as you can get.

The rest of what you're talking about is building an IK system, and it'd just be a waste of time. If you build the keyframes, they're by-definition within your constraints; so your only trouble is if tweens go outside said contraints (happens frequently with double-twist rotations) and the only real cure for that is a tween key that fixes the issue (this happens all the time even in systems with IK btw).


Last edited by Argh on 28 Sep 2010, 09:19, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 09:19 

Joined: 27 Jun 2009, 00:32
Location: Germany
I also fire up the model in Upspring, do the translations and rotations there and code those values into the script. In contrast to Argh I wouldn't call a walkcycle "simple stuff" and I especially object that this is the easiest way...

It's very hard to get a smooth and believable walk cycle. I spend most of the time looking at things ingame and then changing things as I see fit. That's why I think that there's a huge need for a WYSIWYG editor for animations where you immediately can play the "keyframes" you added in and are able to see if everything runs smooth and believable. The Blender export plugin might be such a solution but I have to admit I've never really tried it...


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 09:24 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
If you build animations with Lua, you can reload now, apparently, for testing in realtime.

But yes, compared to doing stuff with IK in a real editing suite, it's not fun.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 09:40 

Joined: 27 Jun 2009, 00:32
Location: Germany
Argh wrote:
If you build animations with Lua, you can reload now, apparently, for testing in realtime.

Which is one of the biggest advantages over COB for me. It really saves a lot of time as you don't have to reload the mod...


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 10:14 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
What I meant by constant speed is that joints have infinite acceleration. I would be fine with constant acceleration. But I guess Ill look into the engine and see what I can do.

I think Ill try the blender export plugin. But blender is notoriously hard to use.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 10:44 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Master-Athmos wrote:
Argh wrote:
If you build animations with Lua, you can reload now, apparently, for testing in realtime.
Which is one of the biggest advantages over COB for me. It really saves a lot of time as you don't have to reload the mod...
docs/cmds.txt wrote:
/reloadcob <unit_name>


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:20 
Damned Developer
User avatar

Joined: 01 Jun 2006, 12:15
Location: Banned user for reason “Do not post pictures of people fucking cars”
reloading the cobs was kinda broken, some variables got messed up and stuff like that


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:26 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Well, it works for me, but then I kept from TA the habit to initialize all my "static-var" in Create()


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:43 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
I apologize for the noobish question, but looking at the source didnt clear this up: Whats the difference between move and smoothmove?


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:44 
Damned Developer
User avatar

Joined: 15 Sep 2004, 17:56
Location: Lahti, Finland
Beherith wrote:
I apologize for the noobish question, but looking at the source didnt clear this up: Whats the difference between move and smoothmove?


This is purely a guess, but I'm guessing smoothmove has acceleration and deceleration at the ends.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:52 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
smoothmove let the engine interpolate a series of move/turn now separated by sleeps into a smooth movement, that is, move/turn with speed.

I dislike smoothmove because, as every dumb algorithm trying to guess and correct input that's bad in the first place, it fails on anything a bit complex.

If you realised there can be a "speed" after "move/turn", then you do not need smoothmove.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:54 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Thanks zwzsg! That cleared it up, but now im wondering how acceleration can be passed to a move command...


Code:
void CUnitScript::TurnSmooth(int piece, int axis, float destination, int delta, int deltaTime)
{
   if (!PieceExists(piece)) {
      ShowScriptError("Invalid piecenumber");
      return;
   }

   AnimInfo *ai = FindAnim(ATurn, piece, axis);
   if (ai) {
      if (!ai->interpolated) {
         TurnNow(piece, axis, destination);
         return;
      }
   }

   // not sure the ClampRad() call is necessary here
   float cur = ClampRad(pieces[piece]->rot[axis]);
   float dist = streflop::fabsf(destination - cur);
   int timeFactor = (1000 * 1000) / (deltaTime * deltaTime);
   float speed = (dist * timeFactor) / delta;

   Turn(piece, axis, speed, destination, true);
}

Upon further inspection, it seems that both move and turn have acceleration parameters, but they are both passed as 0:

Code:
void CUnitScript::Turn(int piece, int axis, float speed, float destination, bool interpolated)
{
   AddAnim(ATurn, piece, axis, speed, destination, 0, interpolated);
}


void CUnitScript::Move(int piece, int axis, float speed, float destination, bool interpolated)
{
   AddAnim(AMove, piece, axis, speed, destination, 0, interpolated);
}


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 11:59 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Beherith wrote:
im wondering how acceleration can be passed to a move command...
You can't!

You can only have acceleration in spin (and even, it only works sometimes).


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 12:38 
Server Owner & Developer
User avatar

Joined: 19 May 2006, 18:13
Location: Brno, Czech rep., EU, Terra, Sol, Orion arm, Milky way, Virgo supercluster
Wasnt there a branch with skeleton based animations? I think it was to be coded with lua with some high performance stuff done by engine (matrix operations).


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 12:53 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
So in essence, I would like the current constant speed infinite acceleration move to be replaceable with a varying speed constant acceleration move.Image
Attachment:
finite acceleration move.PNG [8.01 KiB]
Downloaded 2 times


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 17:09 
User avatar

Joined: 03 Jan 2010, 18:32
Licho wrote:
Wasnt there a branch with skeleton based animations? I think it was to be coded with lua with some high performance stuff done by engine (matrix operations).


http://www.youtube.com/watch?v=JwL67-loGWU

posted in 2008


Top
 Offline Profile  
 
PostPosted: 28 Sep 2010, 17:45 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
Quote:
I would like the current constant speed infinite acceleration move to be replaceable with a varying speed constant acceleration move.
That may be possible with Lua as a new command. It's certainly not possible with BOS- if you want acceleration, you need to code it yourself.

I don't really think you want this, though- the cost of it will be rather high per Piece, as that's going to be the equivalent of a move --> speed command for every rotational Piece every gameframe. Faking it adequately with good keys is a lot easier and cheaper :-)


Top
 Offline Profile  
 
PostPosted: 29 Sep 2010, 19:41 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Nobody should be coding new units in BOS unless theyre copy pasting 95% of the code to save time


Top
 Offline Profile  
 
PostPosted: 29 Sep 2010, 20:46 
Conflict Terra Developer
User avatar

Joined: 17 Jan 2009, 22:37
Location: The drama continues
i really wish spring had an IK animation system :(


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.