[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[bos-dev] [bug #41967] Resource Usage Not Exact



URL:
  <http://savannah.nongnu.org/bugs/?41967>

                 Summary: Resource Usage Not Exact
                 Project: Bos Wars
            Submitted by: zerted
            Submitted on: Wed 26 Mar 2014 10:44:32 PM GMT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

A power plant is supposed to require 900 energy and 150 magma to create, but
in a custom map with only 900 energy and 150 magma, the engineer runs our of
magma before the power plant is built.  The effects are also seen when having
multiple engineers building the same building.  See #bos 2014-03-20
(http://colabti.org/irclogger/irclogger_log/bos?date=2014-03-20)

The core of the issue is rounding in player.cpp's CalculateRequestedAmount(). 



Options
1) Always use max rates for each resource types until that we've spent the
expected amount of resources - That's not how we want the game to feel.
2) Reduce usage rates to their greatest common factor - Might be surprising
and unintuitive to some players.
3) Switch to floating point calculations - Will cause sync issues in
multi-player.
4) Switch to fixed point integers.
5) Adaptive utilization rates at each step.  Example:  If the rate should be
4.3 for energy, have twice 4 and once 5.


Workaround) Adjust unit costs to reduce rounding errors




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?41967>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/