(unit) Art for all eras

Nightinggale

Deity
Joined
Feb 2, 2009
Messages
5,279
Multiple people requested using more Art for units than the vanilla early/middle/late setup. I wrote this modcomp to meet the demand. It is able to set art for each era and can be controlled 100% from XML.

Download link: https://sourceforge.net/projects/civ4-modcomps-by-nightinggale/files/ModComps/Art%20for%20all%20eras/ (includes a precompiled DLL)
GIT: https://sourceforge.net/p/civ4-modcomps-by-nightinggale/code/ci/master/tree/

Important notice: when starting a custom game in a certain era, it actually starts in one era earlier. For instance starting in ERA_FUTURE will start in ERA_MODERN and you would actually have to get one more tech to enter the future. Use worldbuilder's feature to get all techs from an era to set the era rather than starting era to test setup when using this modcomp.

Readme said:
Art for all eras

This modcomp allows specifying unit art for each era, rather than just early/middle/late provided by vanilla. The number of eras can be set in Civ4EraInfo.xml and will not require recompiling the DLL. There is a minimum of 1 era and no upper limit.

To make adapting this modcomp easier, the DLL can be used without any changes to the XML files. However no changes to the XML files mean no change ingame. Still it allows to adapt the DLL and then add art for one unit at a time and the game will never have a fail to start moment during the "conversion". It also mean it is possible to completely ignore units you don't plan to add more art for.


Usage:
Civ4UnitInfos.xml

The UnitMeshGroup now looks like this:
PHP:
<UnitMeshGroup>
	<iRequired>1</iRequired>
	<EarlyArtDefineTag>ART_DEF_UNIT_WARLORD_ANCIENT</EarlyArtDefineTag>
	<LateArtDefineTag>ART_DEF_UNIT_WARLORD_MODERN</LateArtDefineTag>
	<MiddleArtDefineTag>ART_DEF_UNIT_WARLORD_MEDIEVAL</MiddleArtDefineTag>
	<ArtForEras>
		<ArtForEra>
			<Era>ERA_MEDIEVAL</Era>
			<ArtDefineTag>SOME_ART_TAG</ArtDefineTag>
		</ArtForEra>
		<ArtForEra>
			<Era>ERA_FUTURE</Era>
			<ArtDefineTag>ANOTHER_ART_TAG</ArtDefineTag>
		</ArtForEra>
	</ArtForEras>
</UnitMeshGroup>

Everything after EarlyArtDefineTag is optional, though content of ArtForEra isn't. Any number of ArtForEra can be added as long as it doesn't exceed the number of eras.

What happens is a list is generated with the content from ArtForEras.
EarlyArtDefineTag overwrites the first era.
LateArtDefineTag overwrites the era half way through the game +1.
MiddleArtDefineTag overwrites 1/4 through the game+1.

If an era isn't mentioned, the art from the previous era will be used. This mean if art is set for ancient and nothing else, then that one will be used in all eras.

It isn't recommended to use MiddleArtDefineTag and LateArtDefineTag because rounding makes it a bit difficult to precisely determine when they activate. Add more ArtForEra instead for complete control. Again the vanilla tags are only kept to prevent breaking the ability to load vanilla XML files.

CIV4UnitArtStyleTypeInfos.xml
This file can overwrite what is written in UnitInfo and allows to give different styles to different civilizations (just like in vanilla).
The xml setup is more or less identical. ArtForEras is added after MiddleArtDefineTag.

Differences:
-EarlyArtDefineTag is optional
-Blank art string will make the unit use the default art from UnitInfo
-Default is blank (use UnitInfo)

Example:
ERA_CLASSICAL is set to some custom art
ERA_RENAISSANCE is set to blank
Nothing else

The result is a style, which has custom art in ERA_CLASSICAL and ERA_MEDIEVAL and will use the default art in all other eras.


Python:
The vanilla python interface is preserved for compatibility and a new function is added to access art from all eras.
getArtDefineTag (int i, UnitArtStyleTypes eStyle, EraTypes eEra)
It works like getEarlyArtDefineTag, except art for all eras can be reached.
 
Question. If Early, Middle and Late art tags(as in standard xml files) are used, with this modcomp will the game use that art as before when the middle and late eras turn up as long as a specific era is not mentioned?

Just asking because I have a lot of custom art, but some units(like the great general) simply look very strange with the standard art setup, with a medieval armored general in the Enlightenment for example.

Could I specify specific art for the great general, but leave other units alone?
 
Could I specify specific art for the great general, but leave other units alone?
Short answer: yes. All units should behave normally unless you touch them. If you notice a unit behaving differently, then please report back as that would be a bug.

Long answer:
From a coding point of view, it would make sense to remove middle and late art tags. However considering this is for each figure in each unit and there are plenty of ArtStyles too, the amount of xml entires to edit would be way more than most people would like to touch. Because of this, I decided to keep the tags and write code to "convert" them into the new system at runtime. The result is the ability to use both the new and the old system in xml and no edits are needed to make the files work. I would highly recommend not using middle/late tags when entering new units because writing the specific era is more readable and can adapt to adding eras as well.

The intended usage is to add more tags for just one unit and then play with that because there is always a first one. You can add more later if you like and you can use it on just one. It's entirely up to you.
 
Top Bottom