Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] Space race patches
Home

Re: [Freeciv-Dev] Space race patches

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Space race patches
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sat, 30 Jan 1999 22:59:40 +1100

Falk Hueffner wrote:
> 
> I have worked a bit on the spacerace stuff. 

> begin 644 freeciv-spacerace2.patch.gz
> M'XL("#K9KC8"`V9R965C:78M<W!A8V5R86-E,BYP871C:`#M/&M3VTJRG_&O

Some comments:

> +++ freeciv-01.26-spacerace/client/packhand.c 
> -  pplayer->spaceship.arrival_year=pinfo->arrival_year;
> +  pplayer->spaceship.launch_year=pinfo->launch_year;

Changing packet info/meaning makes the protocol incompatible,
which is problematic.  At this point (ie, with other 
incompatibilities happening leading up to next release) 
this probably isn't too bad and I would favour just using a 
"+spacerace1" tag in the cap string when the next spacerace 
stuff is put in.  

But first we should make sure we have a final complete 
and sufficient protocol for space stuff.  Eg, do we need 
more generality in terms of which modules etc the player 
assigns to each purpse?   Also, it may be better (and more
in line with other freeciv practice) for the server to
do all important calculations (eg, arrival_year above) and
send the result to the client.  Then if the calculations 
change, we don't have to worry about incompatibility of
the server and client using different calculations.

> +++ freeciv-01.26-spacerace/client/spaceshipdlg.c
> +#include <math.h>

Thus far freeciv has avoiding linking libm.  Is it necessary 
at this point?  The floor() instance should be doable via 
ints?  The pow() elsewhere I'm not sure is well motivated: 
see below.

> +++ freeciv-01.26-spacerace/common/game.c
> -void game_next_year(void)
> +int game_next_year(int year)

> +int game_turns_between_years(int year1, int year2)

Out of interest, is travel time now in years or in turns, or...
(That is, what are you doing here? :-)
(Or is this just related to failure chance?)

> +++ freeciv-01.26-spacerace/data/helpdata.txt

+To enable you to build space-ship parts, the Apollo Program wonder
+must have been build by any player. In addition, you need some
+technologies for the different categories of space-ship parts:
+
+ - Space Flight for Structurals,
+
+ - Plastics for Components,
 
+ - and Superconductors for Modules.

Rather, better to see the individual help entries for Spaceship 
Module etc, since these techs can be altered with rulesets.

+If the success probability is below 100%, it is possible that the
+space-ship has to return because of technical problems. You can then 
+make another attempt.

I don't think this is what success probability means in civ1,
where, despite the name, it seems to actually mean the percentage 
of people which survive the trip (and percentage modifier to score
bonus).

> +++ freeciv-01.26-spacerace/server/plrhand.c
> 
> +    turns = game_turns_between_years(pplayer->spaceship.launch_year,
> +                                    arrival_year) - 1;
> +    crash_probability = 1.0 -
> +      pow(spaceship_success_rate(&pplayer->spaceship), 1.0 / turns);

Does this mean the success rate means a per-turn failure chance?
That seems a bit harsh and a different again meaning to
"success chance".

> -    plr->spaceship.arrival_year =
> -      secfile_lookup_int(file, "player%d.spaceship.arrival_year", plrno);
> +    plr->spaceship.launch_year =
> +      secfile_lookup_int(file, "player%d.spaceship.launch_year", plrno);

Hmm, this causes savefile incompatibility, which I consider a worse 
crime than protocol incompatibility, since I want to be able to use 
arbitrarily old savegames even after I upgrade.   :-(

Regards,
-- David











[Prev in Thread] Current Thread [Next in Thread]