Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3855 closed defect (fixed)

[PATCH] Health / capture point round error

Reported by: bb Owned by: sanderd17
Priority: Should Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by elexis)

brit, gaul and spartan woman have some round error due to the auto researched tech. Simply rounding in gui and removing roundings from sim will solve the issue.

Screenshot by _kali where a wonder has one more capture point than it should. http://trac.wildfiregames.com/raw-attachment/ticket/3856/Screen%20Shot%202016-03-25%20at%202.07.01%20PM.png

Attachments (2)

womanhealthround.2.diff (1.6 KB ) - added by bb 8 years ago.
t3855_rounding_hpandcp.diff (6.2 KB ) - added by bb 8 years ago.
proper fix

Download all attachments as: .zip

Change History (10)

by bb, 8 years ago

Attachment: womanhealthround.2.diff added

comment:1 by sanderd17, 8 years ago

In 17951:

Round max hp of units in simulation. Refs #3855

comment:2 by sanderd17, 8 years ago

Keywords: patch review removed
Milestone: Alpha 20Backlog

Thanks to bb, we discovered some related issues to this. F.e. the current hitpoints are rounded in GuiInterface, but also in various gui pages (which wouldn't be needed).

And the max hp should probably be rounded in the same places as the current hp.

The same would also count for capture points.

The fix above was made to just modify as few code and functionality as possible (since we're close to release). But this should be investigated further.

So this ticket isn't fixed yet.

comment:3 by elexis, 8 years ago

Summary: [PATCH] woman round error[PATCH] Health / capture point round error

comment:4 by mimo, 8 years ago

You have to be careful when rounding values in the simulation that the same roundings are applied in AIInterface so that the AI is consistent. We had cases in the past with the AI trying endlessly to repair a structure because it did not have the same rounding as in the simulation. There are big chances that the roundings from the patch womanhealthround.2.diff would give troubles, while r17951 should be fine as the Health/Max was already rounded when ApplyValueModificationsToEntity and in AIInterface.

comment:5 by bb, 8 years ago

Keywords: patch review added
Milestone: BacklogAlpha 21

by bb, 8 years ago

Attachment: t3855_rounding_hpandcp.diff added

proper fix

comment:6 by elexis, 8 years ago

Description: modified (diff)

comment:7 by sanderd17, 8 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 18009:

Properly round health and CP values. Patch by bb. Fixes #3855

comment:8 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.