Announcement

Collapse
No announcement yet.

Yet another (sprite) discovery

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Yet another (sprite) discovery

    Compared to MGE, ToT savegames have 5 extra words (=short unsigned integers, taking up 2 bytes and a range of -32,768 to 32,767) at the end of each unit.

    The 3rd word can be 0 to 3 and relates to which animation to use when the unit is active (animations are only ever used for active units). The order corresponds to that in the unitXX animation sprites:
    0 Attack
    1 Die
    2 Idle
    3 Move

    The 4th word can be 0 to 7 and this determines the facing direction (both for active and inactive units, in other words, both for the unitXX and static sprites). In clock-wise direction from North (0) to Northwest (7).

    Since these are words there are much more possible values, however, I think the above are the only valid ones. Some other values do work (e.g. making a warrior look like an engineer when static), but a lot of other values outright crash ToT.


    There is at least one way this can be exploited. One single unit can be used for up to 5 (or 8 if you don't mind mirroring) different "impassable" units. Say, you could have a Great wall unit, and use different graphics for each of the 5 different facing directions to create a winding wall. This way you will only need 1 unit, rather than 5 different ones, so you can create more varying graphics without sacrificing any more valuable unit slots.

    This will only work, however, for units that can't move (or the unit would turn to face the moving direction) and can't be attacked either (or the unit would turn to face the attacker).


    Oh, and of course, to create impassable units, using my previous discovery to hide the unit key would be pretty mandatory.


    And by the way, I updated SpriteGen a little too. See the earlier thread, or check my MapEdit website.
    Last edited by Mercator; June 29, 2003, 08:22.
    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

  • #2
    Hmmm...Nice work Sherlock. Despite the fact that there is a leg-humping smiley at Space Spider, I'll just say .

    Is the following 'fog of war' effect possible? Immobile units, which differ in strength, share a name and sprite. When they get attacked, they show their own distinctive sprite. That way you have to do a recon attack before attacking with something valuable. Do you just have to be real careful about how they face when they're deployed and attacked? I've turned off sprites for so long, I've forgotten whether attacks from directions other than E or W trigger other sprites.
    El Aurens v2 Beta!

    Comment


    • #3
      The static sprite file stores 5 different angles, from North through East to South. Southwest, West and Northwest are mirrored versions of Southeast, East and Northeast, respectively.

      Well, the same name and sprite is as easy as giving more units the same name in the rules, and the same icon in the units bitmap/static sprite file, so that's not the problem.

      A unit can only get a different icon under attack when it is attacked from an angle it isn't facing...

      So, you could create an immobile unit facing N. If it's attacked from any other angle than N, the sprite changes to the "real" unit. From that point onward the unit will be "revealed" (assuming that it can't ever be attacked from N and "hide" again).

      So, yep, it will work... You just have to limit the possible attack angles (compared to the initial facing direction), and keep in mind the mirroring...

      For example, if a unit initially faces N, it must not be possible to attack from N. But if a unit faces NE, it must not be possible to attack from either NE or NW.
      Secondly, if a unit can be attacked from both E and W, keep in mind that the unit will mirror. In most cases this shouldn't be an issue. But you might not want, say, the Statue of Liberty switching the torch to her left hand.
      Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

      Comment

      Working...
      X