grimjaw
Brigadier General
Posts: 491
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Naval engineers, and why you shouldn't buy them (BTW, I was wrong)

Sun Jan 24, 2021 11:30 pm

EDIT, this post is mostly wrong about conclusions but read on to Pocus' explanation for details.

I've searched on this forum before about naval engineers in CW2, and the answers are mixed. Do they work, or don't they? Some people say they speed up repair, and some say they see no benefit. After researching unrelated things in the code, I believe I've found the answer and you're probably not going to like it.

The naval engineers in CW2 do not work. They never have, and they never will. *In fact, they don't do anything at all except consume resources.* That's the sum of it. If you care about why, read on.

First, ships in CW2 aren't really being repaired; they getting replacements. That's set by this game rule:

// Ships use replacements and not directly assets to be repaired
rulShipsUseRepl = 1

I don't know if that's a boolean variable or if there are multiple levels. Regardless, ships only use replacements, which only require whatever simple resources (money, WS, conscripts) are defined for the model in question. There are no assets beyond those in CW2, because CW2 is using simple economy rules. For "naval repair" speed increase to work in CW2, it has to increase the speed at which naval units get replacements. Remember that.

The CW2 naval engineers have an "ability", but it's just a flavor type of ability that places a description on the user interface for the unit that says something. The something in this case could be, "this unit drinks lava and pisses champagne." Flavor abilities are descriptions only; they do nothing else.

According the last AGE wiki entry I could find on the subject, the attribute that's needed to allow a model to affect naval repair speed is called *NavalRepair*.

*NavalRepair* // if rulEconomyMode_ >= _gmdAdvanced
*NavalSupply* // not currently used
*NavalBuild* // rulEconomyMode_ >= _gmdAdvanced

That attribute is not on any model in CW2. The only attributes that a naval engineer model has are *CanBuildRail* and *CanDestroyRail*. But that's not the only problem. The *NavalRepair* attribute only works when the advanced economy rule is enabled. CW2 uses simple economy rules, and was designed that way (per Pocus, search the forum). The naval repair attribute is in the CW2 engine code and it exists on certain structures like ship yards. But it doesn't do anything for structures, either, because the set of rules *NavalRepair* needs to engage aren't operating.

(BTW, *CanBuildRail* and *CanDestroyRail* also do nothing in CW2, almost certain)

Unless the engine code has it blocked in some way, to enable the advanced economy rule in CW2 is as simple as entering the appropriate line in GameRules.opt. But to do that would be equivalent to waking somebody up in the middle of their appendectomy and telling them to do somersaults. All the other pieces of an AGE advanced economy are not in place, not even the part of the user interface to twiddle the knobs for it. Before you ask, no, I can't/won't construct a CW2 advanced economy. It could definitely improve the flavor of the game, but sadly it wasn't implemented.

Orso posted a long time back that he had seen the naval repair effect working, but I'm 99% certain he was wrong. There is nothing obvious in the engine code I can see that identifies a specific model name. A model name/family/sub-type is the only way, other than the *NavalRepair* attribute, that the engine would identify which model has an ability to change naval repair speed; or in this case replacement speed since naval units don't use other assets that exist under advanced economy rules. Ship yards and naval yards do provide more resources, but those same resources are used for cavalry, balloons, etc.

I regret to tell you all those resources you used to park a CSA naval engineer in Mobile went down the toilet. Should've bought another 6-pdr, reb'.

Why are naval engineers still in the game and sold as working when clearly they are not? I can only speculate, but you're better off disbanding and not purchasing them.
Last edited by grimjaw on Mon Feb 01, 2021 7:12 pm, edited 2 times in total.

User avatar
Straight Arrow
General
Posts: 500
Joined: Fri Nov 07, 2014 5:44 pm
Location: Washington State

Re: Naval engineers, and why you shouldn't buy them

Wed Jan 27, 2021 4:57 am

Wow,

Great catch I have never bought naval engineers as the CSA, but I've always purchased 1, and sometimes more, as the Federals.

User avatar
Pocus
Posts: 25523
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Re: Naval engineers, and why you shouldn't buy them

Wed Jan 27, 2021 10:15 am

You are right, *NavalRepair*, even if presents would not do anything. It would do something on a structure, by increasing the recovery speed.

I fancied looking at the code though, in a moment of nostalgia. I have a good news, Naval Engineers are of their own "Family", Naval Engineer (doh!)

And it is hardcoded they do something, as per the code:

// Ship in harbor and have naval engineer
if (Region.GetHarbor <> nil) and (Region.GetNbSubUnitsTheseFamilies([_famNavalEngineer]) > 0) then
Inc(NavCoeff, recNavEngMod_);

So they too increase repair speed for ships in harbor, and repairing is also constructing in AGE.
The value is +10% BTW.

grimjaw
Brigadier General
Posts: 491
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Re: Naval engineers, and why you shouldn't buy them

Wed Jan 27, 2021 4:17 pm

Aha, the architect speaks! :)

Thanks for that information, Pocus, very helpful. If only I had access to at least view the code ...

User avatar
Pocus
Posts: 25523
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Re: Naval engineers, and why you shouldn't buy them

Wed Jan 27, 2021 5:01 pm

I'll ask Slitherine before, that's not impossible indeed.

grimjaw
Brigadier General
Posts: 491
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Re: Naval engineers, and why you shouldn't buy them

Thu Jan 28, 2021 12:48 am

I never would have imagined, thank you for even considering it. There are three things you might be able to answer off the top of your head, simple things.

1. What exactly does the attribute *distantsiege* provide? I assume it has something to do with sieges and adjacent regions, since mortar boats are the only element using that attribute and they obviously aren't going to beach themselves in fort regions to get their bonus. I think I can see in the code (hex editing view) that *distantsiege* is checked for during the checksiege procedure but I can't really tell more than that.

2. Is there *any* way though scripting that I can modify or remove the random delay placed on ships leaving a harbor? I know having a leader in the stack helps, but I'm talking about making it a maximum 3 day delay or eliminating it. Something like a game rule or faction modifier that can be set?

I ask because that was one of the hurdles I ran into when trying to create a mod with 7 day turns. Sometimes the ship delay takes up an entire week, and if it does the ship will often disembark any passengers before the next turn starts.

3. Bombarding ship to shore: if I had a theoretical island region surrounded by six water regions (like a hex shape, just to picture it mentally), and there is a qualifying artillery piece on the island set to bombard, and a ship sails through every adjacent water region around the island, if the artillery has enough ammo and cohesion, will it attempt to fire at every point, and the ship vice versa, or does there have to be a link between the regions. We could also theorize, for instance, that the island is somehow inaccessible from water (think cliffs of Dover) so there's no way on or off.

Thanks for any help, hope you're weathering the pandemic with no problems.

User avatar
pgr
General of the Army
Posts: 653
Joined: Fri Jan 24, 2014 9:33 pm
Location: Paris France (by way of Wyoming)

Re: Naval engineers, and why you shouldn't buy them

Fri Jan 29, 2021 5:35 pm

I can definitely confirm that naval engineers speed up ship building, and the gain in noticable for the big ships. That said though, even the Union does not really need to build them given that you get them automatically when in the shipyards you would want to build anyway.

User avatar
Pocus
Posts: 25523
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Re: Naval engineers, and why you shouldn't buy them (BTW, I was wrong)

Wed Feb 03, 2021 8:44 am

That won't be possible, at least this year, to have access to the code base. Even if the code is old and not used anymore, Slitherine will want a formal agreement and they feel it is too much right now, as that would also mean a bit of formal support from me.

So better have some informal support, free of anything :)

1. DistantSiege: Units with this attribute, adjacent to a besieged region will provide +1 to siege, with a max of +2, for each 8 points of 'SiegeValue'.

2. I checked in the relevant function and I don't see what that's done, sorry, that would need a deeper search. But I'm also pretty sure it was hard coded with variables not exported to a file, sorry.
There are games that run with 7 days and the issue is not there though, so you should perhaps PM Bohemond, is the the one the most knowledged in the engine!

3. Distant bombardment is triggered when a ship moves from region A to B, both adjacent to a region C. Besides that I don't think the nature of the link between A to C or B to C plays a role (and that's easy to test on the map). So yes, if you have your ship run in circle around the center region, there will be an exchange each time.

grimjaw
Brigadier General
Posts: 491
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Re: Naval engineers, and why you shouldn't buy them (BTW, I was wrong)

Wed Feb 03, 2021 4:28 pm

Thanks Pocus! I did not have any real hope that I'd get a look at the code, but thanks for the answers. Bohemond and I have corresponded in the past and he's been very helpful.

Return to “Civil War II”

Who is online

Users browsing this forum: No registered users and 16 guests