Animation control

User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Animation control

Postby b_o » Mon Aug 19, 2013 5:20 pm

I think all of the unit animations in all of the Stratagus games are too fast. I want to slow down the speed that frames change to other frames. I don't want to change the speed of the movement, I only want to change the appearance of the animation. Does anyone know how to do this? I imagine that these parts of the anim.LUA files need to be altered, but I'm not sure if anything else would need to be altered, and when I only change the "wait" amount, the game crashes:

Move = {"unbreakable begin", "frame 0", "move 3", "wait 1", "frame 0", "move 3", "wait 1",
"frame 5", "move 2", "wait 1", "frame 5", "move 3", "wait 1",
"frame 10", "move 2", "wait 1", "frame 10", "move 3", "wait 1",
"frame 10", "move 3", "wait 1", "frame 15", "move 2", "wait 1",
"frame 15", "move 3", "wait 1", "frame 20", "move 3", "wait 1",
"frame 20", "move 3", "wait 1", "frame 0", "move 2", "unbreakable end", "wait 1",},

Does anyone know how to accomplish this?
User avatar
cybermind
Posts: 110
Joined: Sat Dec 31, 2011 11:43 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby cybermind » Mon Aug 19, 2013 10:07 pm

Hmm...if you will just change "wait" amount, the game should work normally. If there are any messages in stderr.txt/stdout.txt files?
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby b_o » Tue Aug 20, 2013 1:25 am

cybermind wrote:If there are any messages in stderr.txt/stdout.txt files?
I'm not seeing those files anywhere. I was having issues with editing the LUA, as the folder was set to "read only". I then changed that and edited the LUA. I will try a few more things. But am I correct to think that the "wait" is what affects the speed of animation without affecting the speed of movement? and is there a formula for what the "wait" must be set to?
User avatar
cybermind
Posts: 110
Joined: Sat Dec 31, 2011 11:43 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby cybermind » Tue Aug 20, 2013 2:13 am

No, "wait" controls the speed of animation, and if there are big values in "wait", unit will slow down. Let me reveal you one of the secrets of Stratagus - the sum of "move" commands in Move animation block should be EXACTLY 32 - the tile size in Stratagus. Otherwise unit will go into infinite move loop.
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby b_o » Tue Aug 20, 2013 3:04 am

That's what I thought. The problem was that I needed to re-install wargus to a folder other than the program files folder. It's working. now I need to find the appropriate wait times. thanks.
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby b_o » Tue Aug 20, 2013 4:05 am

Hmm.. by changing only the "wait" it does slow the animation, but it also slows the movement.

I doubled the wait times for all of the unit animations in anim.lua, but the hero's seem unaffected and move faster than the unit type which shares their animation code.
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby jarod42 » Fri Aug 23, 2013 4:07 am

few things about animation:
- Animation uses gameTime
- Animation executes each part of it script until it reaches wait.
- Some sections are marked unbreakable, that means that if unit has a new animation to display, it should wait for a 'breakable wait'. for example 'move animation' shouldn't break until the unit reach a new tile.
- The time to move a tile is the sum of the "wait" (and the sum of the move should be the size of a tile, so 32 in wargus).

You may 'split' some "move 4", "wait 4"
by replacing by:
"move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1"
with is equivalent in 'normal speed' (see PS about magic).
(and adding different "frame X")

PS:
Spell may modify wait time (slow, fast). As I remember, fast divide wait time by 2 (with a minimum of 1, and a round for odd number)
so "wait 1", "wait 1" and "wait 2" behave differently when magic is used.
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby b_o » Wed Aug 28, 2013 9:22 am

thanks jarod, that helps.

But where can you alter the animation code for the hero's?
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Animation control

Postby Andrettin » Thu Aug 29, 2013 3:10 pm

b_o wrote:thanks jarod, that helps.

But where can you alter the animation code for the hero's?
They are in the same file as normal units. For instance, the Zul'jin animation is under "animations-sharp-axe", in the orc animations file.
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Animation control

Postby b_o » Thu Aug 29, 2013 5:31 pm

That's what I thought, but....
When I edit the wait's here:

Code: Select all

local AxeThrowerMove = {"unbreakable begin","frame 0", "move 3", "wait 2", "frame 5", "move 3", "wait 1",
    "frame 5", "move 3", "wait 2", "frame 10", "move 2", "wait 1",
    "frame 10", "move 3", "wait 1", "frame 0", "move 2", "wait 1",
    "frame 0", "move 3", "wait 2", "frame 15", "move 3", "wait 1",
    "frame 15", "move 3", "wait 2", "frame 20", "move 2", "wait 1",
    "frame 20", "move 3", "wait 1", "frame 0", "move 2", "unbreakable end", "wait 1",}
The unit speed is affected here:

Code: Select all

DefineAnimations("animations-berserker", {
  Still = AxeThrowerStill,
  Move = AxeThrowerMove,
but not here:

Code: Select all

DefineAnimations("animations-sharp-axe", {
  Still = AxeThrowerStill,
  Move = AxeThrowerMove,
Though I've only really tested this with ogres/ogre hero's and grunts/grunt heros, those use similar code, where the hero's Move= points to the same code as the non-hero. In theory the movement/animation behavior should be the same for hero's and non-hero's, but it's not.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest