Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Unit Movement and Attack Speed
Unit Movement and Attack Speed
This topic is locked. You can no longer write replies here.
Feb 9 2010, 4:48 am
By: fat_flying_pigs  

Feb 9 2010, 4:48 am fat_flying_pigs Post #1



I've been using datedit to look up unit info. I'm going to use the zergling as an example.


The zergling uses "claws (normal)" as a weapon. This weapon has a cooldown of "8", the behavior of "Appear on Attacker", and the maximum range of "0"

Using the "fastest" game speed, 1 game second equals 24 (ill just call the unit "time") time. This means... 8 cooldown time divided by 1 game second (24 time) = 3. So this should be 3 attacks per game second. Just using other data (and one of the wiki pages), the zergling hits less times than 180 per minute. I have tested this theory with other game speeds (fast, normal, slow, ...).
My question is: Does the cooldown begin when the attack finishes, or when the attack starts? If it starts when the previous cooldown finishes, then 180 hits per game second is correct. If there is a cooldown, then the attack sprite, then the cooldown starts, then there should be less than 180 hits per second.
I would test this, but it's possible that other factors (in SC, + lag) affect this; the only way to know for sure is to know exactly how this process works.


As for movement speed, how do I find how fast a unit moves? I have seen the wiki article, but I want to know exactly how the process works. What number(s) dictate how fast a unit moves, and where can I find this number(s).



None.

Feb 9 2010, 5:06 am stickynote Post #2



The unit is not time; it's frames. The attack happens, then the the cooldown immediately starts. Also, attacks do not have a set cooldown; 8 is an average. The attack cooldown is 8 give or take a frame.



None.

Feb 9 2010, 5:13 am fat_flying_pigs Post #3



Quote from stickynote
The unit is not time; it's frames. The attack happens, then the the cooldown immediately starts. Also, attacks do not have a set cooldown; 8 is an average. The attack cooldown is 8 give or take a frame.
ok... so, does the actual attack (the zergling moving foward and hitting it's target) take up frames? and is the cooldown the zergling's body moving back to normal, or it just a set amount of time after the attack?
really what i'm asking is: is 180 hits/game second (about) accurate?

also, something else I couldn't find is how the attack speed upgrade (adrenalin glands) affects the zergling. Does it reduce the cooldown (from 8 to X)? if so, what is X (how can I find out)

and how do I find movement speed?



None.

Feb 9 2010, 5:33 am stickynote Post #4



The actual attack takes up frames, but is not factored into the cooldown. The cooldown is a set amount of time, and the zergling's body moving back to normal is just an animation and does not really have anything to do with the cooldown.
Google is your friend: http://classic.battle.net/scc/zerg/units/zergling.shtml
The cooldown is 8 without upgrade and 6 with upgrade.

The movement speed isn't "officially" measured.
Here is a list someone made up; it puts the movement speed in terms of an overlord (1.00x):
Collapse Box

Again, I did not write this list.



None.

Feb 9 2010, 5:48 am fat_flying_pigs Post #5



Is there any way to find the number of frames it takes a unit to attack?
This way (24 frames/game second)/(attacking frames + cooldown frames) = attacks per game second, right?

As for movement: I have the list already, but tanks anyways. Just wanted to know if I could get exact figures.



None.

Feb 9 2010, 5:55 am ImagoDeo Post #6



I believe the cooldown is slightly randomized, as Stickynote said. It's +/- 1 or 2 frames per cooldown. Therefore, you could have more OR less than 180 attacks in one game minute. This holds true for all units.

If you consistently get measures significantly less than 180 attacks per game minute, I would take it to mean that the cooldown starts when the damage is done and that the Zergling's attack actually adds 1 or 2 frames to the cooldown. You'd have to get someone more knowledgeable to tell you for sure, though. Rockz, perhaps.



None.

Feb 9 2010, 6:00 am Gigins Post #7



Both movement and attack speed lists.
[attach=5830]
[attach=5831]

Attachments:
unit attack speed.txt
Hits: 6 Size: 1.15kb
unit movement speed.txt
Hits: 8 Size: 1.7kb



None.

Feb 9 2010, 6:21 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

Curses, people. Use my research!
http://www.staredit.net/wiki/Unit_Speeds
Divide the datedit top speed by 256 to get the move rate in pixels per frame, if it uses flingy.dat to move. If it uses iscript.bin, the speed is listed there. Certain units (ling, hyd, ult, goon, gol) all use a sequence which moves 4, then 2, then 8, then 8, or something along those lines per frame. That means they have an average speed, and thus have some fraction listed. Broods are annoying, since they have a random wait. Any speed upgrade increases an iscript.bin move by 2, and the flingy.dat speed by a set amount and double the accel/turn radius.

Ensnare cancels the speed upgrade, or cuts the speed in half. Thus an ensnared Yggsdrasill would move at the speed of a normal overlord, a fenix would move speed 4, and a dt would move at 2.5. Not sure of the effects of snare on turn radius/accel, but it probably halves them.

http://www.staredit.net/topic/6791/
Attack speeds are mostly random, but they, for the most part, follow the cooldown. A few exceptions are the upgradeable attack speed folks like terran marine and zergling, those with strange attack patterns like corsair, infested kerrigan, and ultralisk, then those with no real listed cooldown at all, like reavers' scarabs and carriers' interceptors. The listed "FPA" is "frames per attack".

Also, a little more info on what I know:
Iscript.bin is located in the mpq. To extract it, use pyice and you can open up each unit's individual sequence iscripts. One of them will be the move sequence, which then tells you something like move 4, wait 1, move 4, wait 1, etc. The wait 1 is just a frame, and the move 4 is 4 pixels, which is why most ground units move at 4 pixels/frame. There's also attack sequence information, which can tell you exactly which units can "force attack" through hypers, and why. Dragoons have a "DragoonGndAttkInit" which lasts 5 frames, then starts "DragoonGndAttkRpt" which plays 2 frames, and THEN finally attacks. So that's a 7 frame delay from when you order the unit to attack. Obviously plenty of time for hypers to interrupt the dragoon from attacking.

Conversely, a vulture's attack sequence looks like this:
Code
VultureGndAttkInit:
    wait                   1
    attackwith             1
    gotorepeatattk
    goto                   VultureGndAttkToIdle

wait a frame, then attack. Hypers can't stop that.

Post has been edited 1 time(s), last time on Feb 9 2010, 6:43 am by rockz.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 9 2010, 8:08 am fat_flying_pigs Post #9



ok... so just to clarify:
attack speed = X frames/shot; fastest = 24 frames/second; [24 frames/second] / [X frames/shot] = 24/X shots/second.

so where a crackling has (approximately) X=5.74, 24/5.74 = 4.181
so that's 250.871 shots (or hits) from the crackling per minute?



None.

Feb 9 2010, 7:34 pm rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

Yes.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 10 2010, 5:54 am fat_flying_pigs Post #11



ok, everything fits correctly except for 2:
datedit:
15 cooldown
you:
24.53     Infested Kerrigan (Infested Terran)
datedit:
22 cooldown
you:
27.34      Left Wall flame Trap

any reason, or could you be wrong?



None.

Feb 10 2010, 7:36 am rockz Post #12

ᴄʜᴇᴇsᴇ ɪᴛ!

first off, you can test these. Second, yes, the flame trap is 22.whatever. IDK why or how I got the number I got. 1139*2/100 is what I should have used to convert it, which I for some reason didn't.

Infested Kerri is notorious for having a wierd attack speed. The cooldown really is 15, but she's got about a 9 frame delay. You can try to make heads or tails of it by opening it up in iscript.bin, (she's got an attackinit which waits 6, then an attack which waits 3 or so before actually attacking.) but it's all pretty confusing. Since I don't have assembly knowledge, I can't figure out what's going on.

I'd also like to know why zealots, zerglings, and most other melee units have quite a bit of range (15 pixels, usually), whereas broodlings and scvs have practically no range at all (2-3 and 10 pixels, respectively). Last time I asked the question, though, nobody knew the answer, and it didn't seem like they cared.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Feb 10 2010, 10:40 am Lanthanide Post #13



Quote from rockz
Last time I asked the question, though, nobody knew the answer, and it didn't seem like they cared.
Of course rockz, you're the one who always swoops into every thread and displays devestatingly detailed knowledge of pretty much everything, what'd you expect? :)



None.

Feb 10 2010, 6:24 pm fat_flying_pigs Post #14



Ok, my question has been answered, this can be locked.
thanks rockz



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Zycorax