CIV4 unit model vertex limit

God created addblock to save me from image memes.
Also could we maybe not spam up the guys thread? I am trying to give him genuine and useful advice to welcome into the modding community.
 
The thing is I am using a poly reduced script on blender, I'd like something more specific to immediately reduce the poly count to the bare minimum, I bet the model in my OP got like 35k vertex worth of unnecessary details. I will try to remove all unnecessary details next time, I can manually delete parts in edit mode with the vertex select but for now I want a 100% working mecha unit in game , the one I posted weeks ago is like ...95% working because of the occasional invisible frame glitch

Ok, yeah your model seem like a particular difficult one to just simplify by deleting parts, I use 3ds Max for all the model editing so don't know how simple the process is in Blender.
 
God created addblock to save me from image memes.
Also could we maybe not spam up the guys thread? I am trying to give him genuine and useful advice to welcome into the modding community.

Cheers!

On another issue now,,,I have isolated the "invisible 1/2s frame glitch" for my first model : I have deleted attack 2 from the folder and the KFM file, then tested in game and..the glitch is gone, it would appear that the glitch was caused by the transition from attack 1 to attack 2 and I can't understand why.

I have used 21 frames starting at 1st frame in both case ofc in the fortity position , animation starting around 5-6 frame with the full animation on the 10th frame mark then slowly going back to the fortify position precisely on frame 21, I didn't miss a single frame thx to the 100% zoom so I can't explain the 1s frame disappearance when transitioning from attack 1 to attack 2.

Both animations were done correctly, they do work in game so...it's just this annoying error that I can't figure it out ..ha I am using eventcode Rangedstrike for attack1 and I have used 2032 eventcode for attack2...dunno
 
Cheers!

On another issue now,,,I have isolated the "invisible 1/2s frame glitch" for my first model : I have deleted attack 2 from the folder and the KFM file, then tested in game and..the glitch is gone, it would appear that the glitch was caused by the transition from attack 1 to attack 2 and I can't understand why.

I have used 21 frames starting at 1st frame in both case ofc in the fortity position , animation starting around 5-6 frame with the full animation on the 10th frame mark then slowly going back to the fortify position precisely on frame 21, I didn't miss a single frame thx to the 100% zoom so I can't explain the 1s frame disappearance when transitioning from attack 1 to attack 2.

Both animations were done correctly, they do work in game so...it's just this annoying error that I can't figure it out ..ha I am using eventcode Rangedstrike for attack1 and I have used 2032 eventcode for attack2...dunno
Since each keyframe for a bone can consist of Rotations, Translations and Scales, it might be that for some reason one of these is not defined in the first keyframe, but in one of the later. Since defining already one of the three creates a "diamond", I never figured out how to check these seperately in Blender. Might be a good idea to find out how, but I normally check these with NifSkope by opening the kf file and checking the NiTransformData of each NiTransformInterpolator.

Here you will have to check the first and last Quaternion Keys within "Quaternion Keys" and the first and last Keys within "Translations->Keys". The Time of the first keys should be 0.0000, the last one equal to the Stop Time of the animation. For Scales, you can normally just set the Num Keys value to 0 and refresh, unless you deliberately have set up some size changes of that bone.

Alternatively you could also try within Blender to "copy pose -> paste pose" on the first first and last frame. That might also already fix things.
 
Cheers!

On another issue now,,,I have isolated the "invisible 1/2s frame glitch" for my first model : I have deleted attack 2 from the folder and the KFM file, then tested in game and..the glitch is gone, it would appear that the glitch was caused by the transition from attack 1 to attack 2 and I can't understand why.

I have used 21 frames starting at 1st frame in both case ofc in the fortity position , animation starting around 5-6 frame with the full animation on the 10th frame mark then slowly going back to the fortify position precisely on frame 21, I didn't miss a single frame thx to the 100% zoom so I can't explain the 1s frame disappearance when transitioning from attack 1 to attack 2.

Both animations were done correctly, they do work in game so...it's just this annoying error that I can't figure it out ..ha I am using eventcode Rangedstrike for attack1 and I have used 2032 eventcode for attack2...dunno
How are you even transitioning from attack 1 to attack 2? You should be going Attack 1 -> Fortify 2 -> Attack 2. Or was that FortifyIdle. Not sure off the top of my head. But the point is there should be something in between as far as I recall.
 
How are you even transitioning from attack 1 to attack 2? You should be going Attack 1 -> Fortify 2 -> Attack 2. Or was that FortifyIdle. Not sure off the top of my head. But the point is there should be something in between as far as I recall.
For example, for a vanilla animation with two melee attacks it would be:

md_fortifya_idle -> md_strikea -> md_fortifyb_idle -> md_strikeb -> md_fortifya_idle

But I think if there is no md_fortifyb_idle, it will automatically reset to md_fortifya_idle or just freeze the model until a new animation is triggered. It should not turn the model invisible.
 
Don't forget the hurt animation. The game will usually go to that rather than the fortify idle at least once during combat. Assuming there is one.

Gearbolt, out of curiosity could you upload the model for us to look at?
 
Actually from what I've gathered FortifyIdle is the inbetween animation that runs after each attack be it a hurt or a strike. So like you might get StrikeA -> FortifyIdleB -> StrikeB -> FortifyIdleA -> Hurt etc.
 
FortifyIdle is just the idle animation the unit shows if it is not doing anything else (like strike, hurt, die) while being in fortified modus. It is also the animation the unit has if it is fortified on the map without being in combat.

A hurt animation is optional by the way. A number of units that have both ranged and melee animation do not have a ranged_hurt animation.
 
I made a simplified version of the Gundam


I noticed several bones have different rotations/translations in there initial settings, but are different in the quaternion and translation data. Like Sabolieh already mentioned. For most of the animations the arms and the R Deltiod are the only bones that move. The R Deltoid is the one I checked. It is really tedious the go through things in nifskope. Like Sabotleih said it might just be easier to fix things in blender, and re-export.

I noticed the walk animations end at .8 rather than .667 like the assalt-mech is set. So, I tried setting the end frame at 17, or .667ish. That at least stopped the glitch with walking.
 

Attachments

  • SimpleGundam.rar
    117.2 KB · Views: 39
Ok, yeah your model seem like a particular difficult one to just simplify by deleting parts, I use 3ds Max for all the model editing so don't know how simple the process is in Blender.
Yes too complex for an amateour like me to replicate from scratch in low poly, it would be easier but still too diffucult atm; the frame of the mech is made in a way that any removed part would invalidate the whole model...like it wouldn't make sense for it to move at all.

LIke if I'd remove anything from the joints , the whole model should not be able to walk in a logical sense
I made a simplified version of the Gundam


I noticed several bones have different rotations/translations in there initial settings, but are different in the quaternion and translation data. Like Sabolieh already mentioned. For most of the animations the arms and the R Deltiod are the only bones that move. The R Deltoid is the one I checked. It is really tedious the go through things in nifskope. Like Sabotleih said it might just be easier to fix things in blender, and re-export.

I noticed the walk animations end at .8 rather than .667 like the assalt-mech is set. So, I tried setting the end frame at 17, or .667ish. That at least stopped the glitch with walking.

Between CTLR+Z and clear transform is possible that one bone was left at a different angle than the starting position, tried to be as precise as possible, will pay more attention next time. Regarding the walk animation : I have used 20 frame limit
WALK.png


Yes I noticed that the animation was 8 when it should have been .667 ( 20*0.0333) but I wasn't getting errors or glitch so I asssumed it was fine regardless, about the translation glitch as explained before, I simply removed attack 2 for testing and that solved the problem
I am currently playing with the Gundam unit using only one attack ( attack 2 changed to attack1), all working fine.

I will use a ground bone as source for my new model, then will use the paste/copy pose as suggested by @SaibotLieh , that should solve all the occasional bone rotations errors

Cheers!
 

Attachments

  • Fenrir.zip
    552.9 KB · Views: 42
How are you even transitioning from attack 1 to attack 2? You should be going Attack 1 -> Fortify 2 -> Attack 2. Or was that FortifyIdle. Not sure off the top of my head. But the point is there should be something in between as far as I recall.

Yeah, my attack animations start and end in the fortify position, I have misspoken , the issue was between attack1 -> fortity -> attack2 , there was a mishaped frame somewhere there and only lasting 1/2s, during that time my model would turn invisible , indicating missing frame
 
I've been exporting KFs and testing in game for a couple days for a project I'm working on. Mostly to determine why blender exported kfs are always so glitchy. There are two main things I've seen cause them so far.

First, Blender always sets the "Cycle" to "CYCLE_CLAMP". This is a problem for the animations that loop like "Run","Idle", and "FortifyIdle". Simple enough to fix. Just go in nifskope and set them to "CYCLE_LOOP".

The main problem is Blender always sets the last Key Frame the same as the first. It will not allow you to change it. This is a problem for animations that DON'T Loop. So far, I've just manually changed them in nifskope, but it's so freaking tedious. I said "There HAS to be another way!".
Then I read this post from a more civilized age:

https://forums.civfanatics.com/threads/animation-mess-up.497028/

The very clever Coyote found a work around. Counter intuitively, the solution is not to set the end frame where the animation ends like common sense would indicate(and I suggested earlier). No, the solution is to copy the last keyframe, and paste yet another onto the end. Then, set THAT one as the animation end frame.
Will that work?! Yes, it does. Weird.
 

Attachments

  • Coyote_Workaround.jpg
    Coyote_Workaround.jpg
    64 KB · Views: 194
I haven't hit a vertex limit yet. I've successfully imported up to 120k faces into Civ 4. That's overkill though as that amount of faces actually looks bad in game. The most I've kept I believe is around 27k. The main limiting factor for me has been texture size. I almost always have a CTD with 4096x4096. This also isn't needed since that texture size looks bad in game as well. For unique units I tend to stay at around 10k faces max and 1024x1024 textures. Unlimited units I try to keep around 2k faces or less and 512x512.
 
512 is a lot for a single unit. Regular CIV4 units are either 128 or occasionally 256. Remember that as you double texture dimensions the memory footprint goes up by a factor of 4. And it's no surprise that 4096 crashes. Remember all textures are bitmaps in memory and whilst a 128 x 128 is going to be well under a megabyte in memory 4096x4096 takes up something in the region of 50 MB.
 
I’ve only used 4096x4096 when I forget to scale down the texture after converting the Skyrim asset. Sometimes Civ will load the asset, but it seems to do that when not using the bump map. My guess would be Civ can’t use past a gig or so of ram. There’s not really a reason to go above 1024. There starts to be a noticeable difference between 512 and 256. At least with models that have couple thousand faces. Models with lower faces don’t need a large texture.
 
I’ve only used 4096x4096 when I forget to scale down the texture after converting the Skyrim asset. Sometimes Civ will load the asset, but it seems to do that when not using the bump map. My guess would be Civ can’t use past a gig or so of ram. There’s not really a reason to go above 1024. There starts to be a noticeable difference between 512 and 256. At least with models that have couple thousand faces. Models with lower faces don’t need a large texture.
The limit is 2GB on account of the fact that it's a 32 bit windows program and that was the limit 32 bit Windows would give to an application. The reasons for this are technical in nature and revolve around performance. And they actually make a lot of sense when you remember it's 1993 and your pc only really has to worry about such memory hogs as Civilization I and the original DOOM.

It sort of didn't age well but I didn't either and I am not that much older.
 
Last edited:
Top Bottom