Menu

#492 Individual weapon field of fire

stable 0.42
closed
None
1
2015-08-05
2015-05-26
Juliez
No

Hi again,

because the firing arcs still give me a headache, I did this as a suggestion:
It shows the field of fire of a selected weapon, i.e. the intersection of range and arc. FoV is not checked (that would be visual overkill I guess).
It currently works only during movement, but it will also work for a unit that is not the current unit and if it's not my turn.
A graphical distinction from the movement envelope (other than color) could easily be added.
Multiple weapon selection doesnt work :)
Also, because I dont really know the rules of Infantry and Aero nothing is shown for those.

1 Attachments

Discussion

  • Juliez

    Juliez - 2015-05-27

    Slightly altered look (not in the patch above, I just played around a bit more)

     

    Last edit: Juliez 2015-05-27
  • Nicholas Walczak

    Finally got to fiddling with this, and I like the way it looks. I think I'm more partial to the "following the hex borders" look for the first patch, as opposed to the "straight-line" version, although I think I could be swayed either way.

    I do think this is something that should also appear during the firing phase (as it's likely to be pretty useful there). What do you think about coloring lines based on the range?

    It also seems like this should have a toggle somehow. Likely a keyboard shortcut and a menu item.

     
  • Juliez

    Juliez - 2015-06-12

    Hi again,

    finally a first version is ready. It will now show the field of fire for practically any selected weapon of any kind of unit, separated into the range brackets. The brackets are different shades of green as this color is usually not used in the movement envelope. The minimum range bracket is red. Each bracket gets markers in the form of big letters ("S", "M", "L" etc.), therefore I think the brackets are kind of clear even though the color differences are rather subdued.

    The ranges shown will follow those shown in the Unit Display closely. They will however not react to anything target-specific. In the movement phase, the field of fire will follow the considered movement and get adjusted if the movement ends in water. In the firing phase it will react to twists.

    I added another keybind for it. I made it toggle the display of the FoF, although the other idea (hold the key to show) could also be used. I did not create a menu entry for it.

    A few things worth noting (and I probably forgot a few along the way):
    - I stayed with the borders that don't follow the hex borders exactly. This avoids overlap with the movement envelope (which would make stuff really difficult to make out); also I think that the movement envelope must follow the borders exactly as it can be quite complicated and should be very clear. The field of fire areas on the other hand are generally large and easy to understand even when the hex borders aren't followed exactly. This way they are easier on the eye (I admit I'm sensitive there)
    - It is possible to show the FoF for weapons of units of a player who's not the currently active player. There is one limitation there: Ammo changes in such a unit have no effect on the ranges (this is true also for the WeaponPanel itself)
    - While I was preparing the sprites for this I got fed up with rewriting the code for getting suitable shapes yet again, so I added a class called HexDrawUtilities with numerous methods that return hex-related shapes. Using this I shortened the code in the boardview and sprites wherever I could. The HexDrawUtilities calculates the shapes with a perfect hex in mind so they align as best as possible and returns them scaled to the real BV hex. With all the possibilities of the hex face, padding, border thickness and so on there's quite a number of methods in there.
    - I also added a TextMarkerSprite for the bracket markers which could be reused in the future. It shows a String, auto-scaled to fit in the hex. It could be extended to multi-line by separating the String automatically but I didn't need that yet.
    - Since artillery has ranges measured in boards (and I hope I got the rules right here), the ranges for the FoF are hardcoded to an arbitrary 100 for the targeting phase (just to show the arc) and 6-17 for the other phases as this seemed the right range for arty direct fire.
    - Selecting multiple weapons doesn't add anything; the FoF of the uppermost selection will be shown.
    - For infantry there seem to be range types that extend beyond 9 hexes and for which modifiers of +1 and +3 are possible. The FoF simplifies a little here by sticking to the usual range brackets.

    Have fun and apologies for the size of this patch!

     
  • Nicholas Walczak

    Implemented in [r11980].

    I made the default key-binding Shift-R (since movement envelope is R).

    While not 100% necessary, I think that having a menu item would be a good idea to increase visibility of the feature. As it is now, only people who check the keybinds tab will really know that it even exists.

     

    Related

    Commit: [r11980]

  • Nicholas Walczak

    • status: open --> implemented
    • assigned_to: Nicholas Walczak
    • Group: undetermined --> stable 0.42
     
  • Dylan Myers

    Dylan Myers - 2015-08-05
    • Status: implemented --> closed