Staredit Network > Forums > Modding Assistance > Topic: Permanently Spinning Units
Permanently Spinning Units
Dec 1 2015, 9:32 pm
By: Sand Wraith  

Dec 1 2015, 9:32 pm Sand Wraith Post #1

she/her

Let's say I have a unit. This unit ought to have the appearance of an equilateral triangle. Its graphic, the triangle, continually rotates. This unit also moves around, so of course, its graphic should be centered on the unit's coordinates.

Graphically, the unit ought to:
1) Always spin with a constant period.
2) Have no hitches in any and all animation transitions.
3) Spin during all animations.

So basically this unit we have in mind always spins. When it attacks, it doesn't stop spinning. When it moves or comes to a stop, it still spins.

I thought this sort of unit would be easy to implement.

It turns out I was wrong.

Here is the "base" unit:
Code
.headerstart
IsId               68
Type               12
Init               AK_InvisBase_Init
Death               AK_InvisBase_Death
GndAttkInit         AK_InvisBase_GndAttkInit
AirAttkInit         AK_InvisBase_GndAttkInit
Unused1             [NONE]
GndAttkRpt         AK_InvisBase_GndAttkInit
AirAttkRpt         AK_InvisBase_GndAttkInit
CastSpell           [NONE]
GndAttkToIdle       AK_InvisBase_GndAttkToIdle
AirAttkToIdle       AK_InvisBase_GndAttkToIdle
Unused2             [NONE]
Walking             AK_InvisBase_Walking
WalkingToIdle       AK_InvisBase_WalkingToIdle
SpecialState1       [NONE]
.headerend
# ----------------------------------------------------------------------------- #

AK_InvisBase_Init:
    # Spawn actual thing
    #sprol             247 0 0
    imgol             261 0 0
    playfram           0x00     # frame set 0
    tmprmgraphicstart
    goto               AK_InvisBase_WalkingToIdle

AK_InvisBase_GndAttkToIdle:
AK_InvisBase_WalkingToIdle:
    wait             125
    goto               AK_InvisBase_WalkingToIdle

AK_InvisBase_GndAttkInit:
    wait             1
    attack
    gotorepeatattk
    goto             AK_InvisBase_GndAttkToIdle
   
   
AK_InvisBase_Death:
    wait               3
    end                

AK_InvisBase_Walking:
    goto               AK_InvisBase_WalkingToIdle


And here is the "turret" image animation:
Code
.headerstart
IsId               89
Type               12
Init               AK_Graphic_Init
Death               AK_Graphic_Death
GndAttkInit         AK_Graphic_WalkingToIdle
AirAttkInit         AK_Graphic_WalkingToIdle
Unused1             [NONE]
GndAttkRpt         AK_Graphic_WalkingToIdle
AirAttkRpt         AK_Graphic_WalkingToIdle
CastSpell           [NONE]
GndAttkToIdle       AK_Graphic_WalkingToIdle
AirAttkToIdle       AK_Graphic_WalkingToIdle
Unused2             [NONE]
Walking             AK_Graphic_WalkingToIdle
WalkingToIdle       AK_Graphic_WalkingToIdle
SpecialState1       [NONE]
.headerend
# ----------------------------------------------------------------------------- #

AK_Graphic_Init:
    imgul               224 0 42     # AK_Graphic_Shad (terran\AK_Graphic_.grp)
    playfram           0x00     # frame set 0
    goto               AK_Graphic_WalkingToIdle

AK_Graphic_GndAttkToIdle:
AK_Graphic_WalkingToIdle:
    playfram             0x0
    wait             2
    playfram             0x1
    wait             2
    playfram             0x2
    wait             2
    playfram             0x3
    wait             2
    playfram             0x4
    wait             2
    playfram             0x5
    wait             2
    playfram             0x6
    wait             2
    playfram             0x7
    wait             2
    playfram             0x8
    wait             2
    playfram             0x9
    wait             2
    playfram             0xa
    wait             2
    playfram             0xb
    wait             2
    playfram             0xc
    wait             2
    playfram             0xd
    wait             2
    playfram             0xe
    wait             2
    playfram             0xf
    wait             2
    goto               AK_Graphic_WalkingToIdle

AK_Graphic_GndAttkInit:
    wait             1
    goto             AK_Graphic_GndAttkToIdle
   
   
AK_Graphic_Death:
    playsnd             210     # Terran\DROPSHIP\TDrDth00.wav
    imgol             215 0 0 # Protoss Large Explosion
    imgol               333 0 0     # TerranBuildingExplosionmedium (thingy\tBangL.grp)
    wait               3
    end                

AK_Graphic_Walking:
    goto               AK_Graphic_WalkingToIdle    


Here's what I have tried:
1) Implementing via one unit with no spawned overlays.
2) One unit spawning an image overlay.
3) One unit spawning a sprite overlay.

The problem with (2) is that the unit will reset its very simple spinning animation every time it transitions from attacking to moving, from moving to stopping, from stop to moving, from stop to attack, from attack to stop, etc, producing a noticeable and annoying "hitch," stall, or jerk.

The problem with (3) is that the sprite overlay will not follow the unit (so one could see the selection circle moving about, but the graphic remains spinning in place where the unit was created).

So the question is simple: How does one implement such a spinning unit flawlessly (or at least mostly flawlessly)?




Dec 1 2015, 10:45 pm Neiv Post #2



Does disabling images.dat Use full iscript for the child overlay help?



None.

Dec 1 2015, 11:31 pm Sand Wraith Post #3

she/her

I haven't tried that. As soon as I can I will, that sounds highly promising.




Dec 5 2015, 10:45 pm Sand Wraith Post #4

she/her

It worked, thanks.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[04:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[04:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
[06:15 pm]
Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
[03:47 pm]
NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
[03:43 pm]
NudeRaider -- Contained nothing new for me. Didn't know all building's behavior, but very much all unit's. Also Terran balance whine - also nothing new :lol:
[2026-6-19. : 9:57 am]
Oh_Man -- makes me wonder if SEN knows anything about the topic
[2026-6-19. : 9:57 am]
Oh_Man -- artosis dropped pretty interesting vid: https://youtu.be/EqZHB8Blra4
[2026-6-18. : 5:01 pm]
Ultraviolet -- :wob:
[2026-6-17. : 6:15 am]
RexyRex -- :wob:
Please log in to shout.


Members Online: Moose