Menu

#4258 Princess bot target wrong hex for strategic target

stable 0.40
closed
None
fixed
1
2014-12-17
2014-09-22
Michael
No

version r1978

When selecting a hex as a strategic target during setup or by command in game, princess is adding +1 in both X and Y for the targets location, then determining that no buildings are there.

For example: The game that I am attaching I set hex 2315 as a target hex. The response is: No building to target in Hex (24,16).

This has happened on other maps with other target hexes selected and the +1 to both X and Y coordinates seems to be consistent.

1 Attachments

Discussion

  • Nicholas Walczak

    • assigned_to: Nicholas Walczak
    • Resolution: none --> accepted
    • Milestone: undetermined --> stable 0.40
     
  • Nicholas Walczak

    Fixed in [r11304]. Internally, there are Coords and Hex classes, which represent slightly different things. In general, the X,Y Coords for a particular Hex are off-by-one (0-indexing vs 1-indexing). This means that when turning a Coords X,Y into a Hex string, you need to add 1 to each X and Y and when turning a Hex string into a Coords X,Y you need to subtract 1 from each.

    FireControl.calcStrategicBuildingTargetUtility (line 1180) was doing this properly. Princess.setBehaviorSettings (around line 166) was not.

     

    Related

    Commit: [r11304]

  • Nicholas Walczak

    • Resolution: accepted --> fixed
     
  • Dylan Myers

    Dylan Myers - 2014-12-17
    • Status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB