• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Issues with Female Characters and Officers: Frequency and Variety

Or change the group to the Same group as normal officers are picked from?
 
Normal officers are picked from a variety of groups (OFFIC_TYPE_*). Since they already work properly for females as well,
we don't really need a second source of female officers that does not work quite the way we want it. :wp

We should probably look into character model groups and where/how they are used some time anyway.
There is too much overlap. I want one group to serve one purposes.
If a character model can serve multiple purposes, it can be added to multiple groups.
 
Indeed there are only two female Mates: "9Tb" in general and "Daniell1" for pirates only.
So that does explain why you'd always get "9Tb" in encounters like those: There is simply no other model to choose from. :facepalm

I am removing female characters from that particular type of encounter for Beta 3.4.
 
First test result: there is certainly more variety in what women are wearing on the streets of Kingston. Blue "towngirl1" has returned, and some of the variants of "towngirl5" and "towngirl7" have also been sighted. No news on female officers yet, unless it's broken entirely. I went in and out of the tavern repeatedly and saw some officers; there isn't always an officer present at all, but all those I did see were male. Further searching, preferably after I've made it to another port, may give different results...
The fix for this does not appear to work in the "Spanish Main" period. While playing the "Bartolomeu" storyline, and also after starting a trial free play game in 1660, women are again limited to the original few types - "towngirl5", "towngirl7", "towngirl3_1". The fix has not been negated, the greater variety still show up in the "Napoleonic" period.
 
The fix for this does not appear to work in the "Spanish Main" period. While playing the "Bartolomeu" storyline, and also after starting a trial free play game in 1660, women are again limited to the original few types - "towngirl5", "towngirl7", "towngirl3_1". The fix has not been negated, the greater variety still show up in the "Napoleonic" period.
Wait, what? WHAT!?!? How can that be period-dependent?
I know it is possible to limit certain character models in certain time periods, as that has been applied to soldier and navy officer models.
However, that has ONLY been applied to those character models and not any of the towngirls from what I remember.

In what instances did you notice the lack of variety in character models? Many characters are generated in different parts of the code and are treated differently.
So are these the fixed town folk, random town folk, hireable officers, etc.?
 
Playing through "Hornblower", I saw a full variety of female character models wandering around as random citizens. Playing through "Bartolomeu", they're back to the old very limited set. As a test to see if (a) it's only the "Bartolomeu" storyline which has negated your fix and (b) it's not the result of something introduced in a recent update which negated the fix across all times, I tried starting a free play game as Nelson, wandered round Kingston and saw enough different types to conclude that the full variety still exists. Starting a free play game set in 1660 and wandering round Speightstown, I could only see the limited set.

Fixed town folk are still whatever models are assigned to them. This makes them very easy to identify in the "Spanish Main" period; if you see a "towngirl1" walking around, she's either a fixed resident or a story character such as Rachel Blacque. Officers in taverns are a completely different set, always have been, and appear not to be changed. However, mention of hireable officers does remind me that I noticed something odd in "Enc_Walker.c" which I'll report in a different thread...
 
So it's the Enc_walker type characters then, right?

I do know that those character models are related to the nation of the town you're in.
Speightstown is Portuguese in Early Explorers, but I think it is already back to normal English by The Spanish Main for Bartolomeu.
So that shouldn't be the case, which again means that this still makes absolutely no sense to me.

Why would it be period-dependent? Only town nationalities are period-dependent. The only models that are period-dependent don't apply here.
Though just to be ABSOLUTELY certain you could search "initModels.c" for "period". You should onlt find soldier and navy officers that way though.
 
Correct, Speightstown is English in "Spanish Main". Nevertheless, neither there (during the free play test) nor anywhere else in the archipelago (during "Bartolomeu") do I see any females other than "towngirl5", "towngirl7" and "towngirl3_1". Actually, that's not quite true; there are occasional appearances by a few others, and if you're really lucky you can hire these as officers, whereas the normal random female citizens can never be hired. Basically, female walkers in "Spanish Main" are exactly as I reported them here.

Your answer to that report was also that it's nation dependent and that there should be different costumes visible in towns of different nationalities. It wasn't, and in "Spanish Main" it still isn't; regardless of whether I'm in Speightstown, St. Pierre, San Juan, Sao Jorge or Kralendijk, I only see the same set of models.

You can try it for yourself easily enough. Start a free play game in 1660 and look at all the women. ;)
 
Just for the sake of it, can you have a look in Early Explorers? If it is wrong in The Spanish Main, surely it should be the same or worse there?

Did you start a new game just after starting up the game EXE itself or did you start a new game several times in a row?
There is a change that starting a game with one already in progress might have some weird effects here and there.
 
It can't be much worse unless female characters stop appearing entirely. ;) Which, at first, seemed to be the case when I started a new game in "Early Explorers" (right after launching PoTC, not after quitting a previous game). However, moving back and forth between two town locations soon turned up some female citizens, all the same types as usual. I also tried "Golden Age". Shortage of time prevented me from trying "Colonial Powers" and "Revolutions", so at the moment the only period in which I've seen other costumes is "Napoleonic".

How did you fix the problem before?
 
How did you fix the problem before?
I removed the FEMALE_OFFICER_PERCENTAGE code which I suspected to be the cause of this.
That code is still as gone as it was before. The only place it is still referenced is a part that should not in any way be related to the Enc_walkers if I recall.

If I recall, this problem was introduced in the same modpack version where the FEMALE_OFFICER_PERCENTAGE code was first introduced.
That is why I suspected this to be related.

This was OK in Beta 3.3 and Beta 3.4, right? And has only very recently crept back in somehow?

One thing that springs to mind is that I made a LOT of edits to PROGRAM\Models\initModels.c lately that are related to the Select Storyline interface.
Perhaps that affected the appearance of models? To test that, put the Beta 3.4 copy of that file back into Beta 3.5 and see if that returns things back to normal.
 
Putting "initModels.c" from Beta 3.4 into Beta 3.5 had no effect; the same limited set of female walkers were still there. But I've got an entire installation of Beta 3.4 on my hard drive, so I fired that up, started "Tales of a Sea Hawk", and about the first woman I saw right after getting of the ship was a "towngirl6" in the port area. I've never seen one of those in Beta 3.5 except as a permanent resident. I quit that, started Beta 3.5, started "Tales of a Sea Hawk" and wandered back and forth between the areas of Speightstown, where the usual limited set were present. Which incidentally means that "Colonial Powers" is also affected.

You said that the available costumes are supposed to depend on which nation owns the town you're in. Where is the code which chooses costumes based on nation? I'd be interested to check that and see if it's broken.
 
So it was all good in Beta 3.4 and got bugged AGAIN in Beta 3.5 for some bizarre reason. Quite weird, since I don't remember any related code being touched at all.
You can search through the PROGRAM folder for "Enc_walker_dialog.c" (or whatever the name was) which should hopefully point you to where those characters are generated.
Somewhere close to that should be the function that chooses character models.
 
What is the significance in "initModels.c"of lines containing "AssignModelTypeNatMask"? Several characters in that file have such lines, e.g.:
"Diz2" has "AssignModelTypeNatMask(isstart, model, "Rich_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl1" has "AssignModelTypeNatMask(isstart, model, "Upper_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl3" has "AssignModelTypeNatMask(isstart, model, "Middle_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl6" has "AssignModelTypeNatMask(isstart, model, "Lower_Citizens", 1.0, GetNationStringNorthEuroFr());"

And they're the ones which never show up. Basically, if a model has one of these "AssignModelTypeNatMask" lines in its description then you never see that model.

The main file which seems to deal with encounters is "PROGRAM\LandEncounters\LEnc_Monsters.c". In there is a function "void Random_citizens_group(int bmax, int nation)", which only appears to cater for "UPPER" and "RICH" citizens (there's a block of code appearing to deal with "POOR", "LOWER" and "MIDDLE" which seems to have been commented out). There must be something else handling other citizens because I've definitely seen "POOR", "LOWER" and "MIDDLE" citizens around.
 
What is the significance in "initModels.c"of lines containing "AssignModelTypeNatMask"? Several characters in that file have such lines, e.g.:
"Diz2" has "AssignModelTypeNatMask(isstart, model, "Rich_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl1" has "AssignModelTypeNatMask(isstart, model, "Upper_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl3" has "AssignModelTypeNatMask(isstart, model, "Middle_Citizens", 1.0, GetNationStringNorthEuroFr());"
"towngirl6" has "AssignModelTypeNatMask(isstart, model, "Lower_Citizens", 1.0, GetNationStringNorthEuroFr());"

And they're the ones which never show up. Basically, if a model has one of these "AssignModelTypeNatMask" lines in its description then you never see that model.
AssignModelTypeNatMask is a function that enabled models to be used by a specific set of nations as defined by a "mask".
Normally you may define ENGLAND or HOLLAND, which technically correspond to numerical values.
But GetNationStringNorthEuroFr() returns a "mask" like 110100 which means "yes for England, yes for Holland, no for France", etc.
This refers also to the nation numbers defined in PROGRAM\globals.c . That is what I understood of it anyway.

It worked normally in Beta 3.4 though, right? So the problem would need to be in something model-related, nation-related or perhaps confusion due to the initialization order.
I think.... :confused:

The main file which seems to deal with encounters is "PROGRAM\LandEncounters\LEnc_Monsters.c". In there is a function "void Random_citizens_group(int bmax, int nation)", which only appears to cater for "UPPER" and "RICH" citizens (there's a block of code appearing to deal with "POOR", "LOWER" and "MIDDLE" which seems to have been commented out). There must be something else handling other citizens because I've definitely seen "POOR", "LOWER" and "MIDDLE" citizens around.
There is code generating characters all over the place. But I can't remember by the top of my head what is where.
 
Issue reopened and moved to the main Bug Tracker again.

AssignModelTypeNatMask is applied to a lot of character models that aren't female as well.
Do those also not show up?

I think the relevant file is PROGRAM\Loc_ai\LAi_monsters.c, specifically the LAi_MonsterLogin function.
That function calls GetRandomModelForTypeExSubCheck to get a random model.
It later continues with the LEnc_MonstersLoginCorrectParams from PROGRAM\LandEncounters\LEnc_Monsters.c and which contains the "Enc_walker.c" assignment.

GetRandomModelForTypeExSubCheck which is in PROGRAM\Models\models.c along with most other model-related functionality.
There is all sorts of year-related stuff there, which I didn't know about.
I'm pretty sure that is completely independent from the periods stuff and was written many, MANY years earlier.
We might as well remove all references to that because it should not actually serve any purpose.
 
What I did was remove a lot of "AssignModelTypeNatMask(isstart, model, "Upper_Citizens", 1.0, GetNationStringNorthEuroFr());" lines, replacing them with "AssignModelType(isstart, model, "Upper_Citizens", 1.0);" as that's what I'd found on similar models which do appear. Then I started a new Free Play game as a French sailor so that I am at St. Pierre, which has adjacent locations with lots of random civilians, and did indeed see some of both the previously missing male and female types.

Lines like "AssignModelTypeNatMask(isstart, model, "Rich_Citizens", 1.0, GetNationStringNot(PIRATE));" i.e. containing something like "GetNationStringNot" or "BitNot", don't seem to prevent a model from appearing, so I left those alone.

You can try your luck with this.
 

Attachments

  • initModels.zip
    43.4 KB · Views: 100
So which lines DO cause the problem now? Just the GetNationStringNorthEuroFr ones?
 
Definitely those. Possibly "GetNationStringNorthEuro" and "GetNationStringSouthEuro" as well.
 
With Nelson as starting character, I just encountered an "OldWoman" as Enc_walker in Kingston town.
If I understand you correctly, that doesn't happen for you anymore at all, does it?

I also repeatedly executed this console command:
Code:
LogIt("Model = " + GetRandomModelForTypeExSubCheck(-1, "Rich_Citizens", "woman", ENGLAND));
That returned quite a wide variety of female character models, including "Diz2" with only AssignModelTypeNatMask and GetNationStringNorthEuroFr applied to her.

Additionally, I made some extra changes in LAi_monsters.c to test this:
Code:
  if(GetModelindex(ainfo.model) == -1)
   {
     trace("Gauging: model not exist, assuming type.");
     DumpAttributes(ainfo);
     ainfo.model = GetRandomModelForTypeExSubCheck(sti(ainfo.iscombat), ainfo.model, ainfo.sex, sti(ainfo.nation));
     trace("Gauging: Found model " + ainfo.model);
   }
With this, I get stuff like this in compile.log:
Code:
Gauging: model not exist, assuming type.
model = Vagabonds
ani = man
type = town
sex =
nation = 266
iscombat = -1
current = vagabond
Gauging: Found model dan_tg3
Equip Character Nadine with blade48+2 his nation: 0 blade nation=
A bit surprising that the encounter requests "man" but gets a female character anyway, but we do want that so that isn't a problem.
The nation of 266 is also quite strange because the nation numbers are in range 0-6 .
I also cannot find where that "ainfo" actually gets a "nation" attribute and where that might get set to 266.
This might be linked to "LAi_MonsterInfo", but I don't see where that gets its nation set either.

And using this through console somehow does give a wide variation of models, but also returns male ones despite me specifying women:
Code:
LogIt("Model = " + GetRandomModelForTypeExSubCheck(-1, "Vagabonds", "woman", 266));
So I don't see a problem with variety, but I do admit that the behaviour of this code is a quite mysterious.

But for now I haven't actually been able to replicate the problem. Could you please remove your "options" file and try again on a new game?
Then if it still happens, please tell me your exact game starting settings and possible custom options so that I can try to replicate it.
 
Back
Top