• 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!

High Priority Updating the Character Model Groups

I don't particularly want to do any substantial changes to the code for this.
Though I was thinking of rewriting the function call to get a model for random citizens to have a chance-based switch based on town wealth.
After all, there are groups of citizens that are Poor, Normal and Rich but I'm not at all sure if they're actually used like that.
As far as I could tell, the game just selects a random model out of all relevant groups based on the chances defined at the top of initModels.c .
Or they may be restricted to certain areas of town, e.g. Poor folks could show up in areas labelled "Slum" while rich folks could show up in "Trade centre".
That is true. Not sure how bad that problem would be. Depends of course on how many models are in each nation group.
If there are enough models, there will still be variety within the town, but it'll also be clearly different from the other nations.
It's bad enough already. I really don't want to make it worse. Short of someone creating a whole load of new civilian models, the current system in which most models can be used everywhere and a few are region-specific gives a reasonable balance of variety within a town versus difference between towns.
Fair enough. It is actually possible to set any model to appear only within certain periods.
The model.period lines applied to the soldiers should work just as well for civilians. Do you think we have any non-soldier models in the game that don't look like they belong in certain time periods?
The noblemen with ruffs (don't know their model names) should perhaps be restricted to the first two periods. Beyond that, I'm not an expert on 16th-19th century fashion. :D
The fixed town folk will of course remain themselves and the "Enc_walkers" will switch their nationality to the new "location nation".
Those characters are newly generated upon each location reload.
And that brings up another point. Fixed residents don't take any notice of nation masks, so there's little point in restricting a model to NorthEuro or SouthEuro if it's going to appear in both anyway. For which reason I'm seriously inclined to remove the nation mask from "towngirl1", who appears as a fixed resident in at least one town of every nation. Maybe apply the mask to "towngirl1_1" instead, unless I find one of them as a fixed resident in a Spanish town.
 
Or they may be restricted to certain areas of town, e.g. Poor folks could show up in areas labelled "Slum" while rich folks could show up in "Trade centre".
Possible. We'd have to add an attribute to the location then to indicate if it is a rich/poor one.

The noblemen with ruffs (don't know their model names) should perhaps be restricted to the first two periods. Beyond that, I'm not an expert on 16th-19th century fashion. :D
Fair enough. Feel free to add the relevant model.period line to those characters then. :doff

And that brings up another point. Fixed town folk take no notice of these nation masks. "Towngirl1", who as an "Enc_walker" is supposed to be restricted to "NorthEuroFr" (and who I still haven't seen as an "Enc_walker"!) is also a fixed resident in several towns, including Speightstown, Kralendijk, St. Pierre, San Juan and Sao Jorge - in other words, she shows up in all nationalities. (For which reason I'm seriously inclined to remove her nation mask. Maybe apply it to towngirl1_1 instead, unless I find any of those wandering around Spanish towns as permanent residents.)
Either that or we just use a different model in the character init files where she isn't appropriate.
I wonder if perhaps we can have those characters assigned a random model altogether. Then we wouldn't need to worry about it anymore.

I was also thinking of having the game automatically generate an on-screen log message for the appearance of one specific testing model.
Then even if you don't see her yourself, if she's generated in the location, the game will tell you.
 
Possible. We'd have to add an attribute to the location then to indicate if it is a rich/poor one.
I mentioned it only because I thought that was what the poor/rich/upper designation was already being used for. ;)
Fair enough. Feel free to add the relevant model.period line to those characters then. :doff
Except that, as I said, I don't know which models they are...
Either that or we just use a different model in the character init files where she isn't appropriate.
I wonder if perhaps we can have those characters assigned a random model altogether. Then we wouldn't need to worry about it anymore.
What's this "we" business? xD I wasn't worried about it anyway - as I said, my solution was just to remove the nation restriction on that model and maybe add it to her grey-suited counterpart instead.
I was also thinking of having the game automatically generate an on-screen log message for the appearance of one specific testing model.
Then even if you don't see her yourself, if she's generated in the location, the game will tell you.
That could be useful because if the game tries to place the model and I don't see it, the conclusion may be that it's failing to place the model for some reason. This may be why nation-restricted models are rare...
 
In that case I'll leave it up to you. Anything you do want to update, you are welcome to do.
Anything else, well, at least it won't be worse than it is now. I suppose I should try to NOT think of so many new things to improve on. :facepalm

That could be useful because if the game tries to place the model and I don't see it, the conclusion may be that it's failing to place the model for some reason. This may be why nation-restricted models are rare...
Find this line in LAi_monsters.c:
Code:
ainfo.model = GetRandomModelForTypeExSubCheck(sti(ainfo.iscombat), ainfo.model, ainfo.sex, GetCurrentLocationNation());
Below this, add:
Code:
if(ainfo.model == "towngirl1) TraceAndLog("LAi_monsters: Model " + ainfo.model + " generated for nation" + GetNationDescrByType(GetCurrentLocationNation()));
I'm writing from memory again so this might be slighly off.
Specifically, I don't remember the correct function name for GetNationDescrByType but I think it was something like that.

With this in place, you can just play the game and then search compile.log afterwards for "LAi_monsters" to find out if you encountered the model or not.
This might also help with the test you suggested here: http://www.piratesahoy.net/threads/updating-the-character-model-groups.24595/page-2#post-508042
How about we actually do that and add a note in the message to report this at our forums.
Then we'd have more people testing this and therefore a higher chance of figuring out what does and doesn't work.
 
Specifically, I don't remember the correct function name for GetNationDescrByType but I think it was something like that.

Pretty damn close

GetNationDescByType( ) just without the "r".

Just reading this thread to try and get my head round it - off to look at initModels.c etc now
 
It doesn't work, then. "towngirl7" has that set, routinely carries weapons unless it's a fixed resident, and was one of those who tried to claim the bounty on me after the "Wanted" poster went up in Havana. In fact, one way to tell if a civilian is a fixed resident or a random walker is that fixed residents almost never have weapons (though there are one or two of them in St. Pierre who do). Random walkers always have weapons and none of them are enemies unless you do something to provoke them, e.g. attack one of them or wander into a port where your face is plastered on the wall. :rpirate
 
True on all accounts. I'm not sure when the iscombat attribute is and isn't checked, though.
When I checked for random town folk, the ainfo.iscombat used was -1 which means that ANY model can be chosen regardless of that setting.

I think this doesn't control whether a model actually GETS weapons (they pretty much always do), but whether that model can be generated as an enemy.
Of course you can make any model an enemy in the ways you described.
 
Here it is. Any references to "GetNationStringNorthEuro" or "GetNationStringNorthEuroFr" which apply to a character whose nation is "SPAIN" or "PORTUGAL" are now replaced by "GetNationStringSouthEuro". Additionally, "liz2", who has darker skin and hair than "liz1", is also now "SouthEuro" (despite being nation "PIRATE", which makes me wonder what Arthur Wellesley's sister in "Hornblower" has been doing xD). I tested it by starting a new free play game as a Spanish sailor, which puts me in San Juan, a good place for spotting random Spanish civilians as the trade centre is adjacent to the port. In due time one of the models which I'd changed to be "GetNationStringSouthEuro" showed up.
YIKES! That is still based on the old copy of initModels.c; there are 770 differences with the version from my latest ZIP.
Any chance you could make your changes to the new files as it would take quite a bit of tracking down to find them between all those changes for me. :facepalm
 
Yes, I guessed as much when I failed to find Michiel de Ruyter. :oops:

This one is based on what I found in the 27th May zip update, and has a few additional tweaks beyond what I added to the previous one. For one thing, the experiment with adding all the nations as single "GetNationString" lines was successful - I put a line for each nation into the definition for "towngirl7", with Spain last, then had a walk round St. Pierre and Speightstown and found her in both. So she has her original definition back, and I've added "GetNationString(PIRATE)" lines to all the "downgirl" models. Also, a few whose descriptions mention "Elizabethan collar and frills" now have "model.period" lines restricting them to the earliest two periods.
 

Attachments

  • initModels.zip
    44 KB · Views: 225
Whats the status on this?
 
Some work has been done on it, but not yet enough. My code change to the models used for the smugglers was actually a part of this.
Other main things to be done:
- Rewrite boardermodel code to no longer refer to the nations_init.c definition for soldier models (should be relatively easy)
- Modify the Sailor groups so that player sailors and non-player sailors use distinctly different models
 
I also wanna add that I'm planning on doing this:

Making the appearce of enc walker in towns dependend on the economy of the town. There is some code in place already for this I believe. But its not working well I believe ...
 
Making the appearce of enc walker in towns dependend on the economy of the town. There is some code in place already for this I believe. But its not working well I believe ...
I'm not aware of the Poor/Rich model groups actually being used as such. Would indeed be nice if they were. :yes
 
Please, no. It's already bad enough that some models are restricted by nation. If they're restricted much more then we're going to end up with only one or two male models and one or two female models per town, which means different towns will look different to each other but people within a town will look even more like clones than they do now...
 
Uhm. It will actually allow more models to be used... They're already set but aren't used atm.
 
They are all the same now while there are more set but not used for this. They might be used in other cases.
 
Back
Top