Complete.Org: Mailing Lists: Archives: freeciv-dev: February 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: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Space race patches
From: Falk Hueffner <falk.hueffner@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: 01 Feb 1999 14:08:52 +0100

>>>>> "David" == David Pfitzner <dwp@xxxxxxxxxxxxxx> writes:

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

    David> Changing packet info/meaning makes the protocol
    David> incompatible, which is problematic.

Well, since the space race is currently not really working, I thought
id wouldn't matter if it was changed. I don't insist on this change, I 
made it because the arrival year is not an int and the server could
use this fact to decide which of two players arrive first if it is in
the same turn. If you think it is better to use the old behaviour, I
could revert it.

    David> But first we should make sure we have a final complete and
    David> sufficient protocol for space stuff.  Eg, do we need more
    David> generality in terms of which modules etc the player assigns
    David> to each purpse?

I think we should probably add 6 fields in the player space-ship
structure for the 6 types. We can think after that how the player will 
get the chance do choose when something is built.

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

    David> Thus far freeciv has avoiding linking libm.

What's the gain in not linking against libm?

    >> +++ 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)

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

yes, just for that.

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

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

Man, this quoting thingie really sucks. I'll see how I can switch it
off :)

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

Right, I didn't think of that.

    >> + 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);

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

I interpreted "success chance" as "100% - the chance that the
space-ship will crash during the whole flight". So I need do know how
many turns the flight has, and in each turn there is a chance of
crashing.

    >> - 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);

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

Hmm, I didn't think about that. I'll fix it.

        Falk




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