Staredit Network

Staredit Network -> Modding Assistance -> Images.dat overlays
Report, edit, etc...Posted by BroodKiller on 2007-01-06 at 10:42:51
Ok people, let's eat these little illegitimate childs for diner, shall we? devil.gif
There are 5 overlays, whose meaning I hope to be found or at least researched thanks to this topic. Also, this is a topic that will concentrate particularly on the LO? files, and their interworking in Stacraft.

Overlay 1
Entries using it (+LO-type):
Drone LOG
Guardian LOG
Hydralisk LOG
Mutalisk LOG
Arhon-Being LOL
Battlecruiser LOX
Bunker LOA
Wall flame trap1 LOA
Wall flame trap2 LOA
Devourer LOG
Lurker LOG
Dark Archon-Being LOL

Hypothesis: After testing this one, it seems that it controls some part of the unit's attack animation or something, because removing it hangs the game when the unit is instructed to attack, no matter which LO-type it uses. However, I have no clue what is the interworking of this property and the X/Y offsets from weapons.dat. Maybe one sets the base point for another?

A strange thing happens with the Battlecruiser because removing its LOX doesn't seem to affect the unit at all. I tested both normal attack and the Yamato Gun.Maybe it has to do with the fact that BC has a LOL file linked as "Overlay 3"?

Overlay 2
It is pretty much clear what it does, if you browse through images.dat and see which entries use it - it's the "Flames overlay" (as may suggest the last letter of the only LO-type used in it - LOF), which controls where does the flame/blood graphics appear on a building when it is damaged.

An interesting thing here is that it is not enough just to give this overlay to a unit to make it "bleed/burn". Try to give an already used overlay to, say, Ultralisk, and watch the game freeze when its HP reaches around 80% (precise values when the overlays appear are unknown...anyone?). I found out that this can be avoided if you give the Ultralisk the Iscript animation of a building (the units.dat Building property has nothing to do here, I tested it), say the Nydus Canal, which clearly points to Iscript as the decisive factor. However, nothing in the Nydus Canal iscript seems to have a similar meaning (to the extent I analysed it).

Hypothesis:My current hypothesis is: the activation of the "Flame/Burn overlay" is dependent on the presence of a specific Iscript.bin animation set. The question is - which one? To the extent I had tested it I was getting only instant crashes after starting the map, so I'm asking for assistance in finding this out smile.gif

Also, there is no property that dictates which particular variant of flames/blood should be shown. Is it random or controlled?

Overlay 3:
Entries + LO-types:

Drone LOO
Extractor LOS
Probe LOO
Assimilator LOS
Battlecruiser LOL
Goliath Base LOL
Wraith LOL
SCV LOO
Siege Tank (Tank) Base LOL
Siege Tank (Siege) Base LOL
Siege Tank (Siege) Turret LOA
Science Vessel (Base) LOL
Refinery LOS
Vespene Geyser LOS
Unknown547 LOB

Hypothesis: The partial meaning of this overlay can be read from the units using it:
For the Resource-Miners, this is the overlay that controls where they "hold" the resources after harvesting them from a mineral field or a geyser.
For the gas-related units, it probably controls the smoke graphics (LOS), as the game hanged after I removed it for the Refinery and launched the map. Iscript-connected via the "creategasoverlays" (0x38) opcode.
For the base-turret units, maybe it controls the location where to put the turret ("imgol" connection?)
For the Battlecruiser, it is the location where to create the Yamato Gun graphics, as the game hanged when I tried to do so after removing the overlay.
For the remaining units (Wraith, Unknown), I have no idea.Maybe wraiths were to have afterburners or something?No visible effect on removal.

Overlay 4
Entries + LO-types:
Scourge birth LOB
Zergling birth LOB
Infested CC LOU
Dropship LOU
Science vessel (base) LOU
Barracks LOU
Command Center LOU
Factory LOU
Science Facility LOU
Starport LOU
Engineering Bay LOU
Valkyrie LOU

Hypothesis: The meaning of this can also be guessed I think:
For the buildings, it's the landing dust location.
For the zerg units, the location where to put the 2 spawned units (LOB, for Birth)
For the terran units, I think it's the same as for buildings, because if you dig deep enough (for example here:Evolution of SC) you will know that both the Dropship and Science Vessel were originally destined to take-off and land, and not not only fly. As for the valkyrie...I have no idea, maybe same thing?

Overlay 5
Entries: (the LO-type is LOD)
Infested CC
Dropship
Science Vessel (base)
Barracks
Command Center
Factory
Science Facility
Starport
Engineering Bay
Valkyrie

Hypothesis: Complementary to Overlay 4, this one controls the lift-off dust for the buildings using it, and is a remainder of the unimplemented features for the other units.

I think that's it, any ideas for new labels for these properties?

For overlays 4 and 5, the LO-type may be misleading, because you have LOU for landing dust, yet the U may suggest the Upwards direction, and the LOD for lift-off dust, when you might have taken the D for Downwards direction. I've fallen for this one, so...always test your hypothesis! smile.gif

-------------------------------------------
Oh, last note: the overlays are SPECIFIC. This means that even though their properties may seem a bit randomly spread, the game engine looks for a particular overlay in a particular place, it does not browse through the overlay list for a target LO-type. Putting an overlay normally found under "Overlay 1" in "Overlay 4" won't work.
Report, edit, etc...Posted by Lord_Jeremy on 2007-01-06 at 16:47:24
Wiki-ed
Report, edit, etc...Posted by BroodKiller on 2007-01-06 at 17:21:36
Corrected a bit wink.gif
Report, edit, etc...Posted by Kookster on 2007-01-06 at 17:36:13
also if you put the tank lo file there for the battle cruiser the yamato charge up shows up in the center. Might be the other way around if you put the battle cruiser lo file for a tank, the turret might be where the yamato shows up, that might be funny looking.
Report, edit, etc...Posted by SI on 2007-01-07 at 19:07:45
LOS, LOU, and LOD are implemented in scmdraft actually
LOS controls where the smoke clouds spawn
the other two are for liftoff and landing, I believe the files also control which type of dust cloud to spawn but I havn't touched that code in a while.

"Also, there is no property that dictates which particular variant of flames/blood should be shown. Is it random or controlled?" -> probably also stored directly in the file itself, same as with landing
Report, edit, etc...Posted by BroodKiller on 2007-01-07 at 19:12:09
Thanks SI, it's good to have an external confirmation on the research. Any chances you can look into that code soon? Just asking.
Report, edit, etc...Posted by SI on 2007-01-07 at 20:40:41
here
CODE

 if (State)
 {
  IScript->StartScript(Unit->Sprite,18);//Lift off
  if (Unit->Sprite->Image->Overlay6)
   if (Unit->Sprite->Image->Overlay6->DataType == 1)
    for (int i=0;i<Unit->Sprite->Image->Overlay6->Lol->GetOverlayCount();i++)
    {
     // Hardcoded frame 0, should always be 0 anyhow....
     char Xpos = Unit->Sprite->Image->Overlay6->Lol->GetXPos(i, 0);
     char Ypos = Unit->Sprite->Image->Overlay6->Lol->GetYPos(i, 0);
     if (Xpos != 127 && Ypos != 127)
     {
      CSC_Sprite*   NewSprite;
      //GameData->Sprites[328+Cnt].ImagesEntry
      NewSprite = IScript->AddSprite(&GameData->Images[499 + (i & 0x03)],
             Unit->Sprite->Level + 1,
             Unit->Sprite->XPosition + Xpos,
             Unit->Sprite->YPosition + Ypos
             );
      IScript->StartScript(NewSprite,0);
      if (i >= 16)
       NewSprite->Primary->Flip = true;
     }
    }
 }
 else
 {
  IScript->StartScript(Unit->Sprite,17);// Land
  if (Unit->Sprite->Image->Overlay5)
   if (Unit->Sprite->Image->Overlay5->DataType == 1)
    for (int i=0;i<Unit->Sprite->Image->Overlay5->Lol->GetOverlayCount();i++)
    {
     // Hardcoded frame 0, should always be 0 anyhow....
     char Xpos = Unit->Sprite->Image->Overlay5->Lol->GetXPos(i, 0);
     char Ypos = Unit->Sprite->Image->Overlay5->Lol->GetYPos(i, 0);
     if (Xpos != 127 && Ypos != 127)
     {
      CSC_Sprite*   NewSprite;
      //GameData->Sprites[323+Cnt].ImagesEntry
      NewSprite = IScript->AddSprite(&GameData->Images[494 + (i & 0x07)],
             Unit->Sprite->Level + 1,
             Unit->Sprite->XPosition + Xpos,
             Unit->Sprite->YPosition + Ypos
             );
      IScript->StartScript(NewSprite,0);
      if (i >= 16)
       NewSprite->Primary->Flip = true;
     }
    }
 }
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2007-01-08 at 09:45:00
The .LOF file itself contains data on which fire/blood to use. .LOF files contain 22 offsets which correspond to the number and, if you change them, type of the flame entries.
Report, edit, etc...Posted by BroodKiller on 2007-01-08 at 14:08:23
LA>Could you talk in a bit more detail about this? I would put this info in the Overlay hints in DatEd.
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2007-01-08 at 14:30:02
Sure. images.dat only tells the game which .LOF file to use with a given graphic. The actual flame/blood entries are determined by that .LOF.

Each .LOF file contains 22 "offsets" which provide x- and y-coordinates for the flames. The first offset corresponds to images.dat entry 450 (Flames1 Type1 small), the second to 451, etc. up to 471 (Flames8 Type3 Small). If the coordinates are set for anything other than 127, 127, the flame appears at that position.

Most of that has to do with LO?Edit rather than DatEdit, but that's my knowledge of it.
Report, edit, etc...Posted by Kookster on 2007-01-08 at 14:37:53
im confirming that LA said cause I was tinkering with that file since i made a pylon float, so it looked weird for the ground to be burning. I changed the file and lo and behold i had red and blue flames.
Report, edit, etc...Posted by TheNomad on 2007-01-12 at 14:52:05
Interesting research Broody smile.gif

I was looking for some LO? explanations for some time and yours came just in time smile.gif As for the U and D, I thought the same as you, but was a bit lazy to check. The Valky, imo, might need the U and D overlays since it used to have bombs and I assume it would land to recharge them (just a guess), but it might have to do with that; another possibility is an overlay for the afterburner tech as already mentioned.
The opcode in question (0x41) is orderdone which unsets the bit set by sigorder. I'd say it is a bit AND modifier.

As for the smoke puffs... I did some asm fooling around in the exe and I found the address where the Refinery (yes, only Refinery atm) replaces the Geyser.
Normally, building it will stack them and finishing building it will replace it. Upon destruction the geyser is returned. I managed to replace it with a Bunker. Basically you DO build a Refinery (that is what it starts as), but the building animation and final result are of the Bunker. It crashed. As soon as I added the Assimilator overlay (was lazy to look for another one) and added the overlay Iscript commands for the smoke puffs it didn't crash anymore. Well the puffs were all over the map (lol); also I didn't check whether it worked like a Bunker or a Refinery (... will do that eventually biggrin.gif), but upon its destruction, the Geyser wasn't returned... (too complicated to check where the Geyser gets returned)...

Anyway, my point... yes, the engine looks for specific LO formats like you said, but I think I can still add my own overlay IF I do it in the correct overlay section smile.gif
... although I will do more research on it as soon as I figure out more about overlays since it is not my favorite subject tongue.gif

QUOTE(Lord_Agamemnon(MM) @ Jan 8 2007, 10:30 PM)
Sure.  images.dat only tells the game which .LOF file to use with a given graphic.  The actual flame/blood entries are determined by that .LOF.

Each .LOF file contains 22 "offsets" which provide x- and y-coordinates for the flames.  The first offset corresponds to images.dat entry 450 (Flames1 Type1 small), the second to 451, etc. up to 471 (Flames8 Type3 Small).  If the coordinates are set for anything other than 127, 127, the flame appears at that position.

Most of that has to do with LO?Edit rather than DatEdit, but that's my knowledge of it.

[right][snapback]611422[/snapback][/right]


Interesting! One question: how does it decide which of the 22 entries to use ? Randomly or is there some sort of prioritization or ID specific data (unit or weapon?) ?
Report, edit, etc...Posted by ShadowFlare on 2007-01-13 at 22:40:28
One note on the "flames overlay" LOF files. It does not crash if you give the LOF the proper number of "frames" which correspond to the highest numbered frame that would be used in iscript.bin for that graphic (including the turned frames).

I did exactly that for the mod that goes with my work-in-progress Starcraft Maul map. The buildings I have in that have custom iscripts which correspond to graphics for units instead of buildings. I eventually thought to check the lo* files that were used and found that I needed to have it match the number of frames I used in the iscript. The feature I put in LO?Edit for copying the offsets to the other lo* frames is very useful for this. smile.gif All you need to do is increase the number of frames that it is storing offsets for and then click the button to copy them.
Report, edit, etc...Posted by SI on 2007-01-14 at 18:08:18
Just a random guess, maybe someone else can confirm this.
Flames / bleed effects are generated as image overlays attached to the building sprite in the image list while landing dust / takeoff dust are new sprites entirely.
Can someone verify this?
Report, edit, etc...Posted by Kookster on 2007-01-15 at 03:18:21
flames/bleed effects are generated by one of the lo files, which type is determined by locations in the lo file. Its really complicated. Basicly you could make a unit look burning when its hurt. Its pretty cool but kinda glitchy.
Report, edit, etc...Posted by TheNomad on 2007-01-15 at 05:36:22
I believe he was saying ... in simple terms that assuming each graphic type is a separate class (well they are sort of), Flames are spawned classes consisting of images (LOF "code" so to speak) and Lift-Off/Land (LOD/U) are generated as sprite classes.

... in other words assuming we'd control it by IScript, flames would be spawned as imgol/imgul commands and lift/land as sprol/sprul.

(but I do admit I am guessing what he meant interested.gif )
Report, edit, etc...Posted by SI on 2007-01-15 at 07:34:33
QUOTE(TheNomad @ Jan 15 2007, 05:36 AM)
I believe he was saying ... in simple terms that assuming each graphic type is a separate class (well they are sort of), Flames are spawned classes consisting of images (LOF "code" so to speak) and Lift-Off/Land (LOD/U) are generated as sprite classes.

... in other words assuming we'd control it by IScript, flames would be spawned as imgol/imgul commands and lift/land as sprol/sprul.

(but I do admit I am guessing what he meant  interested.gif )
[right][snapback]613969[/snapback][/right]

You kinda got it...
lets see... there are sprites in SC and images
each sprite consists of onr or several images.
the question was whether the flames are created as another subimage of a sprite or as an extra sprite object, and if it is a subimage how SC knows what images to take away when the building was repaired...
Report, edit, etc...Posted by TheNomad on 2007-01-15 at 11:09:42
Thought so smile.gif

Taking a very extreme wild guess, I'd say flame/blood uses images if it uses overlays as to display several parts of images so to speak, and not a complete ensemble of a sprite. I'd say the lift/land use sprites, though...

Although it is just a (semi-educated) guess. Not very reliable.
Report, edit, etc...Posted by SI on 2007-01-15 at 11:44:50
QUOTE(TheNomad @ Jan 15 2007, 11:09 AM)
Thought so smile.gif

Taking a very extreme wild guess, I'd say flame/blood uses images if it uses overlays as to display several parts of images so to speak, and not a complete ensemble of a sprite. I'd say the lift/land use sprites, though...

Although it is just a (semi-educated) guess. Not very reliable.
[right][snapback]614022[/snapback][/right]

thats exactly my guess but I dont know how SC would know what overlays to remove when it stops burning wink.gif
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2007-01-15 at 11:51:23
I don't know that either. I can confirm, however, that landing/liftoff dust are separate sprites while flames are attached images. The test is simple: look in sprites.dat and images.dat. Dusts have their own sprites.dat entries; flames do not.

Which flame/blood overlay is used is determined by the .lof file. If an overlay's position is set to 127, 127, it will NOT appear, and any other value will make it appear. As I said before:

QUOTE
Each .LOF file contains 22 "offsets" which provide x- and y-coordinates for the flames.  The first offset corresponds to images.dat entry 450 (Flames1 Type1 small), the second to 451, etc. up to 471 (Flames8 Type3 Small).  If the coordinates are set for anything other than 127, 127, the flame appears at that position.


So, for instance, you could make Terran buildings bleed by placing any offset from 9-16 in the same area as the flames with Lo?Edit. I don't see why this is so complicated tongue.gif
Report, edit, etc...Posted by TheNomad on 2007-01-15 at 12:16:52
Well, I think SI and I based the assumption on logic, but yeah, looking in Sprites.dat would say the same tongue.gif

As for the LO? thingy you said, it isn't hard to understand... What I don't understand (maybe SI too, but I won't speak for him) is how each part of the overlay is decided...

From what I understood, each LO? entry (respectively an overlay frame) corresponds to a blood/flame entry (respectively, an image), correct ?
If so, what I don't understand is how each building decides which LO? entry to choose (therefore influencing which image to use)... I mean, is it based on the last projectile trajectory ? Or random ?

... I tend to smell a bit of hardcoded-ness in there somewhere...
Report, edit, etc...Posted by SI on 2007-01-15 at 13:24:10
I assume its random, the same way the damage wireframe is done
Report, edit, etc...Posted by TheNomad on 2007-01-15 at 13:24:36
That was my impression too...
Report, edit, etc...Posted by Kookster on 2007-01-15 at 14:48:55
Its not random! When ever a building burns its the same burn patterns everytime! But this is what confuses me, I took the barracks lo file for burning and gave it to the carrier. When the carrier was hurt it started burning, but all the burns were in random locations!!
Report, edit, etc...Posted by SI on 2007-01-15 at 15:41:29
QUOTE(Kookster @ Jan 15 2007, 02:48 PM)
Its not random! When ever a building burns its the same burn patterns everytime! But this is what confuses me, I took the barracks lo file for burning and gave it to the carrier. When the carrier was hurt it started burning, but all the burns were in random locations!!
[right][snapback]614121[/snapback][/right]

I have 2 rax at 890 hitpoints with different flames on them...

edit: ok barracks have 3 spawn points, each of which jumps to the large version of the flames before an additional one spawns. (22 small flames and 22 large in images.dat)
first flame appears under 905 / 1000 HP
Gets large aroung 810 / 1000 (a bit random)
and another small around 700

hmm this is weird, repairing it caused the big flame to turn small///
Next Page (1)