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

Enemies: No surrender!

CaptnLysop

Sailor Apprentice
Looked in every file, can't make head nor tail from 90% of it, coders have to be around and spare 5mins to look into it, please, so here it goes :b: :

How to keep the enemy from surrendering, them chickens, everytime you shoot their ship up a bit too much they chicken and give up. Gone so far I hesitate to use buckshot and only use knippelz or ballz. So; where in Sea_Ai or some other script-folder is the part that sez "if (Men) < X (surrender)"? Is it "If (Ratio < 1.6) or something like that I found; seems to control the Abordage or something rather...

Thx, hope some1 who knows coding alot is not too busy with GoF or whatnot :doff

*Err-Dit*
I ask because I love them Sea-Battles, but Boarding 's really changing a battle thats been lost/won almost.
 
Looked in every file, can't make head nor tail from 90% of it, coders have to be around and spare 5mins to look into it, please, so here it goes :b: :

How to keep the enemy from surrendering, them chickens, everytime you shoot their ship up a bit too much they chicken and give up. Gone so far I hesitate to use buckshot and only use knippelz or ballz. So; where in Sea_Ai or some other script-folder is the part that sez "if (Men) < X (surrender)"? Is it "If (Ratio < 1.6) or something like that I found; seems to control the Abordage or something rather...

Thx, hope some1 who knows coding alot is not too busy with GoF or whatnot :doff

*Err-Dit*
I ask because I love them Sea-Battles, but Boarding 's really changing a battle thats been lost/won almost.

if you have 1,6 times more men thaen they have, they surrender.

that can not be detected in the whiite bar above the ships, becvause different ships have diferent men counts.
so, put the ratio to 2,0... you need double as much men for them to surrender.
or 3,0... you need triple as much men for them to surrender

??
 
Looked in every file, can't make head nor tail from 90% of it, coders have to be around and spare 5mins to look into it, please, so here it goes :b: :

How to keep the enemy from surrendering, them chickens, everytime you shoot their ship up a bit too much they chicken and give up. Gone so far I hesitate to use buckshot and only use knippelz or ballz. So; where in Sea_Ai or some other script-folder is the part that sez "if (Men) < X (surrender)"? Is it "If (Ratio < 1.6) or something like that I found; seems to control the Abordage or something rather...

Thx, hope some1 who knows coding alot is not too busy with GoF or whatnot :doff

*Err-Dit*
I ask because I love them Sea-Battles, but Boarding 's really changing a battle thats been lost/won almost, AND: When you clear the Ship, you can loot the dead and in the Cap's Quarter you mostly get decent weapons and Money, and somethimes even A LOT of money! When they give up, that's that, you can't peek into the Cap's Quarter, at leas 3000 Gold lost (I mostly get between 1500-3000 Gold, sometimes even 6-9000 and 15000 Gold from the Chest!)

if you have 1,6 times more men thaen they have, they surrender.

that can not be detected in the whiite bar above the ships, becvause different ships have diferent men counts.
so, put the ratio to 2,0... you need double as much men for them to surrender.
or 3,0... you need triple as much men for them to surrender

??

Hmm, the way the script's reading, it is indeed like this, I'll try; change it to something like Ratio 999 (lol) and then shoot their ship empty and board it. The way it reads, that 'd make me need 999x more men than them, but if they got 0, well... I' gotta look.
THX!

*EDIT2*
Checked and I can say: Surrender is NOT bound to AiShips, this one only controls the behaviour of an enemy Ship: Change the EnemyGrappling and other Parameters to something high, and even an enemy ship with only 2 People left on it will try to board YOU... and surrender.
So surrender is effectifely bound to another script; changed the fRatio to something enourmosly high/low, and it only made Enemy ships run/not run away.
Right now I'm looking into what controls the message "Surrender" to come up, since we can disable the menu to show up unless the Ship was boarded and captured, that's what I wanted.

*EDIT3*
hm, "LAi_boarding.c" has in it:
Code:
if (CheckForSurrender
and some more, coming closer there: it also has
Code:
Surrendered = (Surrendered) || (TestRansackCaptain);
and more like these; this it, I hope!
They even pointed something out there:
Code:
if (mcrew > ecrew)
{
return false; // Yay! Surrender!
}
return false; // íå ñäàëñÿ

If my crew is over the enemy crew, surrender? LOL, were it so easy?! Testing now!

*EDIT4*

YES, there ya have it!

Change it to say:
Code:
if (mcrew > ecrew)
{
return false; // Yay! Surrender!
}
return false; // íå ñäàëñÿ

Tested 3x in a row, settings and results:
My Ship: 244 men
Enemy: 2 men
1.
Code:
return false; // Yay! Surrender!
-> result: Ship don't give up, BUT ATTACKS ME AND TRIES BOARDING ME, I have to fight
2.
Code:
return true; // Yay! Surrender!
-> result: Ship gives up, Dialogue opens: "Crew discretely surrenders"
3.
Changed back to
Code:
return false; // Yay! Surrender!
-> result: Crew don't give up, but attacks me and I need to clear the Deck.
 
So how can we make it so they only surrender when they know they cannot win like in real life?


I guess maybe if you put it something like this for example:

Code:
if (mcrew > ( ecrew * 1.6 ))

That would make enemy crew surrender if you have more than 1.6 times their crew.

But then again, I'm no coder and have only very limited knowledge of C++... and those unreadable comments don't help. :D
 
So how can we make it so they only surrender when they know they cannot win like in real life?


I guess maybe if you put it something like this for example:

Code:
if (mcrew > ( ecrew * 1.6 ))

That would make enemy crew surrender if you have more than 1.6 times their crew.

But then again, I'm no coder and have only very limited knowledge of C++... and those unreadable comments don't help. :D

but how to define "me vs You = youdead" can one fix that on a sailorcount? what about crew experience and equipment moral and such factors?
 
I myself was only worrying about the enemy giving up too easy, but now that I found out how to disable it, it only took me a couple Hours of playing to put it back the way it is, because the enemy won't give up at all [what I wanted but now I think it's too wrong). If you make it like I did, that the enemies never surrender, you can enter an enemy Ship, and you only need to fight 1 Enemy Sailor and the captain; I looked at my men, and half of them were gone after the fight; meaning: one is not supposed to change that, or it will behave like the enemy is almost equal to your force, but you only fight 1 enemy, win quickly, but still loose an enourmos amount of men in the math before/after the battle.

but how to define "me vs You = youdead" can one fix that on a sailorcount? what about crew experience and equipment moral and such factors?

That's exactly it, there are soooo many variables and values that you could use to calculate, but that would need an coder to fully rewrite it; and we end up with a script that could easily be double the size than before, and I don't know about scriptlag in this game yet!
If the other post says "1.6x the force of your men", then what if you encounter a battleship and you have a corvette? You have 200 men and the enemy surrenders, even though they have 290 men on their side -> easy win for the enemy, they outnumber us by 1:1.45, so they have an at least 45% advantage but still loose, using such a simple script, no no, it has to be recoded, so that EVERY value from fencing to morale gets used; but I don't want to look at a loading screen for 10 minutes while the game calculates that I win anyways.

Speaking of it, the other file that I was looking in first (I think Sea_AI) is only for determining if the enemy starts boarding you on their own or if they run from you and wait for you to board them, so the right script to change is the other one (LAi_boarding.c), as I wrote before already, lol.
 
So how can we make it so they only surrender when they know they cannot win like in real life?


I guess maybe if you put it something like this for example:

Code:
if (mcrew > ( ecrew * 1.6 ))

That would make enemy crew surrender if you have more than 1.6 times their crew.

But then again, I'm no coder and have only very limited knowledge of C++... and those unreadable comments don't help. :D

but how to define "me vs You = youdead" can one fix that on a sailorcount? what about crew experience and equipment moral and such factors?

well, from what I understood "mcrew" is player's crew while "ecrew" is enemy crew. but like you said, that's only the sailor count. I think leadership plays a role as well, as for rest I believe it's possible to add more conditions, but it would take someone that understands the code to dig trough that file and tinker around a bit with it
 
[/quote]
Tested 3x in a row, settings and results:
My Ship: 244 men
Enemy: 2 men
1.
Code:
return false; // Yay! Surrender!
-> result: Ship don't give up, BUT ATTACKS ME AND TRIES BOARDING ME, I have to fight
2.
Code:
return true; // Yay! Surrender!
-> result: Ship gives up, Dialogue opens: "Crew discretely surrenders"
3.
Changed back to
Code:
return false; // Yay! Surrender!
-> result: Crew don't give up, but attacks me and I need to clear the Deck.
[/quote]

Hi, you get a line in LAi_boarding:

if(boarding_enemy_crew <= 0) canReload = false;<== if there's only ONE sailor, boarding can be

and I think "if (mcrew > ( ecrew * 1.6 ))" should be for exemple "if (mcrew > ( ecrew * 0.5 ))<== enemy crew is half of your's
 
Hey, so far it seems your fix works Philippe!
me.gif
 
and I think "if (mcrew > ( ecrew * 1.6 ))" should be for exemple "if (mcrew > ( ecrew * 0.5 ))<== enemy crew is half of your's

No offense mate but you got it wrong. In your example, if you have 200 men enemy has to have less than 399 men to surrender, while in mine if you have 200 men enemy has to have less than 125 men to surrender.

Or in words "if my crew is more than half of the enemy crew ..." and "if my crew is more than 1,6 times enemy crew".
 
Doh -.- everybody just throwing around with these numbers, but you don't get the point: just math isn't going to do the trick! We need VARIABLES that INCLUDE Leadership, Your Level, the Enemy Level, the Type of Ship, Player Reputation, and not just some thing that says "Oh if we got X more men, then surrender". Because thats the way the Vanilla Script ALREADY WAS, only difference is that it only counts the Sailor Amount w/o "* 1.6" or "*0.5"!

Don't get it wrong, I like all yer's ideas, but it is kinda useless to apply a formula to every encounter where it comes to a fight with the enemy Crew.

Example:
Sir BlaBla is a big Hero! He's Level 12 and all that sh*t. Now he encounters the Ship of the "Duke of Ass-Whooping" and luckily beats the Duke's Ship up with Buckshot and Whatnot. The Duke is Level 21 by the way.
Now the Duke get's boarded and SURRENDERS; BECAUSE Sir BlaBla has EXACTLY 1.6x more men on his Ship;
The feared, noble, experienced, rich and just plainly AWESOME "Duke of Ass-Whoopin'" has not enough men to fight back, damn it!

Only Problem is:
1. The DUKE has 200 men aboard.
2. Whereas Sir BlaBla sports 320 men; 1.6 times as much, so far so good.
3. If (by magic or some stuff) the DUKE would pull out just 1 more man (making his side 201 Men strong), the Ratio would shift to
1,59203980099~ whis is BELOW the needed 1.6 Ratio and that means: NO SURRENDER! BOARD 'EM HARD! TAKE NO PRISONERS! DEATH BECOMES YOU! and so on....

Conclusion: Does 1 man make a difference in a real battle? Or should the Duke still surrender, because, you know, 1 more Sword is 1 more Sword, but still, 201 VS 320 is a bit heavy....

You get my Point: Just a tiiiiiny number makes the difference if a Superior, experienced and plain awesome Enemy surrenders, and that is so wrooooooong.

As I said before, CODERS where art thou? We would neeeeeed some1 to write variables and stuff to put in the script.
 
Doh -.- everybody just throwing around with these numbers, but you don't get the point: just math isn't going to do the trick! We need VARIABLES that INCLUDE Leadership, Your Level, the Enemy Level, the Type of Ship, Player Reputation, and not just some thing that says "Oh if we got X more men, then surrender". Because thats the way the Vanilla Script ALREADY WAS, only difference is that it only counts the Sailor Amount w/o "* 1.6" or "*0.5"!

Don't get it wrong, I like all yer's ideas, but it is kinda useless to apply a formula to every encounter where it comes to a fight with the enemy Crew.

Example:
Sir BlaBla is a big Hero! He's Level 12 and all that sh*t. Now he encounters the Ship of the "Duke of Ass-Whooping" and luckily beats the Duke's Ship up with Buckshot and Whatnot. The Duke is Level 21 by the way.
Now the Duke get's boarded and SURRENDERS; BECAUSE Sir BlaBla has EXACTLY 1.6x more men on his Ship;
The feared, noble, experienced, rich and just plainly AWESOME "Duke of Ass-Whoopin'" has not enough men to fight back, damn it!

Only Problem is:
1. The DUKE has 200 men aboard.
2. Whereas Sir BlaBla sports 320 men; 1.6 times as much, so far so good.
3. If (by magic or some stuff) the DUKE would pull out just 1 more man (making his side 201 Men strong), the Ratio would shift to
1,59203980099~ whis is BELOW the needed 1.6 Ratio and that means: NO SURRENDER! BOARD 'EM HARD! TAKE NO PRISONERS! DEATH BECOMES YOU! and so on....

Conclusion: Does 1 man make a difference in a real battle? Or should the Duke still surrender, because, you know, 1 more Sword is 1 more Sword, but still, 201 VS 320 is a bit heavy....

You get my Point: Just a tiiiiiny number makes the difference if a Superior, experienced and plain awesome Enemy surrenders, and that is so wrooooooong.

As I said before, CODERS where art thou? We would neeeeeed some1 to write variables and stuff to put in the script.

I reckon it ain't that hard to do...just got to figure out the variables that "represent" leadership, reputation, etc... or re-define them (btw, I think leadership affects surrender, but haven't found a part of code where it's defined). After that it should be no more than adding "if"/"else if" conditions...

The talk about numbers was just example of what we could do if we only slightly modify the existing code, that's it.

I agree with you though, more variables to surrender would add a lot to gameplay.

EDIT: About the type of the ship - what would affect it class, amount of cannons, size?
 
EDIT: About the type of the ship - what would affect it class, amount of cannons, size?

Well I would laugh my ass off in real life if a small schooner would try boarding me, but I'd sh*t my pants when a Galleon slowly paces towards me, guns blazing.
Also, if there'd be an ass-load of cannons, that'd surely demoralize the ship to be boarded as well.
But thinking of this; it's just getting more and more with the possible Variables to put in, only thing we haven't thought off is the swell (ya know, the wves and everything); if there's a rough sea goin' on, it demoralizes too :cheeky
 
Hello. I' m neither a coder nor a modder but I understand very little russian and here is what I found in LAi_boarding.c:

Code:
int eclass = GetCharacterShipClass(echr);
int mclass = GetCharacterShipClass(mchr);
if (eclass == 1) return false; // 1 класс не сдается в принципе

The russian text means: class 1 wont surrender. So I added the following code:

Code:
int eclass = GetCharacterShipClass(echr);
int mclass = GetCharacterShipClass(mchr);
if (eclass == 1) return false; // 1 класс не сдается в принципе
if (eclass == 2) return false;
if (eclass == 3) return false;
if (eclass == 4) return false;

This seems to change the game in a way that class 4, 3, 2, 1 ships wont surrender when boarded. Their other behavior seems unchanged to me. This makes the game feel much more realistic to me because class 4 ships are frigate class with 400+ man and they should put up a fight no matter what. Test it out for yourself.

Cheers,

Stan.
 
Hi Stan,

great work.

Please can you let us know in detail where to find the file to edit.

e.g. C:\My Games\Age of Pirates 2\Program\SEA_AI\AIAttack.c

I've looked in nearly every Sea_AI file with no luck.

Many thanks,

Lambar
 
No offense mate but you got it wrong. In your example, if you have 200 men enemy has to have less than 399 men to surrender, while in mine if you have 200 men enemy has to have less than 125 men to surrender.

Or in words "if my crew is more than half of the enemy crew ..." and "if my crew is more than 1,6 times enemy crew".
:ahoyI guess you have to put in these parameters:

Code:
if (mcrew * 10 > ecrew)

That means in plain words: "if my crew is 10 times bigger than enemy crew = enemy crew surrender"!


:ship
 
Hi Stan,

great work.

Please can you let us know in detail where to find the file to edit.

e.g. C:\My Games\Age of Pirates 2\Program\SEA_AI\AIAttack.c

I've looked in nearly every Sea_AI file with no luck.

Many thanks,

Lambar

:ahoy

Here is the path for the folder: AOP2\Program\loc_ai\LAi_boarding

Greets!

:ship
 
Back
Top