Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: Creating a World - Unit Sprite Generating

  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Creating a World - Unit Sprite Generating

    The full credit for this tutorial goes to Caliban who posted the original in May 2007. Further credit is extended to alpaca for his DDS<->Texture tool and NVIDIA, ImageMagick and u7angel for the DDS converter.

    The aim of this rewrite is to consolidate the information gathered in the original thread and to provide a safe upload for the tools and their 'soft and easy' setup.

    The hard core way
    For those interested in the inner workings of generating sprites please refer to my post in the original thread
    .


    The soft and easy way
    Setup


    Preparation
    • Open the sprite_script.txt file in the Medieval II Total War main folder and enter the model name(s) from the modelDB file, one entry per line
    • Make sure sprite entries in ModelDB follow this naming convention otherwise you have to change either the sprite file name or the ModelDB entry (the line count numbers have not been added in the example) :

    Code:
    model name
    Mesh lines
    faction
    texture line
    texture line
    unit_sprites/faction_model name_sprite.spr

    • Run your mod

    Converting
    Once your mod has exited go to the ...\Medieval II Total War\export\unit_sprites folder and proceed as follows:

    • Run\double click the _1 Convert TGA to DDS file - you will have to browse to the export\unit_sprites folder to set the source and destination folder, this is a one time affair. The other settings have been preset. Click 'Convert'
    • Run\double click the _2 Convert DDS to Texture file
    • Run\double click the _3 Delete DDS and TGA file
    • Move the remaining SPR and TEXTURE files into the ....\data\unit_sprites folder of your mod
    • Put a hash (#) sign in front of the bypass_sprite_script line of your mod's CFG file unless you wish to generate further sprites

    Note: the DOS windows may not close after finishing the task - this is done to enable bug hunting. Simply press any button to close the window, click on the window first to activate it.

    Last edited by Gigantus; March 11, 2019 at 11:11 PM. Reason: clarifying










  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    Regarding the settings in the TGA->DDS converter

    I have doubts that mip maps are required, they certainly are not required for vegetation sprites. If anything, it will reduce the size of the textures by a couple of KBs. Not much for the individual sprite set admittedly but it adds up nicely when you have a couple of dozen.










  3. #3
    Japabeaner's Avatar Libertus
    Join Date
    May 2014
    Location
    United States
    Posts
    66

    Default Re: Creating a World - Unit Sprite Generating

    Do I need to install both files or just a preffered one?

  4. #4
    irishron's Avatar Cura Palatii
    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Creating a World - Unit Sprite Generating

    If your Windows version is 64bit use the second one.

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    Added a clarification in the OP.










  6. #6
    Ngugi's Avatar TATW & Albion Local Mod
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    10,687

    Default Re: Creating a World - Unit Sprite Generating

    This compilation and set up is so smooth, had different program installed earlier that operated "manually", so this si gold. Thanks a lot!

    Kingdom of Lindon preview video out





    DCI: Last Alliance
    - WIP Second Age mod | DCI: Tôl Acharn - mighty Dúnedain Counter Invasions |
    Additional Mercenary Minimod - more mercs; for TATW and DCI | Family Tree minimods - lore improvements | Remade Event Pictures - enhance cultures trough images |
    Favorite TATW compilation: Withwnars Submod Collection
    Patron of Mank, Kiliç Alì, FireFreak111, MIKEGOLF & Arachir Galudirithon, Earl of Memory

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating











  8. #8

    Default Re: Creating a World - Unit Sprite Generating

    I finally managed to get Ireland added as a faction (and using Ireland and not the Saxons). So, now I'm in the process of adding its units to the various buildings one uses to enlist (create) them. However, as tends to happen far too often, within that process I managed to get side tracked (as I'm sort of using Scotland's unit enlistment as a guide).

    In so doing; I've come across Scotland's Feudal Knights and I'm thinking "if Scotland has Feudal Knights, then Ireland should too!" Which is what brought me here; as Ireland does not have an ireland_feudal_knights_sprite.spr file (or the textures either).

    Sadly, I don't quite understand your tutorial; as something just isn't clicking. Perhaps, though, generating a sprite is not the same as creating one? But I'm also a learn by example kind of person... So, if and when you have the time, perhaps you can guide me through the where's, what's, when's and why's of this process so the how makes more sense to me.

    Thank you.

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    Simply follow the instructions in the 'the soft and easy way' section one step at a time. This will only cover the generating (creating) of sprites - there is a detailed tutorial how to add an existing unit from another mod which should guide you what entries to add to get the feudal knights added to Ireland. You will have to implement the unit in the modeldb file before you can generate the sprites for it.
    Last edited by Gigantus; April 07, 2018 at 12:40 AM.










  10. #10

    Default Re: Creating a World - Unit Sprite Generating

    Thanks. I'll probably figure it out eventually; but I just recently realized that it probably won't matter (for me); as I rarely use the RTS portion of the game. In most cases, the only modifications I need to make are to the Unit and Unit Info cards; except for the priests (which I'll be getting too soon).

  11. #11
    AnthoniusII's Avatar Μέγαc Δομέστικοc
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    19,047

    Default Re: Creating a World - Unit Sprite Generating

    Question. Do horses require sprites too?
    We have created 5 new models based on MARKA ones and the sprites are vanilla (yet).
    If yes is it the same proceedure with units?
    TGC in order to continue its development seak one or more desicated scripters to put our campaign scripts mess to an order plus to create new events and create the finall missing factions recruitment system. In return TGC will give permision to those that will help to use its material stepe by step. The result will be a fully released TGC plus many mods that will benefit TGC's material.
    Despite the mod is dead does not mean that anyone can use its material
    read this to avoid misunderstandings.

    IWTE tool master and world txt one like this, needed inorder to release TGC 1.0 official to help TWC to survive.
    Adding MARKA HORSES in your mod and create new varietions of them. Tutorial RESTORED.


  12. #12
    paleologos's Avatar You need burrito love!!
    Join Date
    Feb 2011
    Location
    Variable
    Posts
    8,496

    Default Re: Creating a World - Unit Sprite Generating

    Quote Originally Posted by AnthoniusII View Post
    Question. Do horses require sprites too?
    Absolutely, the image below is from vanilla, -byzantium_mount_heavy_horse_sprite_000-
    Click image for larger version. 

Name:	byzantium_mount_heavy_horse_sprite_000.png 
Views:	319 
Size:	81.2 KB 
ID:	352459


    Note the absence of a rider.
    Given the fact that the variety of body stances for an infantryman is not the same as that for a cavalryman, this would mean that the same model of troops would have different sprites for the human rider than the footman.




    Quote Originally Posted by AnthoniusII View Post
    We have created 5 new models based on MARKA ones and the sprites are vanilla (yet).
    If yes is it the same proceedure with units?
    I have not made sprites for horses but if I were to try I would type in the name of the mount model not the unit.
    Experiment with it and come back here to post your results and any hints you might have to share.
    Last edited by paleologos; April 10, 2018 at 08:43 AM.

  13. #13
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    paleo is correct: you need to enter the mount's model name (as in modeldb) to generate the sprites. The game merges the sprite of mount and rider, check the rider sprites for their typical 'bow legged' silhouette in the sprites to see how it works.










  14. #14
    AnthoniusII's Avatar Μέγαc Δομέστικοc
    Join Date
    Feb 2007
    Location
    Thessalonike Greece
    Posts
    19,047

    Default Re: Creating a World - Unit Sprite Generating

    Thanks guys...We will give it a try.
    TGC in order to continue its development seak one or more desicated scripters to put our campaign scripts mess to an order plus to create new events and create the finall missing factions recruitment system. In return TGC will give permision to those that will help to use its material stepe by step. The result will be a fully released TGC plus many mods that will benefit TGC's material.
    Despite the mod is dead does not mean that anyone can use its material
    read this to avoid misunderstandings.

    IWTE tool master and world txt one like this, needed inorder to release TGC 1.0 official to help TWC to survive.
    Adding MARKA HORSES in your mod and create new varietions of them. Tutorial RESTORED.


  15. #15
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    I am afraid not. Usually when units get set up the sprite line is done by hand and often sprites get used from another, similar unit. Which makes life messy.










  16. #16

    Default Re: Creating a World - Unit Sprite Generating

    So I am in the lenghty process of creating like 20 of these sprites and I did everything in your tutorial but my game just crashes at the first loading screen and I dont get any pictures in the export folder, any ideas what am I doing wrong?

    EDIT: I hate how whenever I ask something I figure out the problem in the next 5 minutes, I didnt put the files in the main M2TW folder...
    Now it indeed creates sprites but it creates 1 for my faction and 1 for slave, does slave faction need to have their sprites or can they use the same as my faction ( easier to copy-paste)
    Last edited by skylli; January 24, 2019 at 12:57 PM.

  17. #17
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating

    It will generate sprites according to the faction entries in the unit's modeldb entry. And those should be according to the EDU ownership entries.

    It is common to simply use only one sprite if the textures are the same, wouldn't want a red looking unit turn blue when it fades into the distance
    Last edited by Gigantus; January 24, 2019 at 07:40 PM.










  18. #18

    Default Re: Creating a World - Unit Sprite Generating

    Yes, the slaves and my faction use the same sprites and no other faction has my troops avaliable
    Oh and great job done on the programs for this, it speeds up the time needed for this very very much

  19. #19
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: Creating a World - Unit Sprite Generating











  20. #20

    Default Re: Creating a World - Unit Sprite Generating

    Adding this for the window-lickers (like myself). APPARENTLY un the sprite_script.txt, you are not supposed to include the brackets [] or the number that precedes every line from the battle_models.modeldb, nor the distance from the mesh lines & delete spaces that some mods leave hanging off their lines in the battle_models.modeldb.

    L'Example: entry for albion_warrior in battle_models.modeldb (from the Call of Warhammer Beginning of the End Times Mod)

    Spoiler Alert, click show to read: 


    14 albion_warrior 1 1
    52 unit_models/_units/warhammer/albion/albion_lod0.mesh 6400
    2
    4 merc
    50 unit_models/_units/warhammer/albion/albion.texture
    57 unit_models/_units/warhammer/albion/albion_normal.texture
    40 unit_sprites/slave_DE_warrior_sprite.spr
    5 slave
    50 unit_models/_units/warhammer/albion/albion.texture
    57 unit_models/_units/warhammer/albion/albion_normal.texture
    42 unit_sprites/mongols_DE_warrior_sprite.spr
    2
    4 merc
    51 unit_models/_units/warhammer/albion/albionw.texture
    58 unit_models/_units/warhammer/albion/albionw_normal.texture 0
    5 slave
    51 unit_models/_units/warhammer/albion/albionw.texture
    58 unit_models/_units/warhammer/albion/albionw_normal.texture 0
    1
    4 None
    14 MTW2_Swordsman 0
    2
    18 MTW2_Sword_Primary
    14 fs_test_shield 0
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002


    Becomes THIS in the sprite_script.txt:

    Spoiler Alert, click show to read: 


    albion_warrior
    unit_models/_units/warhammer/albion/albion_lod0.mesh
    merc
    unit_models/_units/warhammer/albion/albion.texture
    unit_models/_units/warhammer/albion/albion_normal.texture
    unit_sprites/merc_albion_warrior_sprite.spr




    ALSO: after clicking " _2 Convert DDS to Texture" you need to press any key for the script to advance (made lunch, came back confused) lol
    Click image for larger version. 

Name:	2vt8oz.jpg 
Views:	4 
Size:	68.8 KB 
ID:	357681

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •