Announcement

Collapse
No announcement yet.

Original ToT Style Resource Animation Mapping

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

  • Original ToT Style Resource Animation Mapping

    I want to create unique animations for my resource animations in an Original ToT Style based scenario.

    After creating unique animations for resources based off of a Fantasy based scenario it was much to my dismay that the animation order and animation frame count differs greatly from other scenario base types. So, I have to start with the animation faze from scratch if I want to get my animations to work properly.

    To do so, I plan to map the animation order of each terrain type so that I can correctly position my boats and fishes and make them float and swim without teleporting all over the place.

    Before I started I wanted to check with the community and see if anyone has bothered to map this out yet. It would be nice to skip a few tens of hours working on animation.

    So? Has anyone documented this?

  • #2
    I have not. But I echo your wish.
    Tecumseh's Village, Home of Fine Civilization Scenarios

    www.tecumseh.150m.com

    Comment


    • #3
      I am sure Merc and Catfish covered some of the ToT animation aspects?

      We should check their sites...

      ...
      http://sleague.apolyton.net/index.php?title=Home
      http://totalfear.blogspot.com/

      Comment


      • #4
        Originally posted by curtsibling
        I am sure Merc and Catfish covered some of the ToT animation aspects?

        We should check their sites...

        ...
        Well there's the incredibly useful CivSprite by Mercator of course, which I've used from the onset of working with the animation.

        Catfish offers some insight into the animations, but I don't see a diagram on the order and length of animation. Now looking at his Original game mod I see he just replaced some animated cells with a static picture.

        Comment


        • #5
          I'm not entirely sure I understand what you want to do, but...

          CivSprite is pretty useless in changing animations. If you want your own animations without being limited to the order of the existing ones, you'll have to hex-edit it...

          The best I can do there at the moment is give you the details on the sprite file format:


          I can explain further if needed...
          Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

          Comment


          • #6
            Originally posted by Mercator
            I'm not entirely sure I understand what you want to do, but...

            CivSprite is pretty useless in changing animations. If you want your own animations without being limited to the order of the existing ones, you'll have to hex-edit it...

            The best I can do there at the moment is give you the details on the sprite file format:


            I can explain further if needed...
            CivSprite is useful as it breaks down the resource animation file and then rebuilds it after the images contained within are edited. I don't want to change any animation order and I certainly don't want to screw with hex editing. It's unnecessary in this instance. CivSprite is just a utility, not paint software. It just allows the images in a sprite file to be edited. This is not complicated. All I'm talking about is drawing some new terrain in a few images and then recompiling the file.

            The idea is to map out the frame order for each unique terrain animation. If you take a look at the graphic frames contained in the resource file you will see that each resource has a unique group of frames. Watch how these frames are displayed in the game and you will find out that the frames are not displayed in order in all the animations. Some repeat the first three frames and then proceed with the animation. Some display the frames in order but then jump around. The idea is to document the order of the frames in each animation so that I know where in the picture to place my graphics so that they mimic natural and fluid movement when the file is recompiled and used in-game.

            Comment


            • #7
              Okay then, not quite as ambitious. I sort of figured that was probably what you meant, because starting from scratch is going to be a right pain.

              The easiest way to map out these animations is still going to be by using a hex-editor, though. The animation order as you describe is clearly laid out in the file, which you should be able to figure out with the file format description. Just writing down what the file says is going to be a hell of a lot easier than trying to eyeball it watching the animations play.
              Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

              Comment


              • #8
                Just about done with the Terrain 1 file. I'll post my summary when I double check the order. The order of these animation remind me of some weird dance step. 1,2,1,2,3...

                Comment


                • #9
                  Originally posted by Harry Tuttle
                  Catfish offers some insight into the animations, but I don't see a diagram on the order and length of animation. Now looking at his Original game mod I see he just replaced some animated cells with a static picture.
                  Alternatively, I could've hex-edited the animation header to point those resources to a nul animation entry, like the one at offset 0x06F4. I might just do that. It's a tad more elegant.

                  I haven't mapped out any of this stuff, because, like Mercator said, you can just read the animation sequence from the sprite file using a hex-editor. If you want to customise sequences you can rewrite the animation header and information sections of the file. I did that for my WotR scenario.
                  Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

                  Comment


                  • #10
                    Originally posted by Catfish

                    If you want to customise sequences you can rewrite the animation header and information sections of the file. I did that for my WotR scenario.
                    Oh. Where can we find that?
                    Tecumseh's Village, Home of Fine Civilization Scenarios

                    www.tecumseh.150m.com

                    Comment


                    • #11
                      Ok, I've been looking at this stuff, and eye balling, but I can't get the animation for the 1st Tundra resource on Terrain1. I've tried "just hex-editing", but like 99% of the rest of the population I can't figure it out without taking a week off from work. Can one of the wizards kindly take some time and spell out how the animation works?

                      Comment


                      • #12
                        Originally posted by Harry Tuttle
                        I've tried "just hex-editing", but like 99% of the rest of the population I can't figure it out without taking a week off from work.
                        Just a slight exaggeration there.

                        The two sections you need to look at in resource.spr are the animation header and the animation information block. For the resource.spr file from the Original game, you're looking at these offsets (byte addresses):

                        0x000C - 0x016B Animation header (352 bytes)
                        0x016C - 0x06F7 Animation information (1420 bytes)

                        The animation header tells Civ2 where to find the animation sequence for each of the 88 possible resources (22 per map x 4 maps). The header lists the resources in the same order as they appear in the @TERRAIN sections of rules.txt. Each entry is 4 bytes long, so you've got a total of 88 x 4 (352) bytes. A good idea would be to set the column width of your hex-editor to 4 bytes per row; it'll all line up nicely, with one resource per line. The values in the header are addresses which point to the start of an animation sequence stored in the animation information section. The animation sequences are not stored in the same order as rules.txt.

                        Below is a screenshot from the hex-editor, AXE, showing the first 11 (of 88) resources in the animation header. You'll notice that 3 of the resources (Grassland, Coal and Peat) share the same address for their animation sequence: 0x06F4. That's because they're not animated. The entry at that address basically says, 'do not display a frame'. The 7th resource (1st Tundra) in the animation header, Game, has the address 0x04A4, so let's head there and take a look at the animation information section.



                        The animation information section simply lists frames in the order they appear in an animation. Conveniently each frame entry is 4 bytes long, so we can leave our column width at 4 bytes per row. That way we get 1 frame per row. The screenshot below shows the entire animation sequence for the Game resource, beginning at offset 0x04A4. The first byte of each entry tells you the image number (the same number that appears on the image files when you export with CivSprite). Actually, the image number is the first byte plus the last 2 bits of the second byte (10 bits), but since there are less than 257 images in this file, we won't need to worry about that. For the 2nd byte, you really just need to be looking for values of 0x20: that tells you it's the first frame in an animation sequence. The 3rd byte is almost always 0x06. Its function is unknown - ignore. You're looking for two values in the 4th byte: 0x01 indicates the end of a sequence (the frame listed is not displayed), 0x02 tells you the frame is part of a looping sequence, eg, oil.



                        So the Game animation sequence goes like this: 76, 77, 78, 79, 78, 79, 78, 77, 76, 80, 81, 80, 76, 82, 76, 80, 81, 80, 76, 82, 76, 80, 76.

                        How do you eyeball something like the Buffalo sequence which repeats images in successive frames: 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 17, 16, 15, 14, 13, 12?
                        Last edited by Catfish; July 28, 2007, 03:50.
                        Catfish's Cave - Resources for Civ2: Test of Time | Test of Time FAQ | War of the Ring scenario

                        Comment


                        • #13
                          Catfish, would you tell us the status of your War of the Ring project, please?
                          Tecumseh's Village, Home of Fine Civilization Scenarios

                          www.tecumseh.150m.com

                          Comment


                          • #14
                            Thank you Catfish! I could get the other ones easily enough but when it gets over ten frames it gets cumbersome. I will try your method with the hex-editor.

                            Comment


                            • #15
                              Alright, for those interested:

                              The zipped file is an Excel Workbook. The animation order is based on a two map scenario based on the Original ToT Style format. I'm guessing that the animation slide numbering is dependent on the number of maps contained in the scenario. If this is true, be sure to adapt the file accordingly. If there's a mistake, let me know, and I'll fix the file.
                              Attached Files

                              Comment

                              Working...
                              X