This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: update material display


On Tue, Oct 07, 2003 at 06:26:15PM +0200, Hans Ronne wrote:
> > The algorithm in the patch I posted
> >checks if the capacity for a material is 99, 999 etc
> >using (storage+1)%10==0
> >and if so decides it is infinite and so displays nothing. In
> >my game of advances, it comes out blank. Only the "capacity"
> >heading is there, which should be OK I hope.
> 
> Yes. There are two problems, however. First, there are no infinite
> capacities: um_storage_x is strictly limited by TABHI (32767 ). I know it
> says in the docs that 99, 999 etc. are used to denote unlimited capacities,
> but this is meant in figurative way, i. e. many game modules use them as
> arbitrarily large (but still finite) numbers.
> 
> The second problem is with side treasuries (a common unit-independent
> storage place for certain materials). They are really unlimited, which is a
> problem right now, since they are vulnerable to numeric overflow. So
> materials with treasuries do have "infinite" capacities.
> 
> A possible fix for your code is therefore to skip the 99, 999 stuff and
> instead set the infinite flag for materials that have a treasury. I have
> already tested such a patch, and it works fine with all games. It draw my
> attention to two other problems, however. First, the above mentioned
> numeric overflow. Second, the fact that functions that modify unit->supply
> do not always check um_storage_x. I have therefore started to fix these
> bugs as well. I will check in both your capacity patch and the necessary
> bug fixes later.
> 
Hi Hans, I am getting every email twice so posting directly to the list.
Just on the 999 stuff, I have a small advance game with 3 cities, and
its giving me a total capacity on Food and Ores of 29997, even though I
am doing a check on the treasury as you say. Looking at advances.g,
cash and ideas are in the treasury, but food and ores are not, so
I will keep testing for 99 etc, unless you can suggest something better,
cheers,
 peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]