[UNIT] Problem of sticky selection with new models

Tikumara

Chieftain
Joined
Dec 23, 2025
Messages
6
Hi!
If this thread already exists I apologize, I could not find mention of this issue.

I'm teaching myself how to export other games models into Civ4 by turning them into .OBJ, then putting them through the Blender 3.6 converter, and then into .NIF.
Over the past several months I've managed to get far enough that my animated models are able to run around the map, fight and otherwise act normally.

With one major exception, the unit targeting.
No matter what I try, the unit models always have a clickable radius ten or twenty times bigger then the model itself, and what's worse, the issue seems to come and go, just when I think I'v solved it, a player will complain of its return.
I'm pretty discouraged.

Could someone kindly tell me what property in Nifskope governs unit selection radius, what could be causing it, or even just how to disable unit targeting for the model altogether (as the little unit flag already has a selectable hitbox)
Il do my best to answer any questions.
 
Good work on getting so far already, not a small accomplishment by any means. :thumbsup:

As for the problem you are facing, could you post the CIV4ArtDefines_Units.xml entry of one or two examples? My suspicion is that you had to use a larger fScale value to adjust the size ingame and I think that value might inflate the "clickbox".
 
Good work on getting so far already, not a small accomplishment by any means. :thumbsup:

As for the problem you are facing, could you post the CIV4ArtDefines_Units.xml entry of one or two examples? My suspicion is that you had to use a larger fScale value to adjust the size ingame and I think that value might inflate the "clickbox".
Sure!
I've tried a few different sizes, both in nif and xml - so there are some smaller fscales and some larger and some huuuuuge

All of them still share an overly large clickbox.

These are all for the Ashes of Erebus mod:

- Seed Dragon is about 4X larger clickbox than the model:

<UnitArtInfo> <!-- UNIT_SEED_DRAGON -->
<Type>ART_DEF_UNIT_SEED_DRAGON</Type>
<Button>Art/Interface/Buttons/Units/seeddragonbutton.dds</Button>
<fScale>0.5</fScale>
<fInterfaceScale>0.4</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/animal/dragons/seeddragon/seeddragon.nif</NIF>
<KFM>Art/animations/dragon3/dragon.kfm</KFM>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/horseshadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Center</ShadowAttachNode>
<fShadowScale>2</fShadowScale>
</ShadowDef>
<fBattleDistance>1.2</fBattleDistance>
<fRangedDeathTime>0.35</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
<SelectionSound>AS3D_UN_DRAGON_BREATH_IN_SELECT</SelectionSound>
<ActionSound>AS3D_UN_DRAGON_ROAR</ActionSound>
</UnitArtInfo>

- Large Rat is about X3 larger clickbox than the model:

<UnitArtInfo> <!--big black Rat-->
<Type>ART_DEF_UNIT_BIG_BLACK_RAT</Type>
<Button>Art/Interface/Buttons/Units/ratty.dds</Button>
<fScale>9.36</fScale>
<fInterfaceScale>1.4</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/animal/rat/ratblack.nif</NIF>
<KFM>Art/animations/Wolf/Wolf.kfm</KFM>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/WolfShadow.nif</ShadowNIF>
<ShadowAttachNode>LionBip Spine</ShadowAttachNode>
<fShadowScale>0.0045</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>

- Now for a silly one, The Otoloch (eel), originally this creature had a 1.0 scale in .NIF and a 9.0 fscale in XML, this made the unit size roughly that of a ship... and it had a targeting scale of 300 tiles away!

To "fix" this, I made the nif model scale 0.1 and the fscale 100, so now it "only" has a clickbox of 7 tiles away from the model and is the size of a normal ship:

<UnitArtInfo> <!-- UNIT_OTOLOCH -->
<Type>ART_DEF_UNIT_OTOLOCH</Type>
<Button>Art/Interface/Buttons/Units/otolochbutton.dds</Button>
<fScale>100</fScale>
<fInterfaceScale>1</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/animal/otoloch/otolochv1.nif</NIF>
<KFM>Art/animations/maar2/maar.kfm</KFM>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/horseshadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Center</ShadowAttachNode>
<fShadowScale>0.005</fShadowScale>
</ShadowDef>
<fBattleDistance>1.2</fBattleDistance>
<fRangedDeathTime>0.35</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
<SelectionSound>AS3D_SEA_SERPENT</SelectionSound>
<ActionSound>AS3D_SEA_SERPENT</ActionSound>
</UnitArtInfo>
 
Okay, since you have similar problems with different fScale values, guess it has to do with something within the nif files. Could you post one, or best all three, of the units so I could have a look at them?
 
Hi Tikumara, Happy Holidays 🎅🏻☃️🎄and
Spoiler Welcome to the forum~!! :
:banana::band::banana:

I won't be able to take a look at your nifs until later, but I suspect that this is a Bounding Sphere issue.

clanky4 details it here:


I've experienced this sometimes when I convert assets from other games.

Congratulations on your formidable progress in modding! :goodjob:
 
Hi Tikumara, Happy Holidays 🎅🏻☃️🎄and
Spoiler Welcome to the forum~!! :
:banana::band::banana:

I won't be able to take a look at your nifs until later, but I suspect that this is a Bounding Sphere issue.

clanky4 details it here:


I've experienced this sometimes when I convert assets from other games.

Congratulations on your formidable progress in modding! :goodjob:
Hello, and thank you for the warm welcome. Your words are too kind!

Ah, yes, the Bounding Sphere, I remember learning that one with misery...

some of these NIFs had original bounding spheres of 900!
I think the Seed Dragon was hundreds of edits to clean that...(And I could have still missed one!)

It could still be the problem... In that thread, Clank4 mentions setting it to a value of 10.0, whereas I used a value of 1.0; perhaps going too low could have created its own problems?
When I still had issues with targeting, I also tried setting the bounding sphere offset to 1.0 as well.
I don't know what that did, but what it didn't do was help me, sadly.

Happy Holidays!
 
I can confirm that in my experience, this has always been a bounding sphere issue, and if it didn't work, you likely missed some - be sure to go through all bones in NiSkinData, as by the nature of the issue, even if you miss just one, you won't see any noticeable improvement (15 900-radius bounding spheres work roughly the same as one 900-radius, in practice). I can also reassure you that you can't really go too low - even setting it to 0 works ok, though I usually try to have it in the lower tens.

Happy holidays!
 
I can confirm that in my experience, this has always been a bounding sphere issue, and if it didn't work, you likely missed some - be sure to go through all bones in NiSkinData, as by the nature of the issue, even if you miss just one, you won't see any noticeable improvement (15 900-radius bounding spheres work roughly the same as one 900-radius, in practice). I can also reassure you that you can't really go too low - even setting it to 0 works ok, though I usually try to have it in the lower tens.

Happy holidays!
In the nifs I posted above, can you spot any wonkey or missed Bounding Spheres?

I feel as if I must be blind...
 
Hmmm... How did you animate the models? If you did it yourself, what I'd do in your place is I'd totally "nuke" the models by erasing their skins, and exporting to non-nif format, and then back to nif of Civ-4 friendly version, then animate from the get-go. While I didn't spot any wrong bounding spheres, my NifSkope threw an error when I tried doing a skin partition on the dragon, which means the problem may run a bit deeper than just wrong bounding spheres.
 
Hmmm... How did you animate the models? If you did it yourself, what I'd do in your place is I'd totally "nuke" the models by erasing their skins, and exporting to non-nif format, and then back to nif of Civ-4 friendly version, then animate from the get-go. While I didn't spot any wrong bounding spheres, my NifSkope threw an error when I tried doing a skin partition on the dragon, which means the problem may run a bit deeper than just wrong bounding spheres.
I went with exporting existing models (warrior, wolf, Acheron the Red) to Blender and then binding the new models to the armatures.
It came out with smoother animations than they had any right to, all things considered...

I will try a few ideas that have popped up from this thread, but the dreaded conclusion, coming closer by the day, is that the models are borked from something early in the conversion process, and will need to be redone from scratch.
Pain.

If anyone has any last-ditch effort ideas, I am all ears.
Beyond that, feel free to make use of the above NIFs in your own projects (if anyone wants them), even if they are a tad dysfunctional...


Oh, and have a fantastic New Year ^^
 
I went with exporting existing models (warrior, wolf, Acheron the Red) to Blender and then binding the new models to the armatures.
It came out with smoother animations than they had any right to, all things considered...

I will try a few ideas that have popped up from this thread, but the dreaded conclusion, coming closer by the day, is that the models are borked from something early in the conversion process, and will need to be redone from scratch.
Pain.

If anyone has any last-ditch effort ideas, I am all ears.
Beyond that, feel free to make use of the above NIFs in your own projects (if anyone wants them), even if they are a tad dysfunctional...


Oh, and have a fantastic New Year ^^
Yeah, I also tried some things, but the large clickbox persisted anyway. The only way I found to get it away is removing the model itself, for example, if you only leave the trees of the Seeddragon while removing the dragon itself, the clickbox seems to become normal sized.

I guess these units are direct export from Blender, right? If so, maybe going for a nifswap might solve the problem, at least as long as the original unit does not have the same problems as well. If you want to try nifswapping, this post might be a good start: https://forums.civfanatics.com/threads/modding-unit-in-blender-massive-noob.659297/#post-15798603

Anyhow, attached is a version of the Seeddragon I cleaned up a bit with reduced texture sizes which should help reducing the load onto the system a bit (if that is a problem you run into).

Good luck with you future efforts! Always nice to see that people still create stuff for this game. :)
 

Attachments

Back
Top Bottom