Terrain damage, Helicopters and Airships

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,699
Location
Near Portsmouth, UK
G&K added Airships (aka hovering units) for the Steampunk scenario, but the implementation is half-hearted and the usual "just enough" to get the scenario working.

The "Crosses Mountains" trait was also added for Carthage, with units taking 50 damage if they end their turn on a mountain, but the implementation uses a hard-coded damage value, and also (weirdly) applies it to helicopters.

These have bugged me since G&K was released, so my current mission is to rectify some of the short-comings, hard-codings and bugs (mainly in the path finder code that doesn't really allow for damage from mountains and does weird things with embarked helicopers being able to sail through ice-floes!) and also to add some other features (eg, being able to hover over both coastal and ocean ice)



If you would like to experiment with the short term goals, the attached zip contains a sample "Units - Steampunk Airships" (and also the latest DLL mod needed by it) and a saved game with a couple of Airships and a Sky Fortress already to take on your foes!

EDIT: See post #22 for the latest versions

Note 1: There are some table updates in the Airships mod which are only in there during testing - eventually they will be moved out into their own mod(s)
Note 2: The deep water embarked code is bugged in the code attached to this post. If you try to enable it within the options xml file, the DLL will crash the game eventually! The code in post #22 should work correctly.

Short Term Goals - ALL DONE
  • Add configurable terrain damage (like feature damage)
  • Replace fixed 50hp damage from mountains with terrain based damage (treat PLOT_MOUNTAIN as TERRAIN_MOUNTAIN)
  • Give mountains a configured damage value of 20hp (down from 50hp)
  • IgnoreTerrainDamage promotion feature
  • IgnoreFeatureDamage promotion feature
  • Give ice a configured damage value of 10hp
  • Give subs the IgnoreTerrainDamage/IgnoreFeatureDamage promotion features
  • Make Helicopters hover over coast, accept they can never embark so cannot enter deep water
  • Make hovering units be able to hover over ice (coast or deep water) taking damage
  • Add Airship as a graphical variant of the helicopter
  • Add Sky Fortress unit which can hover over any terrain taking no damage
Medium Term Goals - ALL DONE, except the two indicated
  • Create a CanCrossMountains promotion feature
  • Create an Alpine Corp promotion (can enter mountains without taking damage) for land units
  • Create a HalfMoves promotion feature (opposite of double moves)
  • Add configurable extra terrain and feature damage
  • ExtraTerrainDamage promotion feature
  • ExtraFeatureDamage promotion feature
  • Create a CanCrossOceans promotion feature (ships may enter the ocean without the required tech)
  • Create an Ocean Explorer promotion (CanCrossOceans plus half moves in oceans plus takes damage from oceans)
  • Give the Viking Longboat UU the Ocean Explorer promotion (not done)
  • Create a DeepWaterEmbarkation promotion feature, such that units embark at the coast/ocean boundary
  • Give hovering units the DeepWaterEmbarkation promotion feature
  • Option for hovering units to be able to attack coastal ships (not done)
Long Term Goals - Some done, others in the testing/planning stage
  • Create a CanCrossIce promotion feature (done)
  • Create an Arctic Corp promotion (can enter ice without taking damage) for land units (done)
  • Create an Ice-Breaker promotion for naval units (thanks to Nutty for this one) (done)
  • Create a CanCrossIce trait feature (done, needs testing)
  • Create a CrossesWithGreatPerson trait feature
  • Create a trait Arctic Nation (CanCrossIce) (for the Innuit?) (done, needs testing)
  • Enable ice on land (glaciers and ice-sheets) - may already be possible, I haven't checked
 

Attachments

  • HelicoptersOverIce.jpg
    HelicoptersOverIce.jpg
    57.5 KB · Views: 959
Ocean Explorer - Free/Gifted Promotion
Units may enter ocean tiles at half rate, but will take damge if ending their turn there


Alpine Corp - Earnable Promotion
Units may cross mountains, and do not take damage if ending their turn there


Arctic Corp - Earnable Promotion
Units may cross ice, and do not take damage if ending their turn there
 

Attachments

  • AlpineCorp.jpg
    AlpineCorp.jpg
    110.7 KB · Views: 947
  • OceanExplorer.jpg
    OceanExplorer.jpg
    101.2 KB · Views: 926
why does a helicopter need to embark at all?

London to Paris by helicopter, certainly.
Rome to Tunis (via Sardina), probably
New York to London (even via Newfoundland, Greenland, Iceland, Scotland), probably not ;)
 
Just curious here. Would it be possible to have Helicopters base on Destroyers/Cruisers? You know, like reality... I get that they fly Bell's and such for naval missions, not Apache's; but we don't ship Apache's to Afghanistan in Troop Transports either. :twitch:

It'd be even cooler if it'd be possible to switch Helicopter behavior when based on warships so that they fly sorties like the other aircraft. Maybe limit it to two choppers per Destroyer/Cruiser and maybe have one chopper slot (separate from the plane slots) on Carrier's.

While I'm on the subject (sort of), what about C-130s/Goliaths/Tupelov TU-330s? Air transport of military units (and their equipment) is completely unrepresented in the game as is, and quite frankly it's a huge hole in "modern" military tactics. Shipping an army of Modern Infantry, Rocket Artillery, etc. via the water is just plain daft...
 
London to Paris by helicopter, certainly.
Rome to Tunis (via Sardina), probably
New York to London (even via Newfoundland, Greenland, Iceland, Scotland), probably not ;)

That would make sense if I couldn't fly endlessly over the entire non-sea map without refueling. If they are going to take dramatic license, as they have with many other things, this seems like a dumb line in the sand is all. :) But, glad you are doing what can be done.
 
Couldn't agree more. It's just where you draw arbitary lines. Personally I don't like the one for helicopters drawn at the tide line, I'd rather it was at the continental slope.
 
I would like see that helicopters goes on water without embarking, but embarking only in ocean tiles and not in coastal. I tried but if helicopter goes on coastal, on ocean too without embarkation. PD: I think that these should embark on ocean because it's not probably cross a large ocean without refueling :p.
 
Chilly out here innit!



Now for a serious code review and testing!
 

Attachments

  • ColdFeet.jpg
    ColdFeet.jpg
    88.9 KB · Views: 96
  • ChillyOutHere.jpg
    ChillyOutHere.jpg
    94.1 KB · Views: 896
  • ArcticCorp.jpg
    ArcticCorp.jpg
    98.6 KB · Views: 904
Who ordered extra ice with their "non-branded fizzy drink"?

 

Attachments

  • ExtraIce.jpg
    ExtraIce.jpg
    53.7 KB · Views: 844
:yeah: This is GREAT.

How will embarking be done for land units on ice? The scout is embarked in post #11 but not in #10. I expect that it has something to do with the scout being on an ocean hex in #11. Is it going to be consistent when you're done?
 
The embarked state in post #11 is/was a path finding bug :blush: (hence the sarky comment about extra ice :lol: )

Units with the "Crosses Ice" promotion will treat ice as land, no matter what it is floating on (coastal/ocean tile). So they will embark from ice into water and disembark from water onto ice

Edit: To give some context to the scale of the "crosses ice" pathfinder complexity, to enable "crosses mountains" and "crosses oceans" took one change each, "crosses ice" has (so far) touched the path finding code at 25 different places!
 
:yeah: This is GREAT.

How will embarking be done for land units on ice? The scout is embarked in post #11 but not in #10. I expect that it has something to do with the scout being on an ocean hex in #11. Is it going to be consistent when you're done?

Maybe that's because in the first image scout has entered by normal terrain tile while in the other has entered by sea :S
 
Maybe that's because in the first image scout has entered by normal terrain tile while in the other has entered by sea :S

Nope! It's a bug - found and squashed ;)
 
  • Create a DeepWaterEmbarkation promotion feature, such that units embark at the coast/ocean boundary

And if I'd realised just how awful the path finding code is I may not have even started this!

But some progress has been made. Now if I could just get the "Ride of the Valkyries" out of my head!



but the path finder is still miscalculating route lengths :(

And I've not even checked what happens at ice/water boundaries yet
 

Attachments

  • DeepWaterEmbarkation.jpg
    DeepWaterEmbarkation.jpg
    72.8 KB · Views: 804
So can you apply CanCrossIce to a naval unit for an "icebreaker" promotion?

No, as that would make the ship think ice was land and hence impassable. Just give the ship PROMOTION_CAN_MOVE_IMPASSABLE - that should do it.
 
No, as that would make the ship think ice was land and hence impassable. Just give the ship PROMOTION_CAN_MOVE_IMPASSABLE - that should do it.

with that promotion the ship behaves like a sub and "submerges"" under the ice, thats rather weird :p
 
Oooh ... didn't know that!

Sounds like more code to write then. (This is getting bigger than I was expecting!)
 
Top Bottom