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

Boarding code question

Doober

Buccaneer
Storm Modder
This is in the internalsetting.h

// BOARDING - LocAI
#define BOARDING_HP_MORALE_SCALAR 1.0 // type=float, effect morale has on HP. Smaller number here, less effect; 0 is no effect at all. 1.0 means morale scales HP to between 0.05 and 2.0 original.
#define BOARDING_HP_SCALAR_FRIEND 1.0 // type=float, flat scalar to apply at end of calculating friendly HP for boarding. Default 1.0
#define BOARDING_HP_SCALAR_ENEMY 1.0 // type=float, flat scalar to apply at end of calculating enemy HP for boarding. Default 1.0
#define BOARDING_HP_ENEMY_POWER 1.2 // type=float, power to raise (Difficulty_level + 1) for calculating enemy HP. Default 1.2

I don't see anywhere in the new boarding code where it is used. Is this no longer used to calculate boarding? This is more for my own personal interest than anything else, as I am working on trying to understand how code works so I can be a little more help. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
 
I have just checked it and these settings were used in the old boarding code. However, Hook made a thorough rewrite of that code and apparently he doesn't use these settings anymore.
 
I rewrote the whole HP calculation thing. Before, your own and your officers' hit points could be adjusted downward depending on ship morale and other factors. This meant you wouldn't have the HP you expected, and could be killed with one hit.

I fixed it so that you and your officers would all have their normal amount of HP, and the enemy HP was calculated by the HP of the enemy captain, based on his character level, adjusted by morale differences and game difficulty. Your boarding party will have the same number of hit points you do.

The enemy captain was generated oddly, so I had to do a bit of massaging so the enemy HP would be not too far off from yours. He gets regenerated before you talk to him, and with a reasonable character level, so the enemy boarder HP won't necessarily be the same as what the captain has when you meet him.

The end effect of all this was that at difficulty 1, enemy will have fewer hit points than you, at difficulty 2 they will have about the same, and at difficulty 3 they will have somewhat more. Expect really powerful enemies at difficulty 4. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Hook
 
Whoa! Nice work on all that! I did notice boardings were alot more fun, it seemed that there was alot more action than previously. I always play on Swashbuckler because I like running in to really good sea captains, but you are right, boardings can get downright brutal! <img src="style_emoticons/<#EMO_DIR#>/slap.gif" style="vertical-align:middle" emoid=":slap" border="0" alt="slap.gif" />

Is there a way for me to make the max odds 3:1 as opposed to 2:1 to compensate for the more difficult enemies on Swashbuckler? I was able to change it before, but it looks like the code is different now and I don't want to mess something up. I was boarding a barque that I demasted and killed almost all the crew, they still wiped me out!
 
You can change the max odds, but remember that if you're boarding a larger ship, you could have the odds stacked against you. <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

float CrewRatio = fclamp(1.0/3.0, 2.0/3.0, 1.0 * mcrew / (mcrew + ecrew)); // No more than 2:1 odds on any deck

Change "1.0/3.0, 2.0/3.0" to "1.0/4.0, 3.0/4.0" to make the odds 3:1.

When it was ".333, .667" there could have been a rounding error which would give you one too many enemy crewmen, and you might get stuck on a deck. That's why I changed it to the 1/3,2/3 numbers. I discovered it when I had an extra crewman on one deck.

It's also possible to make the numbers closer to even odds. Change
"1.0/3.0, 2.0/3.0" to "0.4, 0.6" for example.

Hook
 
Thanks! That will help alot. I alway pummel AI ships with grape before I board, so I almost always have a much higher crew. You kinda have to on Swashbuckler, I found. Sometimes I would outnumber them by 10:1 and still lose the boarding action <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
I guess you could remove the limits entirely by making it:

float CrewRatio = fclamp(0.0, 1.0, 1.0 * mcrew / (mcrew + ecrew));

Just remember, if you ever get too close and the enemy initiates boarding on you, you're gonna be toast. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Hook
 
Back
Top