Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3666) Disasters idea
Home

[Freeciv-Dev] Re: (PR#3666) Disasters idea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: MpoloN7@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3666) Disasters idea
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Mar 2003 09:40:48 -0800
Reply-to: rt@xxxxxxxxxxxxxx

MpoloN7@xxxxxxxxxxxx wrote:
> Hi all!
> 
> I was thinking about how the AH Civilization board game had various disasters 
> that could befall your civilization. Similarly, SimCity had them. I think 
> that it could be a great addition to FreeCiv as well.
> 
> Basically, we would need a server option for disasterchance. It would 
> probably default to 5-10% (one player gets hit every 10-20 turns) but could 
> be set as high as 100% or as low as 0%. 

I don't think a disasterchance variable would work particularly well. 
The problem is the probabilities of disasters aren't always fixed.  For 
instance with the 'meltdown' disaster there should be a fixed chance per 
city of getting this disaster each turn.

It should be possible to specify the probability of the disaster in the 
ruleset.  But it is often unclear what this probability means.  For 
instance a 1% probability for meltdown should mean 1% chance of 
meltdown, per city that contains a nuclear power plant, per turn.  But a 
5% chance for an earthquake would mean the earthquake would be anywhere, 
I'd think.  Perhaps the compromise would be to say the listed 
probability is the chance of the disaster occurring anywhere, and then 
the location is chosen afterward.

> Keeping with Freeciv's customizability, I produced a sample disasters.ruleset 
> file (attached) to show where I'm thinking with this.

Yes.

> Is it worth my time to work on this (i.e. does it stand a chance of being 
> accepted as a patch)? If so, could you give me some hints of where things are 
> in the code? (Going through the spy code, I found the functions to reduce 
> city size, transfer ownership, and destroy buildings. What I don't know is 
> how to add a server option, and where the "end_turn" processing is done, as 
> that would be the spot to add it to....)

The idea seems sound, but it is very incomplete so far.  Some other 
things that should be considered IMO:

- Civ1 compatibility.  What disasters were in civ1?  All these should be 
supported.

- Relative disaster probability.  As above: each disaster should have 
independent probability.  These may be tweaked by a server variable 
(perhaps a variable to multiply all probabilities by, or one to just 
toggle disasters on and off).  The disaster probabilities themselves 
should not have to be integer percentages - in the example above, 1% is 
way too high a chance for meltdown.

Or, there could be a compromise: disasterchance is set as a server 
variable, so with a 5% disasterchance there is a disaster 5% of the time 
which is then chosen based on the disaster probabilities in the ruleset.

- City effects versus civilization effects versus global effects.  In 
MoM (Master of Magic) there were civilization-wide disasters like 
pirates stealing gold from your treasury.  There were also good 
"disasters" like a wealthy merchant donating to your treasury.  These 
are civilization effects.  Nuclear meltdown should be a city effect. 
There should also be the possibility for global effects - for instance, 
a tiny probability of an asteroid strike that will damage/destroy a 
small part of the world.

Note all of this necessarily needs to be possible.  But the design 
should take it into account, and shouldn't make it impossible.


Now...

- Server options are in server/stdinhand.c.

- Ruleset stuff is in server/ruleset.c (note the difference between 
ruleset and server options).

- The server loop is in server/civserver.c, in srv_main() IIRC.

jason




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