View Full Version : Naval Interceptions
Gaius Octavius Feb 06, 2008, 07:30 PM One of the most commonly cited shortcomings about Civ 4's naval system has to do with the immense difficulty in preventative actions. By this I mean that even if you have the most powerful navy in the world, you can't possibly cover all your bases. A single, small enemy task force with 5 transports can land a huge stack of troops on your continent before you even have a chance to respond.
The solution until now has largely been to deploy scouts to give you advance warning, but that's just a workaround. What I propose is something simple in principle, if perhaps difficult in code. Extend the naval interdiction order to intercept all enemy ships that enter your borders.
Right now, an enemy vessel that attempts to pillage a tile can be intercepted if you have your ships under orders to do so. If we extended this, however, your ships would automatically assault any task force that attempted an invasion of your borders. This would be far more realistic and give the navy a significant boost in importance.
The solution will definitely lie within SDK, but I posted this in the main forum due to the higher traffic and because I want to hear more ideas. Anybody thought about doing this?
frekk Feb 06, 2008, 09:10 PM The problem there is that, depending on the size of the attacking force, you might not want to intercept it. Except at a few key locations it's unlikely you'll have enough intercepting vessels to make it succesful against a large force. If it's all automated, you'll just lose your ships. This would then turn into an exploit as huge naval SODs could be sent to obliterate the dispersed interception flotillas, a section at a time. What would be more useful, is to give a 1 round delay for disembarking. With possible exceptions for marines and units with amphibious promotions. This way, you'd have the option of deciding whether or not you wanted to commit your naval forces against the attacker's fleet, or do something else, like hide in port, relocate, etc.
Gaius Octavius Feb 06, 2008, 09:22 PM The problem there is that, depending on the size of the attacking force, you might not want to intercept it. Except at a few key locations it's unlikely you'll have enough intercepting vessels to make it succesful against a large force. If it's all automated, you'll just lose your ships. This would then turn into an exploit as huge naval SODs could be sent to obliterate the dispersed interception flotillas, a section at a time. What would be more useful, is to give a 1 round delay for disembarking. With possible exceptions for marines and units with amphibious promotions. This way, you'd have the option of deciding whether or not you wanted to commit your naval forces against the attacker's fleet, or do something else, like hide in port, relocate, etc.
I thought of this, but the problem there is:
1) If there is an overwhelming force, logically it would simply engage your ships anyway and destroy them. (Any human player would.)
2) This is really an optional command, so you don't have to set the naval interdiction if you don't want to. You'd avoid the automatic-intercept of a huge fleet but you'd risk allowing a smaller enemy to infiltrate your borders--the perfect strategic trade-off. :)
I suppose if it really became an issue you could always add an extra check in SDK that runs the combat odds between your ship and the highest strength vessel in the stack; if they are below a certain value, say 50%, then the interception will not take place. Problem solved. :)
frekk Feb 07, 2008, 06:42 AM How would it engage your ships if you didn't move them out of port?
As for intercept, it's true you could add some sort of check like you mentioned, but there would be problems with that. If your intercepting ships are counting on quantity rather than individual quality, then you the interceptions won't happen. You should really be able to decide whether you're going to engage or not.
Besides a 1 turn unloading penalty, I can think of an even simpler way to do it; simply reduce movement of transports but increase the port rebase multiplier. This way, you will always have a turn before they land, perhaps even more if you have detected them with aircraft or patrols.
Dom Pedro II Feb 07, 2008, 09:23 AM I have to say that the one-turn delay seems like a better idea over all... but I do like the idea of automatic interdiction as well... I think both would actually be good additions. I'm a little concerned about when the interdiction should take place though... should it happen immediately when a naval unit enters the borders? I don't like the idea of that because from the perspective of the attacker, you'll have absolutely no idea what unit might intercept you... naval units have a huge reach compared to land units... far beyond the visual reach of any unit.
jefmart1 Feb 07, 2008, 10:12 AM Wouldn't it be easier to have a popup warning that enemy ships have entered your territory? Or something that marks enemy ships that have come within x tiles of your ships, so as to warn against ships outside your borders, since many times the borders only extend 2 tiles and ships can often move 6+. Something that stays on screen at least until you scroll to it.
I agree that waiting until they are close to your cities is too late.
Gaius Octavius Feb 07, 2008, 12:41 PM I have to say that the one-turn delay seems like a better idea over all... but I do like the idea of automatic interdiction as well... I think both would actually be good additions. I'm a little concerned about when the interdiction should take place though... should it happen immediately when a naval unit enters the borders? I don't like the idea of that because from the perspective of the attacker, you'll have absolutely no idea what unit might intercept you... naval units have a huge reach compared to land units... far beyond the visual reach of any unit.
Isn't that kind of the point? I was playing HoI recently and attempted an invasion of England. I forgot that this wasn't the silly Civ system, and my fleet of destroyers and transports got intercepted by battleships. This forces you to think strategically instead of just going in blindly. You need to investigate.
Wouldn't it be easier to have a popup warning that enemy ships have entered your territory? Or something that marks enemy ships that have come within x tiles of your ships, so as to warn against ships outside your borders, since many times the borders only extend 2 tiles and ships can often move 6+. Something that stays on screen at least until you scroll to it.
I agree that waiting until they are close to your cities is too late.
How would the AI make use of this popup? ;)
The real problem we're facing here is that transports and invading capital ships should be able to be interecepted by your own ships, just as bombers are intercepted by fighters.
How would it engage your ships if you didn't move them out of port?
As for intercept, it's true you could add some sort of check like you mentioned, but there would be problems with that. If your intercepting ships are counting on quantity rather than individual quality, then you the interceptions won't happen. You should really be able to decide whether you're going to engage or not.
Besides a 1 turn unloading penalty, I can think of an even simpler way to do it; simply reduce movement of transports but increase the port rebase multiplier. This way, you will always have a turn before they land, perhaps even more if you have detected them with aircraft or patrols.
Then I suppose you could have a dual mechanism that compares both the overall quantity and quality. 10 destroyers vs. 2 battleships, for instance, would be allowed. Or you could simply do as I suggested and have the intercept always happen no matter what. Your planes certainly don't get this choice, but nobody seems to have any problems with that. Doing it this way would actually force you to make lots of naval vessels.
The moral of the story is, if you want to have a choice, don't set them to auto-intercept. Plain and simple.
I do not like the one-turn unloading penalty because I don't see how it's feasible. The intercept code is already in BtS, and it shouldn't require a huge modification to generalize it. An unloading penalty would have to take into account other things, such as additional movement, and frankly I don't see how it could be done.
Dom Pedro II Feb 07, 2008, 04:41 PM Isn't that kind of the point? I was playing HoI recently and attempted an invasion of England. I forgot that this wasn't the silly Civ system, and my fleet of destroyers and transports got intercepted by battleships. This forces you to think strategically instead of just going in blindly. You need to investigate.
No, the point is to require players to send in proper military support for transports and give the defending player at least one turn to try to destroy said transports before their cargo makes landfall. What I'm hearing with this auto-interdiction idea here is that I need to have a fleet of really cheap or obsolete suicide ships. Then I simply hurl them into the enemy borders and wait until all available defenders have been exhausted, then send in the big guns to take out the now completely revealed enemy intercepting ships, then move in the transports and disembark.
How would the AI make use of this popup? ;)
The real problem we're facing here is that transports and invading capital ships should be able to be interecepted by your own ships, just as bombers are intercepted by fighters.
Yes, but there's a huge difference. Air interception is not necessarily an all-or-nothing game. Your bombers might simply be damage and not necessarily shot down completely. Heck, you might even avoid enemy interceptors altogether. Those air units also tend to be cheaper compared to contemporary sea units.
Then I suppose you could have a dual mechanism that compares both the overall quantity and quality. 10 destroyers vs. 2 battleships, for instance, would be allowed. Or you could simply do as I suggested and have the intercept always happen no matter what. Your planes certainly don't get this choice, but nobody seems to have any problems with that. Doing it this way would actually force you to make lots of naval vessels.
It would force me to make lots of disposable naval vessels... and aside from being unfun, it's unrealistic.
The moral of the story is, if you want to have a choice, don't set them to auto-intercept. Plain and simple.
Yes, but presumably the AI will also be using this feature, so we as the players will still have to deal with it.
I do not like the one-turn unloading penalty because I don't see how it's feasible. The intercept code is already in BtS, and it shouldn't require a huge modification to generalize it. An unloading penalty would have to take into account other things, such as additional movement, and frankly I don't see how it could be done.
It's quite feasible. To do this quite simply, you'd just need to flag transported units as unable to disembark when they cross from friendly or neutral territory into enemy territory. Then the next turn, the flag would be removed, and they'd be able to be unloaded. And there's room to make it more interesting as well... For example, you could flag armor, artillery and mounted (maybe?) to only be able to be unloaded onto a tile with a friendly city or a friendly unit. This would represent infantry having to make a beachhead before other units could be brought up. It would be best though to require that any friendly units forming the beachhead still have movement left... You could also make it so that some units (Marines or Berzerkers maybe) could be exempt to the 1-turn penalty. Then you'd have some choices... you could unload the Marines to establish a beachhead but risk them being killed, but be rewarded by being able to unload the armor, artillery, etc. one turn earlier. Or you could wait one turn and unload all of your infantry units at once and then the following turn unload the artillery, armor and all the rest of the units.
So using this system will prevent an attacking player from unloading a huge army in one turn and leaving, but it will also give the attacking player first shot at any naval units it should encounter (as I think it should be) as well as giving them an opportunity to scout out the enemy territory at the risk of losing those lone scout ships in the next turn.
Gaius Octavius Feb 07, 2008, 05:14 PM No, the point is to require players to send in proper military support for transports and give the defending player at least one turn to try to destroy said transports before their cargo makes landfall. What I'm hearing with this auto-interdiction idea here is that I need to have a fleet of really cheap or obsolete suicide ships. Then I simply hurl them into the enemy borders and wait until all available defenders have been exhausted, then send in the big guns to take out the now completely revealed enemy intercepting ships, then move in the transports and disembark.
There is no such thing as a cheap suicide ship. ;) Rather, the converse would apply: you'd need more heavy battleships and cruisers. And if you do that then you've already solved your problem.
Yes, but there's a huge difference. Air interception is not necessarily an all-or-nothing game. Your bombers might simply be damage and not necessarily shot down completely. Heck, you might even avoid enemy interceptors altogether. Those air units also tend to be cheaper compared to contemporary sea units.
I knew you were going to say that, which is why I was going to suggest this: allow naval units a percentage chance to withdraw. You could make it automatic in the interception schema; a 50% chance of withdrawal or something, which involves non-fatal combat. Of course, it leaves you open to attack on the next round, but that's another story.
It would force me to make lots of disposable naval vessels... and aside from being unfun, it's unrealistic.
Why? Why does it automatically force you to make more 'disposable' naval units? There is nothing unrealistic about this at all. If I send in a fleet to invade a country, that country's coast guard is going to engage the fleet in the real world. If anything, it forces you to make more capital ships, behemoth battleships to accompany your task force.
Yes, but presumably the AI will also be using this feature, so we as the players will still have to deal with it.
That has nothing to do with my response. ;) Simply giving the player a popup if a ship happens to get near your coast will not help the AI. The only real way to do that would be to reveal the tile to the AI, and as it stands the AI's already pretty good about sending out scout airships and bombers. It wouldn't be very useful for them.
It's quite feasible. To do this quite simply, you'd just need to flag transported units as unable to disembark when they cross from friendly or neutral territory into enemy territory. Then the next turn, the flag would be removed, and they'd be able to be unloaded. And there's room to make it more interesting as well... For example, you could flag armor, artillery and mounted (maybe?) to only be able to be unloaded onto a tile with a friendly city or a friendly unit. This would represent infantry having to make a beachhead before other units could be brought up. It would be best though to require that any friendly units forming the beachhead still have movement left... You could also make it so that some units (Marines or Berzerkers maybe) could be exempt to the 1-turn penalty. Then you'd have some choices... you could unload the Marines to establish a beachhead but risk them being killed, but be rewarded by being able to unload the armor, artillery, etc. one turn earlier. Or you could wait one turn and unload all of your infantry units at once and then the following turn unload the artillery, armor and all the rest of the units.
So using this system will prevent an attacking player from unloading a huge army in one turn and leaving, but it will also give the attacking player first shot at any naval units it should encounter (as I think it should be) as well as giving them an opportunity to scout out the enemy territory at the risk of losing those lone scout ships in the next turn.
That still does nothing about the enemy ships entering your borders and wreaking havoc (e.g. bombarding your defenses) while you have no control over it.
I'm beginning to think this can only work with Dale's combined arms stack attack system. Perhaps he will have some ideas.
frekk Feb 07, 2008, 05:23 PM Your planes certainly don't get this choice, but nobody seems to have any problems with that.
That's because attacking planes don't really stack. ;)
The moral of the story is, if you want to have a choice, don't set them to auto-intercept. Plain and simple.
There are lots of ways the problem could be solved so that you DO have a choice. It can even be done in xml, by reducing the movement of transports and increasing the port rebase multiplier.
I can think of lots of alternative solutions. For instance, no landing of units without amphibious promotion on shores within an enemy's border - you need to capture a port before you can offload other units. A 1 turn offloading penalty (I'm sure it could be very easily done, I don't imagine it is nearly as difficult as you suppose). There are many, many possibilities.
Dom Pedro II Feb 07, 2008, 05:49 PM There is no such thing as a cheap suicide ship. ;) Rather, the converse would apply: you'd need more heavy battleships and cruisers. And if you do that then you've already solved your problem.
I disagree. Your thought process is that I'll want to send in bigger ships to guarantee victory, but this presents an unacceptable and completely unnecessary risk. If I send in my Battleship, I have absolutely no idea what is going to come at me. It could be an enemy Frigate in which case I'm going to pulverize it, or it could be a Battleship with better promotions in which case I'll probably lose and then I'll have just sent a very expensive ship to the briny deep on a silly scouting mission.
On the other hand, I could send in one of my obsolete ships that I didn't feel like upgrading in to tell me exactly what, if anything is out there. I'll lose the ship, but I won't be risking my better ships, and I'll be able to just take out the enemy ship now that I know exactly what and where he is. And the fog of war is of no use to prevent this practice here because there is no comparable action in the current game because under normal circumstances, an attacking unit performs the attack in his turn which means that if he kills the scouting unit, he can move to another tile. However, with auto-interdiction, the unit cannot move after the attack because it's not his turn to move. Thus, his location is still known to the human player (but it wouldn't be for the AI however because the AI has no memory of the last known location of a unit).
I knew you were going to say that, which is why I was going to suggest this: allow naval units a percentage chance to withdraw. You could make it automatic in the interception schema; a 50% chance of withdrawal or something, which involves non-fatal combat. Of course, it leaves you open to attack on the next round, but that's another story.
Well, you cited the fact that the interception code already exists as a reason to make a relatively small change, but defensive withdrawal (which is exactly what you're suggesting) isn't implemented in the game, and it will require a lot of work to implement.
Why? Why does it automatically force you to make more 'disposable' naval units? There is nothing unrealistic about this at all. If I send in a fleet to invade a country, that country's coast guard is going to engage the fleet in the real world. If anything, it forces you to make more capital ships, behemoth battleships to accompany your task force.
It forces the attacker (not the defender) to build more disposable units for the reason above, so the coast guard doesn't come into play.
That has nothing to do with my response. ;) Simply giving the player a popup if a ship happens to get near your coast will not help the AI. The only real way to do that would be to reveal the tile to the AI, and as it stands the AI's already pretty good about sending out scout airships and bombers. It wouldn't be very useful for them.
Actually it did. I replied to your reply on the popup suggestion further up in my post. The thing I replied to that you've quoted was in response to your statement that the player could just not use the auto-interdict feature... not that I want to split hairs :mischief:
That still does nothing about the enemy ships entering your borders and wreaking havoc (e.g. bombarding your defenses) while you have no control over it.
Well, then maybe the solution is to have auto-interdiction occur when you bombard the coast... if you do that and add in the unloading penalty, there's virtually nothing the attacking player can do in your territory that won't give you the opportunity to respond. They can't unload units, pillaging improvements will cause auto-interdiction and bombarding coastal cities will cause auto-interdiction. But the invader will still be able to move through your territory in his turn, and he'll still be able to initiate combat with your ships.
doronron Feb 07, 2008, 06:02 PM There is a Jeckel Python mod several generations old (v1.61) that allows for basic ZoC about two squares radius around a ship. Something like that might be the best option. Gives you advanced warning without an over abundance of screening ships defensively, and doesn't force the aggressor to build suicide ships to get his fleet across.
Of course, you still need to take into account the logistical and strategic differences between Sailing ships, Steam and Diesel ships, and Nuclear ships.
Curious to see what Dale's got up his sleeve for the next revision of DCM.
Aussie_Lurker Feb 07, 2008, 06:39 PM I think a modified "zone of control" system would work much better. Basically, have ships in forts & ports reduce movement of enemy vessels by half if they travel within 1 tile of the fort. This forces enemies to really plan their invasions, as they will need to avoid key Naval Facilities to do it. This, of course, could force enemy ships straight into the path of ships on patrol. Does that make sense?
To explain a bit better, consider this example. I have a port city on the SE corner of a continent, which I fear is open to invasion. Luckily, I have 3 small islands off the coast, where I build some forts. In these forts I place the bulk of my fleet, whilst leaving about 3 other ships on Auto-Patrol.
Now, my enemy's movement 6 battleships will be reduced to 3 moves per turn, allowing my own ships to intercept them much more easily. Alternatively, the enemy might turn north to avoid my bases, but that increases the chance that they will run into my patrolling ships. Another alternative is that they might try & take out my naval bases before launching the invasion.
Aside from the ZoC system, though, I think there should be an "Interdictor" promotion that can give those naval vessels greater odds of intercepting the enemy (maybe a movement bonus on Oceans or Coast, or a +25% movement rate-or maybe all of the above, over 3 seperate promotions).
Aussie_Lurker.
doronron Feb 07, 2008, 06:48 PM Good idea on the promotion. I know that Jeckel's code increases the number of movement points ships have, and then cuts slices of those points off when they move in range of a rival ship's zone of control.
Link: http://forums.civfanatics.com/showthread.php?t=188614&highlight=Enhance
Basic Description:
This mod's main purpose is to enhance the usefulness of Naval units. The main way this is done
is by increasing the movement of all DOMAIN_SEA units. I achieve this movement increase through
Python and not XML. The main reason for this is I have grown tired of changeing the movement
rate of ship after ship, again and again, for every mod I make or download. The acual increase
of movement is a multiplier that is set in the config.ini file, though I tend to use 2 to 4 times
movement depending on map size and amount of ocean/land.
Beyond the movement multiplier, there are two other functions in this mod.
One is a simple form of Naval Zone of Control. Basicly this means that any ship moving within
2 tiles of an enemy ship (ie a ship owned by the Barbarians or a player you are at war with)
will have the remainder of its movement removed. when used in conjuntion with the Naval Movement
Multiplier only the current slice of movement will be removed, basicly allowing a ship to move
a number of squares equal to its Movement Multiplier.
The last function of this mod is the return of a oldy Civ function. In the unitinfos.xml file
I have removed the ocean terrain restriction from the units that had it. Instead of making
Ocean tiles impassable to certain ships, there is a random chance that any ship sent into
Ocean tiles will sink on any given movement. This percent chance is setable in the config.ini
file. There is also an option to set the last era ships can sink. In addition to these options
You can also set a modifier to the base sink chance and an era to start using the modifier in.
Known Issues:
When draging the cursor for multi turn moving of units, the unit path finding lines show the
vanilla ETAs and don't see the changes made by this mod, so just divide those numbers by the
naval movement modifier.
While I don't know if this is to everyone's taste, it might be a good starting point. GO's port based interception concept does touch a bit on ship's need for resupply, and that could use some looking into.
jefmart1 Feb 08, 2008, 11:01 AM The AI doesn't need the popup, it knows your units are there. The situation you are trying to avoid is essentially an oversight by the human player. You missed an invading force or forgot about it and it hurt you. The AI doesn't forget, it should respond to threat accordingly.
If it isn't thats an AI problem that needs to be addressed, with perhaps you solution for the AI only.
Dom Pedro II Feb 08, 2008, 11:23 AM The AI doesn't need the popup, it knows your units are there. The situation you are trying to avoid is essentially an oversight by the human player. You missed an invading force or forgot about it and it hurt you. The AI doesn't forget, it should respond to threat accordingly.
If it isn't thats an AI problem that needs to be addressed, with perhaps you solution for the AI only.
jefmart1, that's not what he's referring to. He's talking about instances where an enemy fleet comes in from out of view and dumps a bunch of units on your turf without you being given a chance to respond. It's also not uncommon for human players to move to the border of an AI civ, declare war, move the transports in and then pull them out within one turn leaving the AI's navy absolutely no opportunity to stop them. The point is that this practice greatly reduces the usefulness of the navy.
Seven05 Feb 08, 2008, 11:34 AM Well, here's what I saw as the problem and what I did to deal with it.
The problem is that on many maps you have cities close enough that the enemy fleet can leave their city and land troops on your land in the same turn. Even a 'wall' of ships won't work as they'll simply punch through one of them and proceed as planned, extra scouts in this case are equally useless. A zone of control could help slow them down but puts too much burden on the defender which doesn't accurately reflect the inherent difficulties with amphibious invasions from the attacker's standpoint.
I tried expending all movement points if a ship entered hostile territory from neutral or firendly territory. In theory it's a good idea as it eliminates most occurances of instant invasions and give the defender an opportunity to move into place or engage the fleet at sea. However, in practice it didn't work so well as the pathfinding loves to move you in and out of hostile waters in odd zig-zag patterns of movement.
I tried a zone of control for naval units as well but the result had some undesireable effects. My first version of this had any tile adjacent to an enemy ship cost extra movement points, essentially +1 to enter a tile adjacent to an enemy ship and +1 to leave (resulting in +2 to try and pass them). The end result was more annoying than anything else, it added a lot of micromanagment in an area that really didn't benefit from it and really didin't solve the problem.
Finally, I settled on what I think works best. A simple rule for unloading transports into hostile territory that doesn't allow units to unload from transports that have moved on the current turn unless the unit that is unloading has the amphibious promotion. This effectively makes transport units wait for one turn in hostile waters with a cargo hold full of valuable units. It has no effect on anything else, so ships can still wander freely using the zig-zag pathfinding without annoying the owner and there is no extra micro-management required aside from a bit of pre-planning with transport fleets requiring escorts (which, I think is a good thing). Allowing units with the amphib promotion to unload right away adds a little benefit to an otherwise marginal promotion and makes for some interesting descisions for the player- do I load up on Marines alone so I can hit quickly, or do I bring artillery with me and risk a turn of vulnerability off the coast. You also have incentive to do things like land in friendly territory and walk the last few tiles to the target, especially with units that aren't amphibious. And, of course, it makes the Vikings downright scarey early in the game :)
It's doable in python by intercepting the canMoveInto() method but since that is called for every tile that every unit tries to move into it may slow things down. In the SDK it's about 4-5 lines of code in the CvUnit's canUnload() method and a bit of extra work to get the AI to understand it.
jefmart1 Feb 08, 2008, 12:10 PM jefmart1, that's not what he's referring to. He's talking about instances where an enemy fleet comes in from out of view and dumps a bunch of units on your turf without you being given a chance to respond. It's also not uncommon for human players to move to the border of an AI civ, declare war, move the transports in and then pull them out within one turn leaving the AI's navy absolutely no opportunity to stop them. The point is that this practice greatly reduces the usefulness of the navy.
I agree that is a huge problem. Although more for the AI since I do that all the time. It is unrealistic though, so now I agree with the concept being necessary.
The same could apply to land forces too. The AI should stockpile forces and prepare for war if you are moving stacks of troops onto their border.
Dom Pedro II Feb 08, 2008, 12:36 PM The same could apply to land forces too. The AI should stockpile forces and prepare for war if you are moving stacks of troops onto their border.
Actually, the AI does take troops on the border into consideration already, but it doesn't really move units on to the border in preparation for an attack.
Gaius Octavius Feb 17, 2008, 11:00 AM I have thought about this some more, and while I would really prefer a "sea patrol" order that lets you intercept all marauding vessels, I think that is only possible with a stack-attack system like in Dale's mod. Civ's one-on-one combat just isn't geared for it. Dale said he may do something in that area in the future, but we'll just have to wait and see...
So the transport delay seems to be the next best solution. :) And I like the idea of making amphibious units exempt to it. Seven05, have you actually made a mod that does this already? (If so where is it? :drool: )
Additional questions: will this cause an extra delay if you unload a unit in a city? And will the unit that gets unloaded have all its movement points penalized once it lands outside a city, like it does right now? That would effectively make it a two-turn delay.
Seven05 Feb 18, 2008, 10:59 AM Yeah, it's in my mod (see the link in my sig) and I'll post the source code from the DLL...
It's all wrapped up in CvUnit::canMove(), just add this small section of code after the python callback lines:
if (GC.getGameINLINE().isOption(GAMEOPTION_AMPHIBIOUS _RESTRICTION))
{
// Don't allow units to unload into enemy territory from transports that have moved
// this turn. Unless the unit has the amphibious promotion
if (getDomainType() == DOMAIN_LAND && plot()->isWater() && getTransportUnit()->hasMoved() && isEnemy(pPlot->getTeam(),pPlot))
{
if (!(isHasPromotion((PromotionTypes) GC.getInfoTypeForString("PROMOTION_AMPHIBIOUS"))))
{
return false;
}
}
}
You can remove the outer if statement if you don't want to add it as a gameoption since that requires a few other minor changes in the DLL and XML.
The 'rules' for this are simple, it only affects the ability to unload into a plot that is owned by a civ you are currently at war with. So it has no affect on plots that are owned by somebody you're not at war with (including your own plots) or unowned plots. It has no affect on unloading units into a city unless it's an enemy city. Units with the amphibious promotion ignore these new rules entirely, they can unload into enemy terrirtory without any delays.
You could actually put this into python if you wanted since the canMove() method is exposed to python. I don't know if python has easy access to the transporting unit and whether or not it has moved.
jkp1187 Feb 18, 2008, 12:03 PM Seven,
Does the AI handle this well when they're conducting amphibious attacks?
Gaius Octavius Feb 18, 2008, 01:33 PM Very interesting Seven! And much simpler than I thought it would be. I'll have to try this in my WWII scenario. :D
Along the lines of jkp1187's question, will the AI now be more likely to use marines and other amphibious units when assaulting cities directly? And does it 'intuitively' know not to move the transport unnecessarily when landing troops on a continent?
jkp1187 Feb 18, 2008, 01:51 PM Oh, and I hope you won't mind if I steal some of this code in the future ;)
One thing, though....what's the reasoning behind exempting amphibious from the rule?
frekk Feb 18, 2008, 05:00 PM Oh, and I hope you won't mind if I steal some of this code in the future ;)
One thing, though....what's the reasoning behind exempting amphibious from the rule?
Isn't it obvious? Amphibious troops are equipped and trained to do amphibious assaults. The combat bonus is not enough of a benefit for this particular promotion, and it tends to see little usage. Giving it this benefit makes it a more useful promotion and gives amphibious troops a real role befitting their nature.
Seven05 Feb 18, 2008, 05:07 PM Very interesting Seven! And much simpler than I thought it would be. I'll have to try this in my WWII scenario. :D
Along the lines of jkp1187's question, will the AI now be more likely to use marines and other amphibious units when assaulting cities directly? And does it 'intuitively' know not to move the transport unnecessarily when landing troops on a continent?
Most DLL changes end up being much less complicated than they sound... most :)
The AI does OK with it without any changes. They try to move and unload as normal but since they can't they will either wait (there are other instances where units get 'stuck' on their transports so the AI 'understands' this to a degree) or move to another plot and try again next turn. If they move to try again it isn't far, sometimes just far enough to mess up your defensive plans or get the attack stack to switch targets from their original goal. The AI will land immediately on a friendly/neutral plot if there is one next to their target plot, this is a side-effect of using the canMove() method, the AI will try another plot if it can't move where it wants to.
Oh, and I hope you won't mind if I steal some of this code in the future ;)
One thing, though....what's the reasoning behind exempting amphibious from the rule?
Some? Take it all if you want :P
I made the amphibious units exempt to make beserkers more potent early in the game and marines more useful later. With the default promotion there really is very little incentive to use it as striking directly from the transport is not often as effective as landing next to the city in a good defensive plot and letting your oppoentn come out of the city and beat their heads against your stack first. The biggest advantage to the amphibious promotion is the effect on crossing rivers so I added this little twist to enable tactics like rushing the marines in first to secure the beach since the support units like tanks and artillery would have to wait. I think it balances out fine, if you grab the amphibious promotion for other units you're giving up another, since the bonus is very limited in usefullness rather than something like the combat promotions.
danrh Feb 19, 2008, 03:04 AM personally I'd like to see submarines gain an opportunity fire capability. deployed in choke points as they are in real life they should have a 25-50% of attacking a transport in a stack. At the moment if a naval stack does not have a destroyer/frigate then the group will just sail right over the top of a wolfpack that is lying in ambush.
Dan
jkp1187 Feb 21, 2008, 11:49 AM Some? Take it all if you want :P
Cool! Can I have some money, too? :lol:
I made the amphibious units exempt to make beserkers more potent early in the game and marines more useful later. With the default promotion there really is very little incentive to use it as striking directly from the transport is not often as effective as landing next to the city in a good defensive plot and letting your oppoentn come out of the city and beat their heads against your stack first. The biggest advantage to the amphibious promotion is the effect on crossing rivers so I added this little twist to enable tactics like rushing the marines in first to secure the beach since the support units like tanks and artillery would have to wait. I think it balances out fine, if you grab the amphibious promotion for other units you're giving up another, since the bonus is very limited in usefullness rather than something like the combat promotions.
Okay, that makes sense. To be honest, I had never considered Amphibious to be underpowered (for what it is, it works fine,) but I got most of my use from the promotion via building Marine or Navy SEAL units, or occasionally giving it to an Infantry; I tended not to give it to early-era units. I like your rationale.
Seven05 Feb 21, 2008, 01:18 PM Cool! Can I have some money, too? :lol:
Sure, how much do you want? Just remember- I'll always owe it to you, but I'll never cheat you out of it :)
Okay, that makes sense. To be honest, I had never considered Amphibious to be underpowered (for what it is, it works fine,) but I got most of my use from the promotion via building Marine or Navy SEAL units, or occasionally giving it to an Infantry; I tended not to give it to early-era units. I like your rationale.
I tend to play very aggressively and like the concept of using different units for different purposes rather than just building a huge stack of the biggest, baddest units you can. In that context, the Marines didn't really feel any more compitent at amphibious invasions than any other unit, especially compared to higher strength units like tanks.
danrh Feb 21, 2008, 05:35 PM Sure, how much do you want? Just remember- I'll always owe it to you, but I'll never cheat you out of it :)
I tend to play very aggressively and like the concept of using different units for different purposes rather than just building a huge stack of the biggest, baddest units you can. In that context, the Marines didn't really feel any more compitent at amphibious invasions than any other unit, especially compared to higher strength units like tanks.
I am currently working on a minor rework of The Road to War mod. In it I am including amphibious tanks. These are pretty easy to create by simply starting the tanks with the amphibious promotion. Its not as involved as the python coding solutions above and maybe not as versatile but it seems to work pretty well for me, particularly in Pacific scenarios. I have two flavours of amphib tanks, light and medium. Light Amphibious Tanks are analagous to the types typically operated by the Soviets and Japanese during the war while the medium type are more representative of the Valentine and Sherman DD tanks used by the Western Allies. The units are stonger than infantry but a little weaker than contemporary standard tanks to still give them a disadvantage during an opposed landing. For modern purposes I'd suggest basing new amphib units on the Mech Inf unit rather than the tank.
I'm also working to include light armour and artillery for airborne units.
Dan
frekk Feb 22, 2008, 10:00 AM I have two flavours of amphib tanks, light and medium. Light Amphibious Tanks are analagous to the types typically operated by the Soviets and Japanese during the war while the medium type are more representative of the Valentine and Sherman DD tanks used by the Western Allies.
Wasn't the Valentine a light tank? Or fairly close to being one? It's only about half the weight of a Sherman or a Japanese type 3 Ka-Chi amphib tank.
jkp1187 Feb 22, 2008, 10:15 AM Sure, how much do you want? Just remember- I'll always owe it to you, but I'll never cheat you out of it :)
That's good enough for my plan! (http://en.wikipedia.org/wiki/Securitization)
Just thinking....even if Dale decides to take a hiatus from coding for a bit, do you think it would be a huge effort to implement the intercept order? Granted I have *not* looked into the SDK yet (and, to be honest, am still getting my mind around C++,) but intuitively it doesn't seem that implementation would require a tremendous amount of effort to get a bare-bones system working. It would just be a matter of taking the Sea Patrol code, and making it applicable in any circumstance, no? I'd just like to see how it might work, and see if the AI could handle it without major surgery....
Or am I totally off in left field here?
danrh Feb 22, 2008, 12:30 PM Wasn't the Valentine a light tank? Or fairly close to being one? It's only about half the weight of a Sherman or a Japanese type 3 Ka-Chi amphib tank.
About half the weight of the Sherman yes but rather closer to the PzKpfw III to which it is more closely contemporary. Yes the Type 3 Ka Chi amphibious tank was classified as a medium but it was built much fewer number than other types and by the late war period a tank with max 50mm armour and an underpowered 47mm main gun does not compare well with its medium contemporaries amongst the other combatant nations. If I might say though I do quite like the Japanese style of amphib tank, the jettisonable pontoon seeming rather a tidier option than the flotation screen
Dan
Seven05 Feb 22, 2008, 01:45 PM That's good enough for my plan! (http://en.wikipedia.org/wiki/Securitization)
Just thinking....even if Dale decides to take a hiatus from coding for a bit, do you think it would be a huge effort to implement the intercept order? Granted I have *not* looked into the SDK yet (and, to be honest, am still getting my mind around C++,) but intuitively it doesn't seem that implementation would require a tremendous amount of effort to get a bare-bones system working. It would just be a matter of taking the Sea Patrol code, and making it applicable in any circumstance, no? I'd just like to see how it might work, and see if the AI could handle it without major surgery....
Or am I totally off in left field here?
The hardest part would be to 'do it right' and have it read interception chances and evasion chances from XML values. The actual mechanics would be easier depending on how exactly you wanted the interception to work. If you wanted it to simply stop or slow down the moving unit it's probably only 3-5 lines of code, if you want it to engage them it would be a bit more involved especially if you wanted to add some 'sanity' checks like ensuring the intercepting unit hasn't engaged in combat already or it it has it also has the blitz ability or promotion. You should be able to grab the majority of the actual code right from dales mod and then just make some alterations so it applies to naval units.
Edit: Consider that code snipet above a 'SPC' (in this case Special Purpose Code), put your investment funds in there and see what happens :p
|
|