1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Units] Melcher's Colonization Units

Discussion in 'Civ4Col - Mods and Files' started by melcher kürzer, Feb 4, 2011.

  1. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Thanks guys, glad you like them.

    Nice to hear that the units are useful for your. If you like i can post you a text-file with the needed xml entries (CIV4ArtDefines_Unit.xml and CIV4UnitArtStyleTypeInfos.xml). I had used a very simple structure but still it should spare you some time.
     
  2. M07

    M07 Prince

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    I had a problem when I wanted to add the Native America General unit in my mod.
    The great general was replaced by this unit, but I had still the great general when indians use him with one of them military units.
    I don't know if somebody had this problem, but I will explain us how I did to solve it.
    First, in the Xml files :
    - (CIV4UnitInfos.xml) You must duplicate the UNIT_GREAT_GENERAL and rename it.
    you must conserve the UNITCLASS_GREAT_GENERAL for your new unit.
    Spoiler :
    Code:
    <UnitInfo>
    			<Type>UNIT_GREAT_CHIEF</Type>
    			<Class>UNITCLASS_GREAT_GENERAL</Class>
    			<UniqueNames>
    				......
                            <ProfessionMeshGroups>
    				<UnitMeshGroups>
    					<ProfessionType>NONE</ProfessionType>
    					<fMaxSpeed>1.75</fMaxSpeed>
    					<fPadTime>1</fPadTime>
    					<iMeleeWaveSize>4</iMeleeWaveSize>
    					<iRangedWaveSize>0</iRangedWaveSize>
    					<UnitMeshGroup>
    						<iRequired>1</iRequired>
    						        <ArtDefineTag>ART_DEF_UNIT_NATIVE_AMERICA_GENERAL</ArtDefineTag>
    					</UnitMeshGroup>
    				</UnitMeshGroups>
    			</ProfessionMeshGroups>
    			
    


    - (CIV4CivilizationInfos.xml) for each indians, you must add this code:
    Spoiler :
    Code:
    <Unit>
    	<UnitClassType>UNITCLASS_GREAT_GENERAL</UnitClassType>
    	<UnitType>UNIT_GREAT_CHIEF</UnitType>
    </Unit>
    


    Then in the Cvplayer.cpp file, there is this function:
    void CvPlayer::setCombatExperience(int iExperience)
    You will find :
    Spoiler :
    Code:
    if (pBestCity)
    {
           .....
    }

    You must replace it by :
    Spoiler :
    Code:
    if (pBestCity)
    {
    	int iRandOffset = GC.getGameINLINE().getSorenRandNum(GC.getNumUnitClassInfos(), "Warlord Unit Generation");
    				
    	for (int iUnitClass = 0; iUnitClass < GC.getNumUnitClassInfos(); ++iUnitClass)
    	{
    		UnitTypes eLoopUnit = (UnitTypes) GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits((iUnitClass+ iRandOffset) % GC.getNumUnitClassInfos());
    		if (eLoopUnit != NO_UNIT)
    		{
    			if (GC.getUnitInfo(eLoopUnit).getLeaderExperience() > 0 || GC.getUnitInfo(eLoopUnit).getLeaderPromotion() != NO_PROMOTION)
    			{
    				pBestCity->createGreatGeneral(eLoopUnit, true);
    				setCombatExperience(getCombatExperience() - iExperienceThreshold);
    				break;
    			}
    		}
    	}
    }

    Now it works! Look! I hope it was not useless work :p. Nice job again melcher kürzer ;)!
    Spoiler :
     

    Attached Files:

  3. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Argh, when i tested the native units i used a european nation. Strange, with europeans the great general will replaced and displayed correctly. :confused:

    Definitely not useless. Good work.:goodjob:
     
  4. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,478
    Very nice units. Like you said, a bit high on the polycount, but I guess as long as they are used as single mesh units it should be alright. :goodjob:

    Some of them uses rather big dds files. The noble woman for example has a 512*512 size dds file. I would always try to use 256*256 size dds files at maximum, especially since those details you get with larger files normally can't be seen in game anyway. But again, it should be alright as single mesh unit. :)

    I'm a bit curious about the ship. As you said, it uses a high polycount and many textures. Do you uses it in regular games? And if you do so, is it a common unit or a rather rare one? Do you encounter any major lags when several of them are displayed?
    I'm asking this because I'm still pretty unsure how much the polycount and the textures of units matter for the performance of the game.
     
  5. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    The civilian units are mostly pirates imports and therefore they have a higher polycount. As you said it should be no problem and in Colonization units of that kind are rare on the map.
    With the native units i tried to make them as small as possible. I didn't know anything about texture merging at this point, but most of the units here in the download section are like that.

    Woops, it seems i have missed that. Normally i don't use 512*512 textures. Probably i forgot to resize the dds file. You mentioned some, have you seen other units besides the noble woman (and the ship of course)?

    Last time i have played Civ4 or Civ/col was last sommer i think. So i can't really answer that question. But i have placed whole screens with them and didn't notice any diffrence with performance.

    In my early days of unit-creation i used units from other people as a benchmark. There is a pack of 3 galleons here in the download section. All of them are pirates imports and kinda equal to my ship (polycount, textures).
    I have seen those units in popular mods and therefore i think it isn't that bad.
    Personally i believe if you use many such units and/or an older computer you will get trouble with the performance. But otherwise it should be fine.

    I try to optimize all my future military units (single texture, low polycount), for that i even rebuild units that are already made.
     
  6. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,478
    :goodjob:
    I've only checked the civilians and the ship, so I can't tell anything about the natives, but within the civilians the noble woman is the only one with such a large dds file.
    I guess so, too. I'm still trying to make units with as less polys as possible, but that is really the most unpleasing thing to do when converting units. :sad:
    Again: :goodjob: ;)
     
  7. King Commando

    King Commando Chieftain

    Joined:
    Nov 7, 2010
    Messages:
    98
    Location:
    charleston
    where do i download it to?:cry: ITS SO AWESOME and i don't know what to do with it!!!!!!!
     
  8. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Sorry, but you have to integrate these units into the game yourself. The download contains only the graphical files.
     
  9. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    I have uploaded my european units for Colonization. I recommend to use these units with Androrc the Orc's [MODCOMP]UnitArtStyles. I haven't tested if these units work in Civ4 as well, but they should. Buttons are included (for the europe screen too). All units only use one texture (except the horses of course) and have a normal polycount.

    Edit: The units will not work in Civ4. If you want use them in Civ4:Bts, you have to remove the SkinPartition with nifskope.
    See post #33 in this thread.

    This pack includes the following units for Spain, England, Durch, France and Portugal:
    All units have a normal and a veteran version.
    - infantries
    - dragoons
    - cuirassiers
    - light and heavy artillery

    Screenshots:

    Spoiler :






    But feel free to use them as you like.

    You will find the download link in the first post.

    Credits: I used some textures and helmet meshes from other mods.
     
  10. thecowwarrior

    thecowwarrior Warlord

    Joined:
    May 28, 2010
    Messages:
    204
    Gender:
    Male
    Location:
    USA
    I really like the European units complete pack, and was hoping they would work in BTS, but as you can see in this screenshot, the results are a bit odd. :eek: Is there an easy fix for this, or are the units just not compatible in BTS?



    BTW - I am using the default Civ4 cannon.kfm in the ArtDefines, as the one included made the game lock up, and there was no cannonier - not even his floating head. :) Other than the disembodied head though, the unit works fine.
     
  11. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Nice picture.:lol:
    I have absolutely no experience with adding new units to Civ4. Never did that. I have no clue what could be the problem. Therefore i have no idea if there is an easy way to fix this. If i find some time i will look into this during the next week.
    Have you tried some of the other units?

    And what's wrong with the swordman? Has this something to do with the cannon?
     
  12. thecowwarrior

    thecowwarrior Warlord

    Joined:
    May 28, 2010
    Messages:
    204
    Gender:
    Male
    Location:
    USA
    I have not tried other units, because I already had found replacements for them for my Mod. I might try one later to see if it works - I don't really like the French rifleman I had been using anyway. I'm not sure what you mean about the swordsman - there is nothing wrong with it. :confused:

    If you do find a solution for the cannon problem, I would be very grateful! :goodjob:
     
  13. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    i would guess that the SkinPartition causes the trouble - it´s honestly a small surprise for me that the unit work in Civ4Col - and still don´t know for sure why only the body doesn´t work. All parts of the unit have the same kind of SkinPartition - but perhaps the reason is the number of bones of the body mesh and therefore the real partition of this mesh.

    For Civ4Bts try to remove the SkinPartion (open the nif with nifskope, go to the NiTriShape [you could try only to do this only for the body - if there are still problems afterwards, try to do it for every riggged mesh in the model], expand the NiSkinInstance of the mesh, select the NiSkinPartition, delete [ctrl + del]) - the model should work after this procedure.

    Another option would be to make a bts shader model - for this you must create new shader SkinPartition for the mesh and add the other sader information to the NiTriShape
     
  14. thecowwarrior

    thecowwarrior Warlord

    Joined:
    May 28, 2010
    Messages:
    204
    Gender:
    Male
    Location:
    USA
    Well, I tried another unit, and here are the results. May I proudly present the bodyless riflemen of glorious France! :mischief:




    The_Coyote, thank you for the suggestions! However, editing graphics files is definitely not my forte, I'm sure I would just somehow make it worse. :lol: I'm a bit bummed out these won't work in BTS, but since they weren't designed to, I can't say I'm heartbroken or shocked. melcher kürzer - I love the leaderheads you make, several of them will be included in the next release of my mod, and thank you for making these great units too!
     
  15. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Quite the opposite. The units will crash Colonization without the SkinPartition entry.

    Didn't know the SkinPartion entry causes trouble in Civ4. Thanks for the hint!:goodjob:
    Then this should be pretty easy to fix.

    It's really easy. No skills are required, just nifskope.
    I could do that. But i have no time or wish to test them all in Civ4:Bts. And i will not release untested stuff.
    Sorry guys.

    Here is a version of the cannon without the SkinPartition. Please try if the unit works for you now.
    http://www.civforum.de/attachment.php?attachmentid=559193&d=1300199626
     
  16. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    Normally civ4 units would also have this SkinPartition - but at least for Civ4Bts the SkinPartition created for non shader units with the export script or Nifskope won´t work. Therefore the workaround is to remove the SkinPartition - which will have an negative impact at the performance - but at least the unit will work.

    So it seems that the engine changes between Civ4Bts and Civ4Col also fixed this problem - now the non shader SkinPartition will work - and is also required.

    One possible solution could be that you create shader meshes (which will cause trouble for people with older grafik cards - but it seems there is no "make everybody" happy solution) - the shader SkinPartition created with Nifskope will also work in Civ4Bts. It should also have an (but no idea how much) impact at the performance - a shader unit partition can have up to 16 bones, non shader partition up to 4 bones. Every partition is - if i understand the Firaxis tutorial correct - one object which must be drawn by the engine.
     
  17. thecowwarrior

    thecowwarrior Warlord

    Joined:
    May 28, 2010
    Messages:
    204
    Gender:
    Male
    Location:
    USA
  18. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Hi Melcher Kürzer,

    Your units are really great! I really like your bishop unit !

    I need your help. I would like to add Canoe units, but I'm bad at graphics.
    Actually I need two units, one with a native rowing inside, and one with a European style (maybe with a free colonist rowing instead of a native).

    It's meant to be a trade ship (0 power, should be instantly captured or destroyed) that can only sail on Coast plots.

    Could you help me?
     
  19. melcher kürzer

    melcher kürzer Explorer

    Joined:
    Aug 23, 2008
    Messages:
    172
    Location:
    Europe
    Hey!
    yes, i will help you. But only the oars will have animations, the person inside the canoe won't be animated.
    Should the european version also be a native american canoe or do you want a rowboat?
     
  20. Robert Surcouf

    Robert Surcouf Civ4Col Modder

    Joined:
    Feb 21, 2011
    Messages:
    665
    Location:
    France
    Hi Melcher kürzer,

    A native canoe will do...

    The person inside the canoe won't be animated? We will see him rowing yet?
     

Share This Page