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

Discussion Some of the general feedbacks

So for @Grey Roger's attention: here is some stuff of mine for you to look at. :doff

Main change: all relevant '32' numbers were recoded to use the #define @konradk apparently already started adding for that purpose.
Unfortunately this only served to prove once and for all that we cannot get around this one.
So we might as well leave them fixed as 32, then. ;)

Perhaps go the other way, change anything which uses "MAX_LOGINED_CHARACTERS_IN_LOCATION" to 32 and then remove the variable definition? That could discourage anyone else from trying to change the variable and mess up the game.
 
So we might as well leave them fixed as 32, then. ;)

Perhaps go the other way, change anything which uses "MAX_LOGINED_CHARACTERS_IN_LOCATION" to 32 and then remove the variable definition? That could discourage anyone else from trying to change the variable and mess up the game.
It's cleaner to do use the variable. And then have that variable at 32, of course.
If ever a higher number does become possible (unlikely, I admit; but you never do know), then at least the code will already be prepared for it.
Plus, if anyone ever wonders about it, it's a quick test to find out it doesn't work.

If people want to mess up their game for a bit, that's not our responsibility.
I don't consider that risk a good reason to have messy code.
These numbers ideally never should've been hardcoded in the first place.
Hardcoding is... YUCK! :sick
 
I'm always nervous when someone tries to change code just because they don't like the programming style (even though I've been guilty of it myself, my pet hate being bad indentation and alignment). It's led to bugs being introduced in the past. On first examination, though, this seems harmless enough.

On second examination, no. In "LAi_monsters.c", this...
Code:
int maxMonsters = 20 - LAi_numloginedcharacters;
... becomes this...
Code:
int maxMonsters = MAX_LOGINED_CHARACTERS_IN_LOCATION-12 - LAi_numloginedcharacters;
Fair enough. But then this...
Code:
if(maxMonsters > 8) maxMonsters = 8;
... becomes...
Code:
if(maxMonsters > MAX_LOGINED_CHARACTERS_IN_LOCATION-24) maxMonsters = MAX_LOGINED_CHARACTERS_IN_LOCATION-24;
I don't think this one should be dependent on "MAX_LOGINED_CHARACTERS_IN_LOCATION". That's already checked. This one is to prevent a small town location with only a couple of soldiers and hardly any permanent residents from being flooded with random walkers. In fact, it's the same line which I tried changing to use a different variable based on a location's attribute in the hope of boosting the walker population of large town locations, which didn't work because the limit based on "MAX_LOGINED_CHARACTERS_IN_LOCATION" had already capped the maximum number of walkers. So that one can stay at 8 for now, and if anyone does manage to raise "MAX_LOGINED_CHARACTERS_IN_LOCATION", we can try again to raise the walker population of large towns.

Meanwhile, in "quests_side.c", at case "mob part 2", this...
Code:
nummob = LAi_numloginedcharacters-30;
... becomes...
Code:
nummob = LAi_numloginedcharacters-MAX_LOGINED_CHARACTERS_IN_LOCATION-2;
You're subtracting "MAX_LOGINED_CHARACTERS_IN_LOCATION", then subtracting a further 2, which means you're subtracting 34, not 30. Easily enough fixed...
Code:
nummob = LAi_numloginedcharacters-(MAX_LOGINED_CHARACTERS_IN_LOCATION-2);
For clarity, I've put brackets round any other calculations based on "MAX_LOGINED_CHARACTERS_IN_LOCATION".
 
I don't think this one should be dependent on "MAX_LOGINED_CHARACTERS_IN_LOCATION". That's already checked. This one is to prevent a small town location with only a couple of soldiers and hardly any permanent residents from being flooded with random walkers. In fact, it's the same line which I tried changing to use a different variable based on a location's attribute in the hope of boosting the walker population of large town locations, which didn't work because the limit based on "MAX_LOGINED_CHARACTERS_IN_LOCATION" had already capped the maximum number of walkers. So that one can stay at 8 for now, and if anyone does manage to raise "MAX_LOGINED_CHARACTERS_IN_LOCATION", we can try again to raise the walker population of large towns.
Fair enough. I did that mainly because I wanted to see if it made a difference; and if I could really get busier towns by upping that number.
By having that dependency, I thought the difference would become immediately apparent.
It didn't.
I actually ended up testing by triggering Rapid Raids instead.

You're subtracting "MAX_LOGINED_CHARACTERS_IN_LOCATION", then subtracting a further 2, which means you're subtracting 34, not 30. Easily enough fixed...
AH! Oops.

I'm always nervous when someone tries to change code just because they don't like the programming style
You're right to be cautious.
This is indeed one reason why I really appreciate more than 1 person to check the code before it's implemented.
I know I've caught potential issues from other people; and likewise, you catch potential issues from me.
It really is true what they say: two know more than one. :cheers
 
Fair enough. I did that mainly because I wanted to see if it made a difference; and if I could really get busier towns by upping that number.
By having that dependency, I thought the difference would become immediately apparent.
It didn't.
I actually ended up testing by triggering Rapid Raids instead.
I tried replacing the 8 with a variable based on an attribute set in the definitions for Havana, Santiago and Cartagena town centres. I didn't get Rapid Raids but I didn't get any extra walkers either - once the guards, permanent residents, and you (plus any officers you might have) were added together, "20 - LAi_numloginedcharacters" didn't allow for 8 walkers, let alone any more. Changing "20" to "MAX_LOGINED_CHARACTERS_IN_LOCATION-12" won't make any difference unless "MAX_LOGINED_CHARACTERS_IN_LOCATION" increases from 32, which isn't going to happen. (Unless you did try to increase "MAX_LOGINED_CHARACTERS_IN_LOCATION", which then triggered the Rapid Raids.)

Maybe it's worth always setting...
Code:
maxMonsters = (MAX_LOGINED_CHARACTERS_IN_LOCATION-6) - LAi_numloginedcharacters;
... regardless of whether you have extra crewmembers, then reinstating my changes to read the location's attribute. The extra 6 characters might allow larger towns to have more walkers. If the difference for extra crew is supposed to create the same number of walkers regardless of whether you have extra crew, making this change would mean that you'll see fewer walkers. Your gang has scared some of them away!
 
Last edited:
I tried replacing the 8 with a variable based on an attribute set in the definitions for Havana, Santiago and Cartagena town centres. I didn't get Rapid Raids but I didn't get any extra walkers either - once the guards, permanent residents, and you (plus any officers you might have) were added together, "20 - LAi_numloginedcharacters" didn't allow for 8 walkers, let alone any more. Changing "20" to "MAX_LOGINED_CHARACTERS_IN_LOCATION-12" won't make any difference unless "MAX_LOGINED_CHARACTERS_IN_LOCATION" increases from 32, which isn't going to happen. (Unless you did try to increase "MAX_LOGINED_CHARACTERS_IN_LOCATION", which then triggered the Rapid Raids.)
The Rapid Raids were triggered by me doing it on purpose with Numpad 9.
No mystery there. ;)

And indeed I came to basically the same conclusion.
I did try to increase "MAX_LOGINED_CHARACTERS_IN_LOCATION" and a lot does seem to work properly.
Except for the relevant part... of actually showing character number 33 and up.

Maybe it's worth always setting...
Code:
maxMonsters = (MAX_LOGINED_CHARACTERS_IN_LOCATION-6) - LAi_numloginedcharacters;
... regardless of whether you have extra crewmembers, then reinstating my changes to read the location's attribute. The extra 6 characters might allow larger towns to have more walkers. If the difference for extra crew is supposed to create the same number of walkers regardless of whether you have extra crew, making this change would mean that you'll see fewer walkers. Your gang has scared some of them away!
You mean so 'maxMonsters' could be higher by default when extra crewmembers aren't enabled?
Why not? Worth a try. :onya
 
Probably a very long way off the wall but can you clever fellows split a big town model by having 2 different ones copies of the same slightly renamed but with an autoreload in the places you move from one to the other. The game could then treat them as different and you could have the characters allowed at least in the half of the town you were in?
 
Probably a very long way off the wall but can you clever fellows split a big town model by having 2 different ones copies of the same slightly renamed but with an autoreload in the places you move from one to the other. The game could then treat them as different and you could have the characters allowed at least in the half of the town you were in?
You mean to force the characters who DO fit in the location to also be close to where the player was loaded?

One practical issue I see there is that once loaded, they'll still scatter all over the place at random as time progresses.
 
Probably a very long way off the wall but can you clever fellows split a big town model by having 2 different ones copies of the same slightly renamed but with an autoreload in the places you move from one to the other. The game could then treat them as different and you could have the characters allowed at least in the half of the town you were in?
I don't think that would help. The town would still look deserted, the only difference being that everyone is clustered in one side of the town. You walk along, there's a reload for no reason apparent to the player, then everyone you could see a moment ago disappears and a new bunch of people appear.

Unless you mean to put a wall across the middle of Havana town centre so that you can only see half of it at a time? So that instead of one large town centre, you have two smaller town centres, similar to the way Port Royale works? That could work, though it defeats the purpose of importing these large towns.

Either way also potentially means rewriting any quests which take place in those towns. What previously should have happened in "Havana_Town_02" might now have to move to "Havana_Town_02_part2", for example.
 
Unless you mean to put a wall across the middle of Havana town centre so that you can only see half of it at a time? So that instead of one large town centre, you have two smaller town centres, similar to the way Port Royale works? That could work, though it defeats the purpose of importing these large towns.

Either way also potentially means rewriting any quests which take place in those towns. What previously should have happened in "Havana_Town_02" might now have to move to "Havana_Town_02_part2", for example.
Yep a whole load of find and replace based on where the locator is, not quite re-writing. Except for action which was previously straddling the border.

I presumed the purpose of importing them was because we could and to have some different locations but I guess it was to have bigger places for the larger settlements that you could walk around and admire the buildings. But fine I can see the switch of where the population was would look more than a bit weird...requiring removal of a lot of locators around the breakpoint on both sides to remove casual walkers from starting in view, there (or not) one minute and gone (or present) the next and any static placements (guards etc) nearby would be a problem .. so OK I didn't think that through
 
I presumed the purpose of importing them was because we could and to have some different locations but I guess it was to have bigger places for the larger settlements that you could walk around and admire the buildings.
Indeed variety was the biggest reason for it.
The scale of the VCO locations being different from PotC gives the unfortunate side-effect though of making those locations seem more empty than would otherwise be the case.

But fine I can see the switch of where the population was would look more than a bit weird...requiring removal of a lot of locators around the breakpoint on both sides to remove casual walkers from starting in view, there (or not) one minute and gone (or present) the next and any static placements (guards etc) nearby would be a problem .. so OK I didn't think that through
Was still worth mentioning.
Lots of good has come in the past from out-of-the-box thinking.
Even if often it might not work, it's still valuable for the times that it does.
Because sometimes that REALLY pays off. :bow
 
You mean so 'maxMonsters' could be higher by default when extra crewmembers aren't enabled?
Why not? Worth a try. :onya
It works and doesn't work. o_O It certainly allows more walkers to spawn. But they all seem to spawn near one exit. With DEBUGINFO set to 1 to show login status when entering a new location, here's what happens in Cartagena:
more_walkers_cartagena1.jpg
Plenty of town folk, all near the town gate.
(That "@Cartagena town" means the location name is unable to be translated. This is because the location label is "Cartagena town", which is not included in "interface_strings.txt". As of next update, it's replaced by the more usual "#stown_name# town", which is included, does translate, and therefore does not show the "@".)

But at the other end of town near the church:
more_walkers_cartagena2.jpg
Nobody in sight, until they move around and reach this area. It does not seem to be because they're starting at low numbered "goto" locators because "goto2" is just round the corner, beside the church, and there's nobody there either. And they can't be looking for "monsters" locators because neither Cartagena nor any other town centre have them.

The same thing happens in other towns, though because they're smaller, you may not notice. If you enter Port Royale town centre from the port gate, you won't see any walkers until you go round the corner, are looking at the town hall, and meet some people coming towards you.
 
Back
Top