Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2067 closed enhancement (fixed)

[PATCH] P-51 Mustang improvements

Reported by: scythetwirler Owned by: peter
Priority: Nice to Have Milestone: Alpha 14
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Prevented sinking into water. Kills the plane upon contact with water. Allows one unit to be garrisoned inside. Adds pitch and roll. Made the plane repairable (and not healable). Made the landing look more realistic.

Attachments (2)

mustang.patch (12.5 KB ) - added by scythetwirler 11 years ago.
mustang_sink.patch (610 bytes ) - added by scythetwirler 11 years ago.
Fixes sinking on water.

Download all attachments as: .zip

Change History (12)

comment:1 by sanderd17, 11 years ago

Some comments:

  • The SinkDepth should be a part of CCmpPosition. As it can be re-used for amphibious animals and vehicles. As CCmpPosition already has an element "Altitude", it should probably be named something like "WaterAltitude". And it should also be implemented in CCmpPosition.
  • You should investigate on the difference between the "SetHeightFixed" and "SetHeightOffset" methods of CCmpPosition. While you're descending or ascending, and while you're on the ground. It would be good to use "SetHeightOffset", as you wouldn't have to bother with calculating the difference to the ground every time, nor would you have to bother with that sink depth if it's properly implemented in CCmpPosition. While you're flying at constant height, the usage of a fixed height can indeed give better results.

comment:2 by scythetwirler, 11 years ago

Discussed on IRC with sanderd17.

Patch does not implement the second bullet. Removes the extraneous SinkDepth. Disallows ungarrisoning in midair or when the plane is moving. (credits to sanderd17 for allowGarrisoning patch)

by scythetwirler, 11 years ago

Attachment: mustang.patch added

comment:3 by peter, 11 years ago

Owner: set to peter
Resolution: fixed
Status: newclosed

In 13694:

Make planes about 20% cooler. Fixes #2067.

comment:4 by alpha123, 11 years ago

Thanks for the patch. :)

I changed allowGarrisoning to a sparse array and IsGarrisoningAllowed to just do this.allowGarrisoning.every(function (x) x).

Sorry I forgot to credit you guys in the commit message. :/

comment:5 by alpha123, 11 years ago

Keywords: review removed

comment:6 by sanderd17, 11 years ago

As the ids are strings, and not integers, transforming it to a sparse array doesn't work. So I will fix that again to a normal object (the key gets added, but isn't found with the .every function).

Besides, sparse arrays are dangerous for performance as sometimes it can happen the interpreter handles it as a dense array (thus looping over all members). While objects are always handled as sparse, so don't cause those issues.

comment:7 by sanderd17, 11 years ago

In 13697:

fix (dis)allowing of garrisoning by other components. Refs #2067

comment:8 by fabio, 11 years ago

It looks good, but there are still two problems:

  • plane can disappear out of the map;
  • plane does not sink if you let it move over the water before it flies (let it start and soon after press stop, it moves forward on land and water without flying).

comment:9 by scythetwirler, 11 years ago

Thanks, fabio! Fixed your second bullet. However, I'm not quite sure how to go about the plane disappearing off the map problem (planes could have already gone off the map before landing was implemented).

by scythetwirler, 11 years ago

Attachment: mustang_sink.patch added

Fixes sinking on water.

comment:10 by wraitii, 11 years ago

In 13710:

Fix flying unit not crashing in water when they should. Patch by scythewirler. refs #2067

Note: See TracTickets for help on using tickets.