Feedback needed: Handling rounding differences

Posts

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Feedback needed: Handling rounding differences

Postby IBBoard at 21 Nov 2009, 12:01

I need some end-user feedback on how it would be most useful to handle one of the situations I've come across (ticket 217).

Basically, if you have a percentage-limited equipment item (e.g. "no more than 10% of the unit can take an X") and give a unit with a size of 11 the item with an amount of 10% then the selection GUI will show that as being equal to 1. If, however, the equipment item itself says percentages should be rounded up then that 10% = 1.1, which gets rounded up to 2, so the number actually taken doesn't tally with the 'hint' in the number box.

As mentioned in the ticket, there are three possible solutions:

1) Ignore the mismatch (but possibly warn about it) because it is the data file creator's fault for setting the upper limit to round fractions down but the amount to round fractions up.
2) Have one fixed rounding for all percentages (upper limit, lower limit and amount), but this limits flexibility
3) Stop percentage selections being rounded outside the numeric equivalent of the percentage limits (which is what I've put in as temporary code).

Now, we've got a functional fix but it requires additional processing that won't always be necessary. It also means we deviate from what the data file actually tells us to do, but given that it tells us to do something that it also tells us is an error then that might be a good thing.

So, any thoughts or opinions? Any other options? Or is our current implementation probably the best and I should just close the ticket?
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Feedback needed: Handling rounding differences

Postby snowblizz at 22 Nov 2009, 09:35

I'm inclined towards 1) as the most flexible solution. But with warnings as there needs to be some protection against errors the user cannot be aware of.

Since we are talking about limits the most likely scenario is where it needs to be rounded down to keep within the limit.

Though 3) seems to be working exactly in the way needed by most common rulesets.
So perhaps use the stricter 3) for now until it becomes absolutely necessary to make it more flexible.

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Feedback needed: Handling rounding differences

Postby IBBoard at 22 Nov 2009, 19:34

The main problem with 1 is that it might confuse users because the "Add equipment item" UI will show that 10%=1, but the unit will end up with two. It probably would be possible to get that to match up as well, but it would need a rewrite of some of the limit calculating code and it would be a bit messy at the moment.

3 does seem to work at the moment, and as you said it seems the most sensible for now. Having an amount rounding up and exceeding a rounded down upper limit is the most likely, although if you have a non-zero rounded-up minimum limit (i.e. "if you take this then you must take at least 25%") and a rounded down item then you could end up rounding below the minimum limit if you took the minimum amount.

I'll release the number 3 fix in tonight's Beta 5 and see how people think it handles.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Feedback needed: Handling rounding differences

Postby IBBoard at 05 Apr 2010, 14:01

No-one has complained about this, so I'm assuming that 1) people aren't making the bad data files and 2) no-one has encountered any problems with this :) It has been in there for a while and a couple of releases now.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Feedback needed: Handling rounding differences

Postby snowblizz at 05 Apr 2010, 14:49

IBBoard wrote:No-one has complained about this, so I'm assuming that 1) people aren't making the bad data files and

Yeah I got better at doing it. :P :P :P

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Feedback needed: Handling rounding differences

Postby IBBoard at 05 Apr 2010, 14:51

One of these days I'll get the time to write an app to help create data files ;) Just got to wait for the wife to get Relic picked up, published and sold to millions of people, then we'll have enough money for me to retire before I'm 30 and I'll be able to work on WarFoundry and other projects more :)
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
Frostlee
Guardsman
Guardsman
Progress to next rank:
 
20%
 
Posts: 60
Joined: 23 May 2009, 22:28

Re: Feedback needed: Handling rounding differences

Postby Frostlee at 05 Apr 2010, 22:21

well, sorry but i have to wait for the italian translation before i culd read it! :D
Image