Units animations

Discussion in 'Modding' started by Johny, Feb 7, 2020.

  1. Johny

    Johny Active Member

    I know this type of topic has been already discused in 19th Cent. mod, but I want to divide this delicate topic from it in the new thread.

    I succesfully made my own animations for a unit (working with roundshier in this topic)

    ...lukewarm applause...

    and this means I have some questions about adding and smoothing animations in-game.

    Firstly, for those who don't know how to do it, you need converte .oss/.osm to .obj file and then make whole inside skeleton of an unit and do animation for all events (death, attack, idle...). Ain't easy and it takes time, but it's possible, which give us plenty of opportunities to create new animations and make units more vital.
    I used 3ds Max, C3ModelViewer and ossskinplugin (important plugin for 3ds Max!)


    Hint: Flip the V title in UVW Xform (in 3ds Max), otherwise the skin will be corrupted on object!


    Now I have several questions about files that are responsible for animations workflow.

    I already know that roundshier.aaf is responsible from "picking" frames from animation string.

    quesstion 1: How to create a variety of animation for one action? (idle0, idle1, attack0, attack1)
    I've seen this in 19th C. thread but I don't understand that correctly. Simple addition of "idle1, idle2" does not work. Logically there must be some file that infuencing the set of animations. I would like to add variety of animation and also add new animations (roundshier is missing prepare stand, as its have pikeman)

    And that's leading me for another questions about files, since I tried but I don't understand them properly.

    quesstion 2: for what are files with name

    roundshier.actor (basically loading animations for actor and creating actor list item)
    actors.lib (just a library of actors, does it need to be ater?)
    refunit.acl (this conatins struct named: default, idle, walk, but I have no idea what this file is intend to do)
    refunit.actor (something with actor list item?)

    quesstion 3: Are there another files important for succesful addition of animations?

    Contact me here or on Discord (I'm looking there daily)!

    Thank you for your answers.
    Loner and Foeurdr like this.
  2. Loner

    Loner Well-Known Member

    Fantastic stuff Johny, I wish you all the best with this, completely over my head I'm afraid.
  3. Ebel

    Ebel Moderator Staff Member

    I''ll try to answer some things at least.

    The .acl (Animation Cycles Library) Files are responsible for the transitions between animations along with some code, but theoretically you won''t need to change the code, everything should already be there. This file ties different animations together, the speed at which they are executed, etc...

    ACL.LIB tells you which .acl is used for which unit. In case of the round shier, it is infantry.acl

    These acl files are hard to read, they are long and it can be hard to keep the overview. I suggest you look at them at least once in the acl editor for a better understanding.

    You can find the acl editor in the external editor (Module->Animation Library). Select a unit (Roundshier), then hit the edit button.
    Alternatively you can you use the standalone version I uploaded to my site: http://cossacksworld.ucoz.co.uk/load/c_iii_files/mod_map_tools/c3_acl_editor/82-1-0-470
    It does just the same, you''ll have to select 'all files' first on loading, (it looks for a .library file instead of .lib ( acl.lib)), then you can edit.
       [*] : struct.begin
          Name = attack1
          From = idle
          CyclesList = False
          Options : struct.begin
             acoSmoothAnimation = True
             acoRandomFrame = False
             acoRandomCycle = False
             acoSkipActions = False
          items : struct.begin
             [*] : struct.begin
                Action = actAnimation
                AnimationName = prepare1
                NumberCycle = 1
             [*] : struct.begin
                Action = actTrackPoint
                TrackPointMoveStep = 0
                TrackPointTurnStep = 11.125
                TrackPointIdleName = idle1
                TrackPointMode = mmNone
                TrackPointPreset =
    This tells you that between the 'attack' animation and the 'idle' animation (notice the 'from' in the second line), the transition that is being used is the 'prepare1' animation, whichever those frames are , as defined in the .aaf file and this cycle of frames is being ran one time and at which speed.
    I find this a bit a weird way of doing things, but here it is. There are many unused options in this setup, but that's a different story.


    Actor files do more than just loading animations for the actor. They also hold the properties/options that are being applied to the .osm and .oss files. That can go from shaders being used over rotation to renderdistance etc...
    Look into data/actors/ref files to see all the options that are being loaded by default, for example refobj.actor shows quite a few options.

    No need normally to change actors.lib unless you add ('new') units. New as in, proper new graphics. It just tells the game which .actor files to load on startup.

    Reference files:
    Probably the most important files, or at least it's important that you understand how they work, or what they do.
    REF (reference) files are not unique to objects, you can find them for other files as well (.actor, materials, animations,...). These are used to list all the 'default' options and settings used for .actor, .prop, etc files. Rather than bloating a file with all the possible options, making it hard to read, a single line referring to this file will load all these options. (ie: {refurl=.\data\objects\ref\refunit.prop; refkey=mainproperty} ) . Overwriting any of these options is simply done by redefining the option in the used file.
    In many cases, settings/options are the same for most units/buildings/trees, etc..., so instead of repeating these options all the time in each .actor file etc, they are just being put in one file, and referred to in the needed file by one line.
    It's important that you understand , even though you don't see these options in the .actor, .prop file, they are loaded for these units/buildings if the referral url line is there.

    Ref unit.acl:
    In case of the refunit.acl file, I don't really see the refurl to this file being used at all, which just makes this a 'sample' file.

    Ref unit actor:

    If you look at the file, knowing what i just told you, every .actor file which refers to this file will load the defined options , in this case, specific shaders for units, how to handle the animations (morphing,looping,...) AND, all the options from refobj.actor, because that file is being referred to as well. Refunit.actor overwrites some options specified in refobj.actor. Normally you won't have to make changes to this file.

    Not of the top of my head but it depends what you are doing ofcourse.

    Don't know if this helped at all.
    Loner and Johny like this.
  4. Johny

    Johny Active Member

    Of course it helped, as usual, thank you so much Ebel!

    Other answers are still welcome! (Mabye I will contact Awar)
    Loner likes this.
  5. Ebel

    Ebel Moderator Staff Member


    I forgot to say, there's actually a line in the .prop files which refers to the acl files as well. It would entirely depend on what you do of course, like are you cloning, making a new unit, etc... but it's there, possibly in the .refunitprop files
    frameanimationproperty : section.begin {refurl=.\data\objects\ref\refunit.prop; refkey=frameanimationproperty}
       FrameAnimationCyclesLibName = base.inf.knight.1
    The lib name being the one being used in the acl files. It's just to the game can tie the .prop and .acl file together so it knows which animations cycles to load for the unit. Again with refurl's as well.

    It's possible there are more things related to this, which may or may not be important. I'll keep it in mind if I think of it, ill post, meanwhile others can post relevant information if they have it.

    Good luck with all of this, I find it impressive you are trying this out, not many get that far or have the courage to do so. Don't give up now. You are very close to having your own units in game. Keep us up to date.
    Johny and Loner like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice