From: Wong TM (H. Deming) <loo...@ma...> - 2000-09-26 06:37:47
|
> -----Original Message----- > Raimar Falke wrote: > On Mon, Sep 25, 2000 at 01:33:02PM +0100, Michael Grundel wrote: > > Raimar wrote: > > > On Mon, Sep 25, 2000 at 12:54:53AM +0100, Michael Grundel wrote: > > > > > On Sun, 24 Sep 2000, Michael Grundel wrote: > > > A greater problem is the number of turns. I see tow possible solutions: > > > - eastimate from the final year the number of turn (this can't be accurate > > > since the mapping changes) > > > > I don't know the formula, but maybe it can be computed based on the first > > year and the last year? From my legacy code: /** see Freeciv/common/game.c - game_next_year() */ int calculateFreeCivTurns () { int turns = 0; /* this updated formula is the one giving me the bigest headache */ /* add a +1 to this formula to be more accurate */ /* this formula calculate the no. of turn between any two freeciv years (>= -4000) */ /* -4000 <= x < -1000, 50 turns */ turns = Math.abs ( (Math.min (Math.max (startYear,-4000), -999) - Math.min (Math.max (endYear, -4000), -999)) / 50); /** -1000 <= x < -1, 25 turns */ turns += Math.abs ( (Math.min (Math.max (startYear,-1000), -1) - Math.min (Math.max (endYear, -1000), -1)) / 25); /** 0 <= x < 1000, 20 turns */ turns += Math.abs ( (Math.min (Math.max (startYear, 0), 999) - Math.min (Math.max (endYear, 0), 999)) / 20); /** 1000 <= x < 1500, 10 turns */ turns += Math.abs ( (Math.min (Math.max (startYear, 1000), 1499) - Math.min (Math.max (endYear, 1000), 1499)) / 10); /** 1500 <= x < 1750, 5 turns */ turns += Math.abs ( (Math.min (Math.max (startYear, 1500), 1749) - Math.min (Math.max (endYear, 1500), 1749)) / 5); /** 1750 <= x < 1900, 2 turns */ turns += Math.abs ( (Math.min (Math.max (startYear, 1750), 1899) - Math.min (Math.max (endYear, 1750), 1899)) / 2); /** 1900 <= x, 1 turn */ turns += Math.abs ( (Math.max (startYear, 1900) - Math.max (endYear, 1900)) / 1); return (turns+1); } > No. From freeciv's common/game.c:game_next_year() > spaceshipparts= 0; > if (game.spacerace) { > for(i=0; parts[i] < B_LAST; i++) { > int t = improvement_types[parts[i]].tech_req; > if(tech_exists(t) && game.global_advances[t]) > spaceshipparts++; > } > } > > if( year >= 1900 || ( spaceshipparts>=3 && year>0 ) ) > year += 1; > else if( year >= 1750 || spaceshipparts>=2 ) > year += 2; > else if( year >= 1500 || spaceshipparts>=1 ) > year += 5; [...] > else > year += 50; > > if (year == 0) > year = 1; > > It depends on the global advance measured in space ship parts. Yes, the above above code didn't take into account of the spaceship parts. I think we had to change freeciv report.c to include add some header. Deming P.S. I am so very happy :) I received a call for a comfirm position as a assistant engineer while I am editing this mail. To my computer: Now I can give a proper brain and faster heart finally 8-)) . Bad news is I don't have much time as I am now spending 12hr in front of the monitor 8-> |