Unit Movement Speed

Timesless Tales is a standalone expansion for Wyrmsun.
Post Reply
shedeen
Posts: 10
Joined: Fri Mar 07, 2014 11:54 am
Location: United States

Unit Movement Speed

Post by shedeen »

Hi Stratagus forums!

Newbie here. I'm a computer scientist at the University of Wyoming in the USA and an amateur game developer. I have been spending the past few days researching Stratagus and am familiarizing myself with it by modding the data of Aleona's Tales. I must say it's all excellent work! I've started by experimenting with modifying the unit stats in the units.lua scripts, but I've run into a problem. The speed stat doesn't seem to affect anything; its almost as if the unit movement speed values are hardcoded into the engine. It doesn't seem to matter whether a footman has 0 speed or 3000 speed. I read somewhere about actual unit movement speed being based on unit "families", but I haven't found anything on that yet, at least in the scripts. If possible, could someone tell me exactly how to change a unit's move speed (and attack speed as well)? I've searched through most of the lua scripts and haven't found anything promising so far.

Thanks in advance.

- shedeen
User avatar
cybermind
Posts: 110
Joined: Sat Dec 31, 2011 11:43 pm

Re: Unit Movement Speed

Post by cybermind »

Speed is controlled by animation code, which is located in anim.lua files. "Speed" parameter is just used to display unit's "speed", like in Warcraft 2, so it could be safely removed without bad consequences,
shedeen
Posts: 10
Joined: Fri Mar 07, 2014 11:54 am
Location: United States

Re: Unit Movement Speed

Post by shedeen »

Thanks for the reply. I found the anim.lua last night and quickly realized that was probably what affected move speed. I'm guessing that's what affects attack speed as well.

One thing I noticed is that the wait times are staggered between 1, 2, or whatever the value is - seemingly at random. Is there any problem with making it consistent (like change each wait time to the same value)? Also, if "Speed" is just a displayed value, how is it derived? Like a Knight has 13 speed, so does that mean roughly 13 pixels per frame or something?

Thanks again.
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Unit Movement Speed

Post by jarod42 »

As mentioned by cybermind, the "Speed" variable of unit is just decorative.
Current values reflect an order between units.

The real speed of unit is based on animation.
An animation script is basically simple actions (pixel move, use specific frame to display, create missile) and 'wait' times.

In a 'game turn', 'actions' are executed until a 'wait' is reached, and then unit don't act during given time (in game turn).

So, if you change these value, the game will running (So you can experiment by yourself :) ).
The animation will look "different". if you increase a 'wait', unit will slowdown (and if you decrease/remove 'wait', unit will be faster).

Note also that some spell may change these value temporary (divide or multiply by 2, with a minimal value of 1). so `wait 1, wait 1` is different than `wait 2` : When we divide by 2, `wait 1, wait 1` -> `wait 1, wait 1` whereas `wait 2` -> `wait 1`.
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Unit Movement Speed

Post by Andrettin »

Speaking of animation speeds... is there any particular reason for the axethrower's attack wait total to be larger than the archer's attack wait total (73 vs. 52), or was that an oversight?
shedeen
Posts: 10
Joined: Fri Mar 07, 2014 11:54 am
Location: United States

Re: Unit Movement Speed

Post by shedeen »

I counted 65 for the Archer's attack speed.

In any case, I think they are probably supposed to be same. Both units acted identically in the original Warcraft 2 after all. At least, I would change it to be the same if you want to keep it balanced!
Post Reply