[Freeciv-Dev] [patch #4224] Max units on tile requirement type

2013-10-07 Thread Goswin von Brederlow
Follow-up Comment #3, patch #4224 (project freeciv):

I would like to be able to set different limits for different types of unis.

E.g. only 3 tanks fit on a tile or 2 helicopters but only a total of 4


___

Reply to this item at:

  http://gna.org/patch/?4224

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4144] freeciv-ruleedit

2013-09-05 Thread Goswin von Brederlow
Follow-up Comment #1, patch #4144 (project freeciv):

How about freeciv-editrules, freeciv-edit-rules?


___

Reply to this item at:

  http://gna.org/patch/?4144

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #20983] single player vs computer

2013-07-23 Thread Goswin von Brederlow
Follow-up Comment #1, bug #20983 (project freeciv):

Unless I'm mistaken the researched bulb are not lost when gaining a tech
through diplomacy with the default settings. So while buying the tech only
saves one turn it also gives a huge leg up for the next tech (since the bulbs
transfer to that).


___

Reply to this item at:

  http://gna.org/bugs/?20983

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #20894] Idea: Mark tiles as do-not-use/force-use in the city map to help with overlaps

2013-06-13 Thread Goswin von Brederlow
URL:
  http://gna.org/bugs/?20894

 Summary: Idea: Mark tiles as do-not-use/force-use in the city
map to help with overlaps
 Project: Freeciv
Submitted by: mrvn
Submitted on: Thu 13 Jun 2013 09:53:51 AM GMT
Category: None
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I have 2 cities A and B like this (simplified and shrunk for this example):

 aaa
ab
aaAa#Bb
ab
 aaa

A is larger and has a city radius of 2.5 while B is small and has a radius of
1. The usable tiles of A and B overlap at #. A has a lot of choices of usable
tiles while B is seriously limited. What happens is that A will claim the #
tile while having perfectly good alternatives while B is desperate to get it.

Or worse, I'm desperate for B to use it while the AI thinks B should use
another tile and A should use it. Then every time A and B change size (or some
other event I can't pin down) B will give up the tile and A will start using
it.


Now here is my idea:

1) In the city map of A I would like to flag the # tile as do-not-use,
preventing the tile from being used by that city. The CMA agent and implicit
reset of tiles on size change would then ignore that tile, take it as blocked
by another city even if it is not.

2) In the city map of B I would like to flag the # tile as force-use. This
could have 3 meanings:

2a) Must use the tile. Force-use can only be set when the tile is used by the
city. If the tile must be vacated due to lack of citizens then the force-use
would expire. Don't like that much.

2b) When picking tiles to use first pick all force-use tiles before any other.
No Specialist may be picked before all force-use tiles are used. But
force-used tiles may remain empty if there aren't enough citizens to fill them
all.
This would survive a city shrinking because a settler was build and
regrowing.

2c) When picking tiles to use first pick all force-use tiles before any other.
The CMA/implicit selection may pick any subset of those tiles if it can't or
doesn't want to pick them all. So specialist may be chosen instead of using a
force-use tile.

Comments?

MfG
   Mrvn





___

Reply to this item at:

  http://gna.org/bugs/?20894

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #20216] Improvements to Cities tab (F4)

2013-06-11 Thread Goswin von Brederlow
Follow-up Comment #3, bug #20216 (project freeciv):

One can show the number of units owned by a city. Unfortunately that includes
units without upkeep.

It would be nice if one could add a column (each) for amount of upkeep food,
shield, gold of each city. The column should show the actual upkeep and in ()
the upkeep without freebies (if different).


___

Reply to this item at:

  http://gna.org/bugs/?20216

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #20890] Better way to display build slots

2013-06-11 Thread Goswin von Brederlow
URL:
  http://gna.org/bugs/?20890

 Summary: Better way to display build slots
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tue 11 Jun 2013 11:35:04 AM GMT
Category: client-gtk-2.0
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

First the progress bar for how much of a unit is build could show more
information. The already build part could be left in a solid color and the
amount gained next turn shown in a light color or half transparent.

Secondly when a city has multiple build slots the city window displays the
progress of building units with a single bar. Instead it could split the bar
into x rows, one per slot, and show how much of each slot is filled (will be
filled).





___

Reply to this item at:

  http://gna.org/bugs/?20890

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] updating rules files, wish the server would warn about issues

2013-06-04 Thread Goswin von Brederlow
Hi,

I recently updated to freeciv 2.4-beta2 and tried to play a old custom
ruleset. Given the age of the rule set it failed to load at all and I
had to update it. Updating from version 1.9 (or even older) rulesets
to 2.4 was quite a leap so some things didn't work right.

The first thing was that the terrain was missing colors and the server
refused to load them. That was easy to spot and the error told exactly
what needed fixing. I give this as a positive example. There was a
problem and the server told me exactly what it was.

After fixing those obvious problems the ruleset did get loaded by the
server but still didn't quite work. The problems became more hard to
spot. For example:

1) No irrigation effect was defined since that simply didn't exist
back then. So units were unable to irrigate at all.

I think the server could give a warning about effects know to exist
but not used. Esspecialy such crucial effects like being able to
irrigate.


2) A veteran diplomat defending a city became invincible. Back when
the ruleset was written there was no veteran system at all. I've added
the default veteran system but did not see that diplomats needed a
custom veteran system. This caused veteran diplomats to be twice as
good as normal ones. With the way diplomat chances are computed this
seem to result in invincible defending diplomats.

I can thing about two ways the server could warn about this:

A) It knows that diplomat chances are suspectible to overflow and warn
if the veteran system is in danger of such. This would require some
reverse calculation to find out at what veteran_power level the
diplomat becomes invincible and warn if that level is reached or exceeded.

B) The code computing diplomat chances could detect that the diplomat
has become invincible and warn (once) about it. This type of check
should generally be much simpler but would need someone to actually
trigger it to become visible.


Comments?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #18087] server segfault on a map with 1.3M tiles

2011-05-02 Thread Goswin von Brederlow
Matthias Pfafferodt no-reply.invalid-addr...@gna.org writes:

 Follow-up Comment #7, bug #18087 (project freeciv):

+#define MAP_MAX_SIZE 4048
Why such a strange number? Shouldn't this be 4096?

 You are right; it was 2048 in an earlier test

+#define MAX_DBV_LENGTH (4 * 1024 * 1024)
Perhaps 4096 * 1000?

 Also OK; at the moment the temperature map is quit problematic. Furthermore,
 there seems to be an endless loop. My computer tried for 5 hours to generate a
 map of size 2000x2000. Memory requirement was at about 700MB but it was not
 limiting ...

Didn't you run into the problem that detecting continents (flood fill)
runs into a stack overflow because it recurses too much?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16777] Having multiple units on a field resizes the large map view

2010-11-28 Thread Goswin von Brederlow

Follow-up Comment #6, bug #16777 (project freeciv):

What commit fixed this?


___

Reply to this item at:

  http://gna.org/bugs/?16777

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17110] Synchronize images for city with city radius

2010-11-21 Thread Goswin von Brederlow

Follow-up Comment #5, bug #17110 (project freeciv):

Why? Resize the array as needed. If you hardcode the size then you will
always have either way to many entries or not enough.

I can also think of having a lot more images than 4 (or actually 8 with city
walls). For example risk of pollution can add a smoke cloud (0-4 none, 5-9
light, 10+ heavy) over the city and risk of plague a red cross (0-4 none, 5-9
small, 10+ large). That would require 72 images.


___

Reply to this item at:

  http://gna.org/bugs/?17110

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17110] Synchronize images for city with city radius

2010-11-20 Thread Goswin von Brederlow

Follow-up Comment #3, bug #17110 (project freeciv):

 You could simply change the number at the end of the description
 tag (city.electricage_city_4 = city.electricage_city_3).

The city radius, except for the first step, is changed by other things than
just size so this won't work. But I see you have already wrote a patch to
make city images an effect too.

One thing though:

+; The maximum number of images is only limited by the maximum size of a
city
+; (currently MAX_CITY_SIZE = 250). The constant is defined in
common/city.h.

With images being an rffect it makes no sense to limit the number of image by
the size of a city. They are really independent.

MfG
   Goswin


___

Reply to this item at:

  http://gna.org/bugs/?17110

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17116] Citizens roles become unrecognisable in large cities

2010-11-20 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?17116

 Summary: Citizens roles become unrecognisable in large
cities
 Project: Freeciv
Submitted by: mrvn
Submitted on: Sunday 11/21/2010 at 01:49
Category: client-gtk-2.0
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: svn trunk
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

When a city grows the icons for each citizen in the city display begin to
overlap and become harder and harder to deciver.

Maybe at a certain size it should show a single icon per role followed by the
number of citizens in that role instead of showing each citizen.





___

Reply to this item at:

  http://gna.org/bugs/?17116

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17110] Synchronize images for city with city radius

2010-11-19 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?17110

 Summary: Synchronize images for city with city radius
 Project: Freeciv
Submitted by: mrvn
Submitted on: Saturday 11/20/2010 at 03:14
Category: client
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

There are images for cities of different size so bigger cities do look bigger
on the map. Currenty the first change happens with size 4. The city radius on
the other hand grows with size 3 (at least in my ruleset).

I think it would be nice if the image for a city would change based on city
radius instead of city size when the ruleset has variable city radii.





___

Reply to this item at:

  http://gna.org/bugs/?17110

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] memory requirement (statistics)

2010-11-17 Thread Goswin von Brederlow
Andreas Røsdal andre...@pvv.ntnu.no writes:

 On Tue, 16 Nov 2010, Matthias Pfafferodt wrote:
 After the increase of the number of players and the map size I did plan a
 check of the memory requirement of the different freeciv versions. I finished
 this now and the attached pdf files shows some results.

 The first two pages show the RAM used by the server as listed by pmap. A
 savefile with the default settings and aifill = X, map size = Y at turn 100
 was loaded. Only one value of X or Y was changed while the other was set to
 10.

 The requirements increase fro release to release; but with 2.3 it goes down
 for bigger maps. I also tested a game with aifill 100 and mapsize 100 - the
 server allocates up to 900MB RAM!

With 2GB ram and 2GB swap I could not play that. I run out of memory.

 The last two slides show the size of the savegame. For small number of 
 players
 and map sizes is is OK. But increasing these numbers the size of the savegame
 increases and, if both are set to 100 the uncompressed savegame reaches a 
 size
 of over 100MB. For such savegames the time needed to compress the data is
 significant.

Full ACK. And the disk fills up quickly with autosave games. Some sort
of rotating would be nice (last 20 saves) or some sparse keeping (keep
games 1,2,3,...,10 turns ago, every 10th turn till 100 turns ago, every 100th 
turn till 1000 tuns ago).

 For the client, the memory consumption is increased from 1.14 to 2.2 (xaw to
 gtk2). After that, nearly no change is visible. The client uses up to 500MB,
 mostly for the graphical toolkit.

 If there are questions please ask.


 These statistics are very interesting. It is a good idea to keep an
 eye on the memory usage, since this would allow the game to scale
 better. Another aspect of memory usage that I would also find
 interesting, is how the memory usage scales when running multiple
 Freeciv servers on the same host. For example, does running 10 servers
 at the same time also require 10 times the memory?

Basically yes.

Although the amount shared is static. The amount not shared goes up map
size and players. So if it was 9.5 times before it now becomes 9.7 times
if you use larger maps / more palyers.


Also the memory usage goes way up with time. More of the map is known to
players and AIs, more cities and units are created and big gotos and war
maps are created. Measuring the memory at the start of the game might
not be the best measurement. Maybe let it play 100 turns and then
measure. Or even better, plot the memory usage after every turn.

Other stats that would be usefull would be statistics about number of
players remaining, number of cities and number of units in the
game. Maybe something someone could patch into the server.

MfG
Goswin

PS: I also found that XOrg uses a huge amount of memory when playing
freeciv. Is freeciv leaking server side pixmaps?

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17015] Would like to have Go Home command for units

2010-11-06 Thread Goswin von Brederlow

Follow-up Comment #4, bug #17015 (project freeciv):

Another feature that is verry simmilar. For wounded military units it would
be great to have a Goto nearest city with barracks so they heal quickly.

Should I open a new bug for that or is that similar enough to be fixed
togeteher?


___

Reply to this item at:

  http://gna.org/bugs/?17015

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17015] Would like to have Go Home command for units

2010-11-03 Thread Goswin von Brederlow

Follow-up Comment #1, bug #17015 (project freeciv):

I would like such a command too although for a different scenarios.

At the start of the game I use wariors to explore. At some point the enemy
has found me and I need to defend my cities. So I want to slect all wariors
and send them to their home city. That way they get evenly spread. Every city
that has build a warior gets defended.

Then I build up to 3 units in each city for defense (and military law under
Monarchy) so over time a nice army gets build. Perfect for selecting all but
one per city (all for internal, safe cities), crank up luxury and go to war.
After decimating some cities of the AI it then becomes time to go home. Again
it would be nice to send each unit to its home town so they get evenly
spread.


For the scenario initialy described the Goto nearest city (G) command seems
sufficient. Or just hit (A), Autosettler move on their own and if you move
them away from the cost they will just go back if that is where the best
improvement can be made.

MfG
   Goswin
 

___

Reply to this item at:

  http://gna.org/bugs/?17015

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17015] Would like to have Go Home command for units

2010-11-03 Thread Goswin von Brederlow

Follow-up Comment #3, bug #17015 (project freeciv):

From my experience they do loose the auto flag when they can't find work and
then you can hit 'G'+'s' to hide them or 'a' to make them try again to find
some work.

Anyway, the feature is still wanted even if for different reasons.


___

Reply to this item at:

  http://gna.org/bugs/?17015

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17006] build raid/farmland with a single command, connect farmland

2010-11-02 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?17006

 Summary: build raid/farmland with a single command, connect
farmland
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tuesday 11/02/2010 at 17:30
Category: client
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

The client has shortcuts to connect 2 tiles with railroad but no shortcut to
build railroad on the current tile (if no road, build road then build rail).
Same thing for farmland and connect with farmland.





___

Reply to this item at:

  http://gna.org/bugs/?17006

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17007] Complex goto to connect with road/rail/irrigate/mine/farmland in one go

2010-11-02 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?17007

 Summary: Complex goto to connect with
road/rail/irrigate/mine/farmland in one go
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tuesday 11/02/2010 at 17:35
Category: client
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

The client can already do goto, connect with road, rail, irrigate over
waypoints. What it can't do is switch jobs between waypoints.

E.g. go to tile A, connect with road to tile B, connect with irigation to
tile C, connect with rail to tile D, build mine.

The goto protocol between client and server is flexible enought o handle
this. All it needs is a way for the user to input the commands.





___

Reply to this item at:

  http://gna.org/bugs/?17007

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16871] Having more AIs than nations segfaults at start

2010-10-27 Thread Goswin von Brederlow

Follow-up Comment #3, bug #16871 (project freeciv):

No. So maybe it wasn't the number but just the wrong format.


___

Reply to this item at:

  http://gna.org/bugs/?16871

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16863] faster goto

2010-10-24 Thread Goswin von Brederlow

Follow-up Comment #10, bug #16863 (project freeciv):

The way it currently works is that every unit is computed on its own with the
map as it currently is. If there is a boat somewhere the goto will happily
move 100 units over that boat to cross a channel of water. Then when the
units actualy arrive at the boat they suddenly notice the boat is gone or
already full by the first few units using it and abort their goto.

Same goes for ZoC or simply enemy units stepping onto your path (unless you
are already at war and it is the last move or something). The unit just
stops.

What would be nice would be to assign the unit a destination and have the
server or client recompute the path when the unit gets stuck.


___

Reply to this item at:

  http://gna.org/bugs/?16863

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16904] Minimap has vertical scrollbar even on large main window

2010-10-24 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16904 (project freeciv):

I'm playing with hex tiles so that will change the critical size somewhat.
I'm assuming you used square tiles.

I would say the minimap should expand if there is space. There really is no
reason for the scrollbar if the window is large enough to allow a full mini
map and the unit infos.

If you fear a reoccurance of the grows to big bug then the size should be
adjustable. Like the main view and message window are seperated by a grip one
can drag to resize just add one of those below the mini map too.


___

Reply to this item at:

  http://gna.org/bugs/?16904

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16863] faster goto

2010-10-20 Thread Goswin von Brederlow

Follow-up Comment #4, bug #16863 (project freeciv):

If I had to solve this I would first build a list of unique units from the
selection. Units that have different tiles, movement points, capabilities,
... Then goto needs to be compute only for those units. This could be still
improved by only using the fastest and slowest unit with comparable
capabilities on each tile.

Similary when moving units build the same list. Move all units on the list
visibly, then move all remaining units invisibily.


___

Reply to this item at:

  http://gna.org/bugs/?16863

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2076] Crazy caravan patch

2010-10-20 Thread Goswin von Brederlow

Follow-up Comment #2, patch #2076 (project freeciv):

Could this be extended to show the homecity of any unit?


___

Reply to this item at:

  http://gna.org/patch/?2076

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16905] Goto and do XXX for caravans

2010-10-20 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16905

 Summary: Goto and do XXX for caravans
 Project: Freeciv
Submitted by: mrvn
Submitted on: Wednesday 10/20/2010 at 14:37
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

It would be nice to have a goto and do

- help build wonders
- enter marketplace
- establish trade route
- keep moving

for caravans. When one has multiple caravans moving around it can be hard to
know what to do with a popup.





___

Reply to this item at:

  http://gna.org/bugs/?16905

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16863] faster goto

2010-10-20 Thread Goswin von Brederlow

Follow-up Comment #6, bug #16863 (project freeciv):

 This could be still improved by only using the fastest and
 slowest unit with comparable capabilities on each tile.

 I am not sure to understand this sentence, but I doubt this is a  good
idea.

Say you have a warrior A (1/3 movement points), a warrior B (3/3 movement
points) and a horsemen (6/3 movement points) on a single tile. Then you only
need to compute the goto for the warrior A (to get the maximum number of
turns) and horsemen (minimum number of turns).

Strictly speaking the path for warrior B might differ from those taken by
warrior A and the horsemen so maybe it isn't worth it. Actualy it might be
good for multiple unit gotos to take paths so that the least number of units
are on any one tile at any one time. I.e. if you have 2 path with the same
cost and 2 units have each unit take one path. But that would be a huge
change in client and server. Not part of this bug. Worth a new bug?



___

Reply to this item at:

  http://gna.org/bugs/?16863

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16874] shield upkeep for units is ignored

2010-10-16 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16874

 Summary: shield upkeep for units is ignored
 Project: Freeciv
Submitted by: mrvn
Submitted on: Saturday 10/16/2010 at 06:54
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: svn 18227
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

When I start a game with default settings, build a city and then build 4
warriors then the GUI shows the 4th warrior needing one shield upkeep but the
cities shield surplus == shield production so the warrior remains free.




___

File Attachments:


---
Date: Saturday 10/16/2010 at 06:54  Name: freecv.png  Size: 0B   By: mrvn

http://gna.org/bugs/download.php?file_id=10805

___

Reply to this item at:

  http://gna.org/bugs/?16874

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16863] faster goto

2010-10-16 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16863 (project freeciv):

Also when actualy doing the goto maybe the client could skip showing each
single unit move. Esspecially when moving 100 identical units from the same
tile.


___

Reply to this item at:

  http://gna.org/bugs/?16863

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16874] shield upkeep for units is ignored

2010-10-16 Thread Goswin von Brederlow

Additional Item Attachment, bug #16874 (project freeciv):

File name: gna_bug_16874-fix_unit_upkeep.patch Size:1 KB


___

Reply to this item at:

  http://gna.org/bugs/?16874

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16874] shield upkeep for units is ignored

2010-10-16 Thread Goswin von Brederlow

Follow-up Comment #1, bug #16874 (project freeciv):

Seems like all upkeep costs are ignored. Settlers don't consume any food
either. Attached a patch that adds the units upkeep costs to pcity-usage[].


___

Reply to this item at:

  http://gna.org/bugs/?16874

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16867] Fails to build: struct packet_server_setting_bitwise not defined

2010-10-15 Thread Goswin von Brederlow

Follow-up Comment #4, bug #16867 (project freeciv):

Marko seems indeed to be right. The generated files weren't removed in clean
so an older version ended up in the debian patch and that causes timestamp
problems. I've made sure they are removed now on debian/rules clean and then
it builds fine.

Please close the bug.


___

Reply to this item at:

  http://gna.org/bugs/?16867

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16871] Having more AIs than nations segfaults at start

2010-10-15 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16871

 Summary: Having more AIs than nations segfaults at start
 Project: Freeciv
Submitted by: mrvn
Submitted on: Friday 10/15/2010 at 16:13
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: svn 18227
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I tried playing a game with 120 AIs (one has to test out the new limit, right
:). But I used an older ruleset that plain doesn't have enough nations. At
start the server picks nations for the AIs and after a few it segfaults, when
it runs out of nations I believe.

Unfortunately I replaced the old nations file with the current default one
without keeping a backup to fix the problem. But it should be easy to
reproduce by commenting out enough nations.





___

Reply to this item at:

  http://gna.org/bugs/?16871

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16867] Fails to build: struct packet_server_setting_bitwise not defined

2010-10-14 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16867

 Summary: Fails to build: struct
packet_server_setting_bitwise not defined
 Project: Freeciv
Submitted by: mrvn
Submitted on: Thursday 10/14/2010 at 12:00
Category: client
Severity: 5 - Blocker
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99+svn18226
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

Compiling revision 18226 fails with:

make[3]: Entering directory
`/home/mrvn/src/freeciv/trunk/build-xaw3d/client'
  CC options.lo
../../client/options.c:3451: warning: 'struct packet_server_setting_bitwise'
declared inside parameter list
../../client/options.c:3451: warning: its scope is only this definition or
declaration, which is probably not what you want
../../client/options.c:3451: warning: no previous prototype for
'handle_server_setting_bitwise'
../../client/options.c: In function 'handle_server_setting_bitwise':
../../client/options.c:3453: error: dereferencing pointer to incomplete type
...

The struct packet_server_setting_bitwise is not declared in any header and
was introduced in revision 18214. Seems like some of the patch was lost.





___

Reply to this item at:

  http://gna.org/bugs/?16867

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16809] Barbarian/Pirates should have skill levels

2010-10-13 Thread Goswin von Brederlow

Follow-up Comment #4, bug #16809 (project freeciv):

Any new barbarian should be easy and any new pirate should be hard.
As player I won't know when barbarians or pirates are created unless they are
near my cities, right? It would also be anoying having to set them every
time.


___

Reply to this item at:

  http://gna.org/bugs/?16809

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16808] Civil war should clone the AI level

2010-10-13 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16808 (project freeciv):

Maybe a server setting is appropriate then switching between using the same
difficulty and the default difficulty.


___

Reply to this item at:

  http://gna.org/bugs/?16808

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16809] Barbarian/Pirates should have skill levels

2010-10-13 Thread Goswin von Brederlow

Follow-up Comment #6, bug #16809 (project freeciv):

Just for fun. Some incentive against building coastal towns.
Inland save, coast unsafe.


___

Reply to this item at:

  http://gna.org/bugs/?16809

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16809] Barbarian/Pirates should have skill levels

2010-10-06 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16809 (project freeciv):

But what if I want weak barbarians and mean pirates?


___

Reply to this item at:

  http://gna.org/bugs/?16809

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16812] Cities report should show revenue from trade routes

2010-10-06 Thread Goswin von Brederlow

Follow-up Comment #1, bug #16812 (project freeciv):

To be clear currently it shows just 4 when a city has 4 trade routes. I
want that to show 4 (+10) when the 4 trade routes produce 10 extra tade. So
only a minor change.


___

Reply to this item at:

  http://gna.org/bugs/?16812

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16809] Barbarian/Pirates should have skill levels

2010-10-02 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16809

 Summary: Barbarian/Pirates should have skill levels
 Project: Freeciv
Submitted by: mrvn
Submitted on: Sunday 10/03/2010 at 00:34
Category: ai
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99+svn18101
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I have both barabrians and pirates in my game and the AI is listed as skill
level Easy. There should be a setting what level they get when they are
created and that should have an effect on how dangerous they are.





___

Reply to this item at:

  http://gna.org/bugs/?16809

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16778] Client segfaults when buying while the cities report is open

2010-09-30 Thread Goswin von Brederlow

Additional Item Attachment, bug #16778 (project freeciv):

File name: freeciv-T0002-Y-3998-manual.sav.bz2 Size:19 KB


___

Reply to this item at:

  http://gna.org/bugs/?16778

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16778] Client segfaults when buying while the cities report is open

2010-09-30 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16778 (project freeciv):

Seems to be hapening in just any game. Attached a game anyway. Load game,
press f4, sort by Currently Building, select Michelangelos Chapel and press
buy.


___

Reply to this item at:

  http://gna.org/bugs/?16778

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16793] Diagonal/sperical multiple selection box (for hex tiles)

2010-09-30 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16793

 Summary: Diagonal/sperical multiple selection box (for hex
tiles)
 Project: Freeciv
Submitted by: mrvn
Submitted on: Thursday 09/30/2010 at 18:04
Category: client
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I love using the multiple selection box to manage a line of road builders
(late in the game I just build road everywhere).

In a game with square tiles you can arange your workers horizontally and
vertically and select a whole line by right clicking+draging a selection box
over them.

In a game with hex tiles though you have vertically NW-SE and NE-SW facing
lines, 3 axis instead of 2. It would be nice if one could select along any of
the three axis.

It would also be nice to have a selection mode with center and radius
instead. Instead of a box it should have a hexagon when using hex tiles.





___

Reply to this item at:

  http://gna.org/bugs/?16793

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16776] Research report isn't updated when changing governor in cities report

2010-09-29 Thread Goswin von Brederlow

Follow-up Comment #1, bug #16776 (project freeciv):

Same when changing tax rates.

___

Reply to this item at:

  http://gna.org/bugs/?16776

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16777] Having multiple units on a field resizes the large map view

2010-09-29 Thread Goswin von Brederlow

Follow-up Comment #2, bug #16777 (project freeciv):

I've been seeing this for a long time now. Can't say if it was fixed in some
versions I didn't use but it is still present in a recent svn checkout
(revision 18101).


___

Reply to this item at:

  http://gna.org/bugs/?16777

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16777] Having multiple units on a field resizes the large map view

2010-09-29 Thread Goswin von Brederlow

Follow-up Comment #3, bug #16777 (project freeciv):

Oh, and yes, that is the same behaviour as #15504. Just a different cause.
Probably a different solution too since it should just display less units
before adding the '' icon.


___

Reply to this item at:

  http://gna.org/bugs/?16777

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16776] Research report isn't updated when changing governor in cities report

2010-09-28 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16776

 Summary: Research report isn't updated when changing
governor in cities report
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tuesday 09/28/2010 at 16:24
Category: client-gtk-2.0
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99+svn18101
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

I wanted to see the effect of different governors on my research. So I opened
the cities report (F4) and the research report (F6). Then I selected all
cities and changed the governor. The amount of bulbs in the research report
does not change. Closing and reopening the research report displays the new
value.





___

Reply to this item at:

  http://gna.org/bugs/?16776

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16777] Having multiple units on a field resizes the large map view

2010-09-28 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16777

 Summary: Having multiple units on a field resizes the large
map view
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tuesday 09/28/2010 at 16:40
Category: client-gtk-2.0
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

When you have multiple units on a square the gtk client shows the ative unit
and below that other units on the same square. Now when there are too many
units to show all it shows a '' to indicate more units. Unfortunately the
'' makes width greater than it normaly is and resizes the large map view.
When one changes to a different unit that is alone on a tile (or only one or
two other units) the '' disapears and the large map view is grown again.

Overall this causes the large map to shift and flicker during gameplay and if
the window is just the wrong size it causes a lengthy map redraw every time it
grows (when the larger size has more tiles than the small).





___

Reply to this item at:

  http://gna.org/bugs/?16777

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16778] Client segfaults when buying while the cities report is open

2010-09-28 Thread Goswin von Brederlow

URL:
  http://gna.org/bugs/?16778

 Summary: Client segfaults when buying while the cities
report is open
 Project: Freeciv
Submitted by: mrvn
Submitted on: Tuesday 09/28/2010 at 19:51
Category: client-gtk-2.0
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.99+svn18101
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

Opening the cities report (F4), sorting by Currently Building and then
buying something causes a segfault.

The problem seems to be that the client stores NULL entries in the gtk tree
in merge_list_stores(). This causes the compare function to be called with a
NULL string which segfaults when it tries to split it.

As a workaround I patched
int cityrepfield_compare(const char *str1, const char *str2)
to handle NULL strings. This avoids the segfault but then GTK complains
about

(freeciv-gtk2:6001): Gtk-CRITICAL **: gtk_list_store_move_after: assertion
`!GTK_LIST_STORE_IS_SORTED (store)' failed

and the list of cities shown in the report becomes incomplete. Closing and
reopening the report fixes that.

Patch attached.

MfG
   Goswin




___

File Attachments:


---
Date: Tuesday 09/28/2010 at 19:51  Name: freeciv-cities-segfault.patch  Size:
525B   By: mrvn
Prevent segfault when buying things. Does not fix the real problem.
http://gna.org/bugs/download.php?file_id=10494

___

Reply to this item at:

  http://gna.org/bugs/?16778

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Longturn Freeciv

2010-07-01 Thread Goswin von Brederlow
Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:

 Am Tuesday 29 June 2010 22:59:03 schrieb Andreas Røsdal:
 * Server architecture:
 The current single-threaded architecture of the Freeciv server will also
 be a limitation for large Longturn games. The server should probably be
 multithreaded to be more scalable. Would this be realistic?

 No idea here.

Is the server actually taking so much time? I think the worst time hog
is the AI. Split that out into seperate threads and things should
improve greatly.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] AI Documentation Tips

2010-05-25 Thread Goswin von Brederlow
Bernd Jendrissek bernd.jendris...@gmail.com writes:

 On Mon, May 24, 2010 at 6:15 AM, Goswin von Brederlow goswin-...@web.de 
 wrote:
 I would also like the AI to run as seperate client (that way it can't
 use privileged information from the server at all) or at least seperate
 thread. In large maps the AI takes a majority of the time and nowadays
 multi-core systems are more and more common. Freeciv would run 4 times
 as fast here with the AIs spread over 4 cores.

 Just for the record, I'm making a bit of progress again on my
 client-side AI experiment.  I'm back to sending settlers off to found
 cities, this time in a less arbitrary and hardcoded way.  I'm somewhat
 surprised by how well it picks out city sites, given the crudeness of
 its calculation.  I'd be delighted to share patches with anyone who's
 curious, but this is really just a hacking-for-fun effort: expect no
 academic papers on it.

Url?

 I think I've chatted to you about some stuff that flew right over my
 head, some stuff about Voronoi diagrams and convex hulls.  Frankly, I
 don't understand any of it!  I like your proposal for a wear
 algorithm (read: I can at least understand how to implement that).

Well, a Voronoi diagramm is quite simple. For every city associate every
tile with the city nearest to it. Those tiles that have multiple nearest
cities form the lines in the Voronoi diagramm.

But you probably mean a Delaunay-Triangulation, which you can create
from a Voronoi diagramm. A triangulation means you cover the whole map
with triangles with the cities in the corners so that there are no
gaps or overlaps. The special property of a Delaunay-Triangulation is
that the inner angles of the triangles are maximised. So no thin wedges.

You could build roads along the edges of such a triangulation. That
probably gives you a good way to go from any city A to any city B by
road wich is no more than twice (pulled completly out of the air but
there is probably such a limit. Just a feeling) as long as the direct
way. And that with probably a minimum amount of road building.


But I'm wondering if that is really such a good way to build roads. The
map resolution is too small and going diagonal costs the same as
straight. The shortest path between two cities is not a line. It is a
series of left, right, up, down and across steps. And in no way is there
just ONE shortest path.

Maybe the following is more usefull and still simple to understand.
Every tile gets a want road count. Each time a unit wants to go from A
to B it finds shortest paths imagining there were roads everywhere. It
adds up max(0, limit - want road), call it penalty, for each such tile
that doesn't have roads and picks the shortest path with least penalty
(or possibly all such paths). Then along the path each want road count
is increased (increased by a fraction if there are multiple paths).
Building road then becomes a matter of finding tiles with high want
road count.

As you can see the algorithm has a feedback loop. Tiles that other units
would have used are prefered. My hope is that thereby paths would share
tiles resulting in less roads being needed. But only when it doesn't
delay the journey.

 The one thing that may (or may not, I'm not familiar with the current
 AI code) be new is that my struct strategy understands the time value
 of money.  Founding a mediocre city in 2 turns is, in some cases,
 better than founding a good one in 20.  Also, struct strategy knows
 about purposes and dependencies: it has a way of encoding that to move
 a (nonexistent) unit, you have to build it first.  Intuitively, both
 these features feel very right.  Time will tell if they prove to be
 a lasting asset.

That is highly dependend on the level of your civilization. At the start
you want to build many small cities near each other. As time goes on you
want to have large cities with enough room inbetween. But if you don't
build cities where migration will eat them up anyway then you already do
this.

But there is another factor. At the start you have to build where a
starting city will do great. As time goes on you learn how to transform
terrain and have the workforce to do so. At that point city placement
becomes more and more about space. Who cares if there is a desert around
the town? You just change it. At that point you have to calculate what
the city can become andhow much it is going to cost to transform the
tiles for it.

It is also highly likely that space becomes limited by either ocean or
enemies. At what point is it better not to build a city somewhere
because it would just limit the surrounding cities? Or do we build a
city in a bad spot so it can migrate into another and help it grow
beyond 8? Keeping a settler around costs every turn. Sometimes it is
better to waste it than to keep it.

 I'm not sure if the AI really needs long-range strategy.  At the
 moment everything seems okay with a stateless model, where each new
 turn starts a fresh cycle of planning.  In a sense

Re: [Freeciv-Dev] New AI

2010-05-25 Thread Goswin von Brederlow
David Lowe doctorjl...@verizon.net writes:

 On 23 May, 2010, at 10:15 PM, Goswin von Brederlow wrote:

 An argument for seperate AI clients would also be that it makes
 developing the AI more fun.

   I like this idea.  Battle For Wesnoth has an API so that people
   can try their hand at making a new AI.  AIs used to be python
   scripts, but that was removed for security reasons.  One of the
   goals now is rewriting the API for Lua.

 Or you can easily play different versions of the AI
 against each other.

   This is true genius.  Being able to use a different AI is good,
   but having multiple AIs available in the same game is great.  If
   i'm not mistaken, Civ3 nations have unique 'personalities'.
   Some are more defensive while others are more aggressive.  Also,
   pitting them against each other would be the best way to test
   them out.

 Sent from my MacBookPro

 I wasted time, and now doth time waste me. William Shakespeare

Always play as Zulu or they will slaugter you. :)

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] AI Documentation Tips

2010-05-23 Thread Goswin von Brederlow
Israel israel_...@yahoo.com.br writes:

 Hello,

 I am interested in working on FreeCiv AI, and would like to know if there is
 any documentation or begin reading this doc to help me. It's my first 
 contact
 with the freeciv code, so maybe I should start from something more general 
 than
 the AI itself.

 I have already downloaded the source code (altough not compiled it yet) and
 read these wiki articles:
 http://freeciv.wikia.com/wiki/AI_Documentation
 http://freeciv.wikia.com/wiki/AI_Plans

 I'm a brazilian civ fanatic (but no relation with civfanatics.com) and 
 actually
 studying in a Master in Computer Science course. I have some ideas that may
 improve freecivs' AI global decisions, more specifically what each city will
 build in a turn. But first I would like to understand better how it is done
 today, so I can evaluate if my idea makes sense or not. If the results are 
 good
 I plan to use them on my final work and, of course, make it part of the main
 freeciv code (if it is good to the project too).


 Thanks for any help

 Israel

Personally I think it would be a good idea to scrap the AI and start
again. The code has so much bitrot in it and the rest of freeciv has
changed so much that bringing it up to date might just be more work.

I would also like the AI to run as seperate client (that way it can't
use privileged information from the server at all) or at least seperate
thread. In large maps the AI takes a majority of the time and nowadays
multi-core systems are more and more common. Freeciv would run 4 times
as fast here with the AIs spread over 4 cores.

An argument for seperate AI clients would also be that it makes
developing the AI more fun. You can start your game and play it a bit
and when you notice something off you kill the AI, fix the issue and
restart the AI all without stopping the game. Or when the AI crashes the
game continous. Or you can easily play different versions of the AI
against each other.



As to what is wrong with the AI here are a few things:

- road/rail building

Road/raid is build by looking at a tile and its neighbours. Building a
road/rail when two neighbours have one connects them so it gives that a
big bonus. Apart from that it looks where roads would be beneficial to a
city. More or less.

Here one could do 3 thinks to improve this:

1) plan to connect 2 cities with a road/rail, find a good route for the
road/rail and then send worker to the affected tiles. Also consider
road/rails to future cities.

2) keep track of where units move. Tiles that units cross a lot need
road/rail first.

3) If you are a worker and you are on a tile without road/rail then build
one before doing whatever you were doing.


- Explore near your land

Explorers move in a way that discovers the most hidden tiles. But what
use it discovering a hidden tile at the other end of the earth if there
is one right next to your city? The score for tiles should be weight by
the distance from the border. Also, with fog of war, the time since a
tile was visible last should be considered. Have the exporers revisit
tiles to see if maybe someone moved in. In effect, after an initial time
of discovering hidden tiles, the explorers should become a border patrol.


- Pick a job and stick with it

Often you see units move towards A and the next turn they all move back
again. That easily repeats. That is just a collosal waste of time. If
you decide to attack with an unit then stick with it for a while. Rember
that you were going to attack something across turns.


- Pick a target and coordinate attacks

This would massively improve the AI, possible to the point where it
becomes anoyingly hard to beat.

Currently afaik each unit on its own decides wether to atack something
and if so then what. Instead it should find something to attack and then
gather a force by finding idle units near it. If a sufficient force is
ready then units should be moved so they all end up attacking the target
at the same turn with a full move left. Since stacking units too deep is
dangerous they could also come in waves. And don't forget to put a good
defensive unit in each stack that won't attak (so it keeps up its
strength).

Building a road/rail towards the target can also help greatly.


MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [patch #1349] Rework (+fix) auto-settler code

2009-11-02 Thread Goswin von Brederlow
Pepeto pepet...@gmail.com writes:

 Le dimanche 01 novembre 2009 à 16:16 +0100, Goswin von Brederlow a
 écrit :
 pepeto no-reply.invalid-addr...@gna.org writes:
 
  Update of patch #1349 (project freeciv):
 
Status: In Progress = Ready For Test
   
 
  ___
 
  Follow-up Comment #2:
 
  Updated version of the patch against current svn.
 
  Also:
  * Remove potential crash on tile_index(NULL).
  * Cleanup in build city stuff:
* All settlers use the same pf_parameter.
* Units dying are not considered as a failure.
 
 If you have too many auto settler some will remain idle. If one dies
 then it should retask one of the idle ones.

 Yes, it doesn't change that behaviour.

* Units which don't reach the position at the turns are not considered 
  as a
  failure.
 
 If a unit can't reach its destination it should pick some other
 task. The failure makes the outer loop repeat assigning tasks.

 Yes, I agree, and it does that.  I am talking about the settlers able to
 reach their destination but the path is too long to be reached in one
 turn.  In your patch for building city, they were considered as failed
 mission.

Should have read the diff between the two patches.

The patch currently never releases auto-worker when there is nothing
to do. The old code made them not auto-workers so human players could
assign them new roles. I would like to use something inbetween. Have
them keep their auto flag but bring them into focus in the
client. If the client assigns no new activity to them they stay
auto-worker and do more work whenever some comes along.

Any idea how to do that?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #14621] Cities not refreshed when crossing Empire_Size_Step

2009-10-29 Thread Goswin von Brederlow
pepeto no-reply.invalid-addr...@gna.org writes:

 Follow-up Comment #3, bug #14621 (project freeciv):

 Only every 10/11/12/14 cities added. This also needs to happen
 when a city is lost.

 Were you planning to post a patch?

Not me.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [patch #1234] more than one build slot for units

2009-10-28 Thread Goswin von Brederlow
Matthias Pfafferodt no-reply.invalid-addr...@gna.org writes:

 Follow-up Comment #4, patch #1234 (project freeciv):

 The problem I see is that this makes it rather unpredictable
 how many units will be build. Even if you have 2 or 3 build
 slots that does not mean you will build 2 or 3 units of each
 type. That depends on the surplus of shield. 

 This was planned as a possibility to use the production of big cities.
 Without this, these cities would accumulate shields with no possibility to
 use them. I restricted the possibility to units without population cost so
 that you can expect that will happen.

 Would a checkbox, which is only active if such a unit is build be OK? Using
 the checkbox you could choose if 1,2,3...x units should be (tried to) build
 next turn. This would also be the visual indicator for this feature.

What is wrong with building the next unit in the list and possibly
showing the number of turns required as 0 for all but the first of a
set?

And in your mode what would happen if I set it to 3 and it only
completes 2? Would one remain on the list?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [patch #1234] more than one build slot for units

2009-10-28 Thread Goswin von Brederlow
Matthias Pfafferodt no-reply.invalid-addr...@gna.org writes:

 Follow-up Comment #5, patch #1234 (project freeciv):

 What is wrong with building the next unit in the list and
 possibly showing the number of turns required as 0 for all but
 the first of a set?

 I think this would be to powerfull (space ship?).

Not a unit and putting 2 space ship components into the list would be
the same as clicking the 2 box in your system. I'm not arguing about
changing what gets build. Just how to account for/coordinat that with
the build list.

I'm perfectly fine with building just one Diplomat if you have a
Diplomat and an Armor in the build list. But if you have 2 Diplomats
and then an Armor and enough shields it should build 2 and remove 2
from the build list.

Lets explain it this way: The unit type build can only be changed once
a turn but it will produce as many units as are queued up and shields
allow.

Diplomat, Armor, Diplomat, Armor takes always = 4 turns.
Diplomat, Diplomat, Armor, Armor takes = 2.
Armor, Coinage builds exactly one armor and coinage the next turn.
Freight will build as many Freights as possible each turn.

 And in your mode what would happen if I set it to 3 and it
 only completes 2? Would one remain on the list?

 As one can estimate the amount of shields available (stock + production) only
 the max. number you could reach with the shields available would be active.
 This number would further be restricted by the number of build slots.

The build list can be long, the city can grow or shrink many times
during that time. You can easily gain or loose build slots as well as
change shield production and shields stored.

Even in the same turn you can disband units and gain more shields that
way and suddenly more slots are able to be filled.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #14585] Wish: timeout progress bar

2009-10-27 Thread Goswin von Brederlow
Michael Kaufman kauf...@physics.wisc.edu writes:

 interesting idea, and easily doable. In fact a nice little project for
 someone wanting to get their feet wet.

 Add a timing struct for each AI. Each turn for each AI, calculate the time
 it takes for various major actions (city management, unit management) and
 store that time. Use number of cities and units and time previous turn took
 as a predictor. Add all AI times together for interturn prediction. I imagine 
 that the prediction would be pretty good.

 M

 
 What I ment was not the timeout of a turn (which gets counted down) but the
 time the server needs between turns. I.e. the time from pressing turn-done
 till one can move again. In large games I have seen it take from 1 to 20
 minutes.

Might be overkill to even split this up. Plainly measure the time each
turn takes and average the last 10 turns.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Build tests with FullMoon

2009-10-27 Thread Goswin von Brederlow
Marko Lindqvist cazf...@gmail.com writes:

 For a couple of years now I have been testing freeciv building on
 several environments. Results of these builds are at
 http://www.cazfi.net/freeciv/testing/compilation.php
 These builds are not fully automatic nightly builds but have to be
 initiated manually.

 I'm also developing (nightly) build tool called fullmoon (
 http://www.cazfi.net/fullmoon/ ). I'm using freeciv building as test
 case for fullmoon. This should benefit both projects. Now I'm nearing
 the point where fullmoon can start sending emails to this mailing list
 about failed nightly builds.

Does that include running a testgame with just AIs and an observer for
every client?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] Migration and Pyramids: Was: Freeciv patch #1235: [Metaticket] variable city radii

2009-10-19 Thread Goswin von Brederlow
Goswin von Brederlow goswin-...@web.de writes:

 Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:
 My biggest city is size 17 so far. I will have to see if the plague
 allows the city to grow to size 30 at all.

 Did you try the experimental ruleset? There, some buildings with a 'health' 
 effect are added. This means, that the possibility of an illness is reduced. 
 Furthermore you could check the corresponding wiki page 
 (http://freeciv.wikia.com/wiki/Math_of_Freeciv).

 Matthias

 Hospital, genlab and cure for cancer help a lot. Biggest city is now
 size 54. 270+ production in that city. I didn't merge changing unit
 upkeep from shield to gold in my ruleset. I have tons of shield but
 never enough gold.

 Given the amount of pollution, even with recycling I will have to
 destroy the Hover Dam and build solar plants instead.

 MfG
 Goswin

I actualy went and fixed the ruleset so that solarfarm still reduces
pollution to 0 even with Hover Dam and Recycling Center. That really
helps. Biggest city now 125.

I have to say that the Pyramids combined with a Granary are made even
more powerfull by migration now. Initially with Pyramids and Granary
in a size 2 city one can buy a settler every turn and the city just
pops back up to size 2. This allows for a rapid expansion of ones
empire giving one a huge headstart.

Now, with migration same thing happens. A citizen migrates and the
city just pops back to size 2, thus giving a steady stream of migrants
to grow a city. So even when expansion stops you still get a huge
grows benefit throughout the rest of the game.

I also believe the migration is done every 5 turns with a 50% change
for the source city (default). That means surrounding a large city by
10 small cities will (on average) grow the large city by 1 each turn.
Maybe there should be at most one migration to the same city per
5 turns. I.e. people can only migrate to a city that didn't already
recieve migrants in the last 5 turns. Currently migration is more
powerfull than rapture.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Freeciv patch #1235: [Metaticket] variable city radii

2009-10-14 Thread Goswin von Brederlow
Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:

 [...]
  city_radius_sq = 5 = city_radius = 2
  mgr_dist = 2
  max distance for migration (tiles) = 2 + 2 =4
 
  city_radius_sq = 10 = city_radius = 3(.1) = 3
  mgr_dist = 2
  max distance for migration (tiles) = 3 + 2 =5

 Yes, that is along the lines of my though.

 a new patch is available implementing radius_sq and this definition of the 
 migration distance


 Defining max distance for migration (tiles) = radius1 + radius2 + X
 would make things more difficult I guess. radius2 won't be known so
 you would have to assume the maximum, scan for cities and then check
 if their radius is big enough for migration.

 But just radius1 + X should be easy to code.

 [...]
 Actualy I thing something like that is already needed. The road/rail
 building AI currently has no notion of connecting cities, only
 adjacent tiles. With city_min_dist raised that performes really bad.
 If a city knew the surrounding cities the auto-worker could build a
 road on a line between two cities.

 But a lot of AI code needs a fresh look and redesign I feel.

 This is known but nobody takes this job. I still have one thing open:  bug 
 #13599  [RFC; patch] pollution on lakes / ocean 
 (https://gna.org/bugs/?13599). But it is really hard to understand the ai 
 code ...


  But is it too much work? If I understood migration right then it is
  done only once every 5 turns.
 
  That's right. Migration is checked every fifth turn after a city was
  founded (default settings).
 
  Does the variable city radii work for you?

 Seems to work great so far. I'm not sure the plague settings are fine
 tuned yet though. I have a large food box and cities always get plague
 before hitting size 12 an requiring a Sewer System. The plague
 effectively obsoletes the size 12 limit except when migration happens
 a lot and the city shoots up. Not sure if that should be that way.

 My biggest city is size 17 so far. I will have to see if the plague
 allows the city to grow to size 30 at all.

 Did you try the experimental ruleset? There, some buildings with a 'health' 
 effect are added. This means, that the possibility of an illness is reduced. 
 Furthermore you could check the corresponding wiki page 
 (http://freeciv.wikia.com/wiki/Math_of_Freeciv).

 Matthias

Hospital, genlab and cure for cancer help a lot. Biggest city is now
size 54. 270+ production in that city. I didn't merge changing unit
upkeep from shield to gold in my ruleset. I have tons of shield but
never enough gold.

Given the amount of pollution, even with recycling I will have to
destroy the Hover Dam and build solar plants instead.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Freeciv patch #1235: [Metaticket] variable city radii

2009-10-10 Thread Goswin von Brederlow
Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:

 Am Saturday 10 October 2009 09:54:26 schrieb Goswin von Brederlow:
 Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:
  Am Thursday 08 October 2009 01:43:23 schrieb Goswin von Brederlow:
  On a related matter, how does migration work with the patch?
 
  The patch says the city radius is considered. Does the other city need
  to lie within the city raidus? Do the city radius of both cities need
  to overlap? Can there be a gap of x tiles between the city radii of
  both cities?
 
  I think the migration distance config option should select this, e.g.
 
  -99: city must lie within city radius
  -x: city radii must overlap
  0: city radii must touch
  x: there may be x tiles between city radii
 
  I think a default of -1 would make sense.
 
  At the moment migration is defined by a migration distance (1 to 7). The
  patch #1232 adds the possibility to set the migration distance to 0. In
  this case, the migration distance depends on the city radius (migration
  distance = city radius + 1; your case 0).

 I will definetly want to have more choices there.

 The migration distance setting could also be defined as the value added to 
 the 
 current city radius. This would require a change of the current definition 
 (name). Example:

 city_radius_sq = 5 = city_radius = 2
 mgr_dist = 2
 max distance for migration (tiles) = 2 + 2 =4

 city_radius_sq = 10 = city_radius = 3(.1) = 3
 mgr_dist = 2
 max distance for migration (tiles) = 3 + 2 =5

Yes, that is along the lines of my though.

Defining max distance for migration (tiles) = radius1 + radius2 + X
would make things more difficult I guess. radius2 won't be known so
you would have to assume the maximum, scan for cities and then check
if their radius is big enough for migration.

But just radius1 + X should be easy to code.

  As for the migration one has to check all tiles within migration radius
  of the receiving city for giver cities the radius should be as small as
  possible.

 If checking the tiles is too expensive then cache the result:

 When creating a city check if it is within the migration radius of
 another city and link it into a migration list for that city. When
 the city radius of a city changes (and therefor migration radius) then
 scan the area once to rebuild the list.

 This list has to be updated every time a city is created or destroyed. 
 Furthermore it would spread the code needed for migration over a lot of 
 files. At the moment it is mainly in one file.

Actualy I thing something like that is already needed. The road/rail
building AI currently has no notion of connecting cities, only
adjacent tiles. With city_min_dist raised that performes really bad.
If a city knew the surrounding cities the auto-worker could build a
road on a line between two cities.

But a lot of AI code needs a fresh look and redesign I feel.

 But is it too much work? If I understood migration right then it is
 done only once every 5 turns.

 That's right. Migration is checked every fifth turn after a city was founded 
 (default settings).

 Does the variable city radii work for you?

Seems to work great so far. I'm not sure the plague settings are fine
tuned yet though. I have a large food box and cities always get plague
before hitting size 12 an requiring a Sewer System. The plague
effectively obsoletes the size 12 limit except when migration happens
a lot and the city shoots up. Not sure if that should be that way.

My biggest city is size 17 so far. I will have to see if the plague
allows the city to grow to size 30 at all.

 Matthias


 MfG
 Goswin

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Freeciv patch #1235: [Metaticket] variable city radii

2009-10-07 Thread Goswin von Brederlow
Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:

 Hello Goswin,

 Thanks for testing the patch. Here only a short answer; more later ...

 At the moment the freeciv development is really fast. So there seems to be
 some changes which require an update of the patch. I tested the entire
 patch set (see patch #1235; https://gna.org/patch/?1235; file #6879:
 cityradius.diff) before I updated it. I will check for compile errors and
 update it today in the evening.

Have you ever used quilt? It might be usefull to provide the colective
diff as quilt series. It is easy enough to generate a quilt series
from git preserving the individual patches and comments from the
individual bug reports you filed.

 To use variable city radii you need some changes to the ruleset. You could
 try my experimental ruleset (patch #1236; https://gna.org/patch/?1236).
 Within this ruleset the following city radii are defined (see
 effects.ruleset and also ./doc/README.ruleset_experimental):

- Activate variable city radii:
radius 1: start
radius 2: city size 3
radius 3: city size 10 + Railroad
radius 4: city size 30 + Railroad + Mass Transit + Super Highway
  The vision range of the city is adapted accordingly.

 To get all the new things listed in this file some additional patches are
 needed (settings patch series for game settings in the game.ruleset file).

What else besides #1235 and #1236?

 Changing the definition to use radius_sq should be possible and would also
 be consistend with the use of radius_sq for borders and vision range. I
 will check this.

 The 'lot of black' in the city window is a known problem. I don't know how
 to code for the (gtk) client. Ideally there would be a 5x5 map (default
 size) and scrolling bars. After opening, this window should be centered on
 the city.

 Please use the bug / patch tracker for comments. It helps to follow the
 discussion(s).

Sure. Just didn't want to clutter it up with compile errors.

I should probably create a login for it too instead of anonymous.

 Matthias

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #14452] Wonders binding other buildings effects

2009-10-07 Thread Goswin von Brederlow
Pepeto pepet...@gmail.com writes:

 Currently, this can be done with the nreqs array.  But I agree with your
 solution which looks better for future.  Maybe the value of the effects
 could be relative or absolute:
 * a absolute value (then the maximal one would be used).
 * a relative value (+=bonus, -=bonus, *=bonus or /=bonus).

 Le mercredi 07 octobre 2009 à 06:14 +0200, Goswin von Brederlow a
 écrit :
 anonymous no-reply.invalid-addr...@gna.org writes:
 
  Follow-up Comment #1, bug #14452 (project freeciv):
 
  Possible guidelines:
 
  1) Never allow building of buildings replaced by active wonder
  2) Always allow building of buildings replaced by active wonder
  3) Allow building buildings replaced by active wonder that will obsolete at
  some point
 
  We should go by 2. Wonder might be in a city that player knows (s)he will
  eventually be unable to defend.
 
 What about when you can already see you are going to loose some city
 to the enemy and it contains the wonder? One might want to build
 replacement buildings before the city falls.
 
 Another issue is with wonders and buildings that don't quite do the
 same:
 
 - a power plant is worse than the Hoover Dam.
 - a solar plant (galactic ruleset) is better than the Hoover Dam.
 
 In general a wonder and a building might have overlapping effects but
 not identical effects.
 
 So having local buildings override the wonder or the wonder override
 the building are both unsatisfactory. It would be nice if the effects
 of the wonder and building would be merged, e.g. take the maximum of
 each effect the wonder and bulding have in common.
 

I also like the way the Pyramids/Granary work. Both have a big effect
but combined you get a little bit extra.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] Freeciv patch #1235: [Metaticket] variable city radii

2009-10-07 Thread Goswin von Brederlow
Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:

 Am Wednesday 07 October 2009 13:22:13 schrieb Goswin von Brederlow:
 Matthias Pfafferodt matthias.pfaffer...@mapfa.de writes:
  Hello Goswin,
 
  Thanks for testing the patch. Here only a short answer; more later ...
 
  At the moment the freeciv development is really fast. So there seems to
  be some changes which require an update of the patch. I tested the entire
  patch set (see patch #1235; https://gna.org/patch/?1235; file #6879:
  cityradius.diff) before I updated it. I will check for compile errors and
  update it today in the evening.

 Have you ever used quilt? It might be usefull to provide the colective
 diff as quilt series. It is easy enough to generate a quilt series
 from git preserving the individual patches and comments from the
 individual bug reports you filed.

 I'm using git (format-patch) and as user interface qgit2. I have not tested  
 quilt.

 I only compile tested the patch for gtk2. Thanks for catching this errors on 
 the other clients!


  To use variable city radii you need some changes to the ruleset. You
  could try my experimental ruleset (patch #1236;
  https://gna.org/patch/?1236). Within this ruleset the following city
  radii are defined (see
 
  effects.ruleset and also ./doc/README.ruleset_experimental):
 - Activate variable city radii:
 radius 1: start
 radius 2: city size 3
 radius 3: city size 10 + Railroad
 radius 4: city size 30 + Railroad + Mass Transit + Super Highway
   The vision range of the city is adapted accordingly.
 
  To get all the new things listed in this file some additional patches are
  needed (settings patch series for game settings in the game.ruleset
  file).

 What else besides #1235 and #1236?

 Nothing! #1235 includes all the patches listed in this metaticket and #1236 
 adds a ruleset which activates the variable city radii. You have to 
 execute 'rulesetdir experimental'. I tested it and got a city with a radius 
 of 5 ;-)


  Changing the definition to use radius_sq should be possible and would
  also be consistend with the use of radius_sq for borders and vision
  range. I will check this.

 It would be possible to use radius_sq. But this would require a complete 
 rewrite of most code of the patch due to the changes needed to the city tiles 
 iterator. All references to city_radius (or the function city_map_radius()) 
 have to be replaced by city_map_radius_sq() ...

 At the moment I don't have much time, but this seems something which should 
 be 
 done. I think 2.3.0 (or 2.2.1?) will have this ;-)

 Matthias

On a related matter, how does migration work with the patch?

The patch says the city radius is considered. Does the other city need
to lie within the city raidus? Do the city radius of both cities need
to overlap? Can there be a gap of x tiles between the city radii of
both cities?

I think the migration distance config option should select this, e.g.

-99: city must lie within city radius
-x: city radii must overlap
0: city radii must touch
x: there may be x tiles between city radii

I think a default of -1 would make sense.

Another option would be that only used tiles of one city that lie
within the city radius of another may cause migration.

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #14452] Wonders binding other buildings effects

2009-10-06 Thread Goswin von Brederlow
anonymous no-reply.invalid-addr...@gna.org writes:

 Follow-up Comment #1, bug #14452 (project freeciv):

 Possible guidelines:

 1) Never allow building of buildings replaced by active wonder
 2) Always allow building of buildings replaced by active wonder
 3) Allow building buildings replaced by active wonder that will obsolete at
 some point

 We should go by 2. Wonder might be in a city that player knows (s)he will
 eventually be unable to defend.

What about when you can already see you are going to loose some city
to the enemy and it contains the wonder? One might want to build
replacement buildings before the city falls.

Another issue is with wonders and buildings that don't quite do the
same:

- a power plant is worse than the Hoover Dam.
- a solar plant (galactic ruleset) is better than the Hoover Dam.

In general a wonder and a building might have overlapping effects but
not identical effects.

So having local buildings override the wonder or the wonder override
the building are both unsatisfactory. It would be nice if the effects
of the wonder and building would be merged, e.g. take the maximum of
each effect the wonder and bulding have in common.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] multiple use of arguments in MACROS and not inlined functions

2009-09-23 Thread Goswin von Brederlow
Hi,

after getting fed up with the slow speed of freeciv in a large game I
did some profiling. One thing I noticed is that there are MACROS that
use one of their arguments twice. With the change to make the
player_index a function call they are not called with a function
call as argument instead of an interger. Using the argument twice
means the function call is executed twice.

In the server 3% of the total time where spend in map_is_known:

[56] 3.05.43   12.74 152585010 map_is_known [56]
8.890.00 305170020/565345748 player_number [62]
3.850.00 305170020/541877534 player_index [103]

Notice how player_number and player_index is called twice for every
map_is_known?

---[ server/maphand.c ]--

/
  Return whether the player knows the tile.  Knowing a tile means
you've
  seen it once (as opposed to seeing a tile which means you can see it
now).
/
bool map_is_known(const struct tile *ptile, const struct player
*pplayer)
{
  return BV_ISSET(ptile-tile_known, player_index(pplayer));
}

---[ utils/shared.h ]--

#define BV_ISSET(bv, bit) \
  (_BV_ASSERT(bv, bit), \
   ((bv).vec[_BV_BYTE_INDEX(bit)]  _BV_BITMASK(bit)) != 0)

---[ common/player.c ]-

/**
  Return the player index.

  Currently same as player_number(), paired with player_count()
  indicates use as an array index.
**/
int player_index(const struct player *pplayer)
{
  return player_number(pplayer);
}

/**
  Return the player index/number/id.
**/
int player_number(const struct player *pplayer)
{
  assert(pplayer);
  return pplayer - game.players;
}

-

Is there any reason BV_ISSET (and similar ones) isn't written as a
static inline function? That one macro alone would save 1.5%.

Inlining the player_number() and player_index() functions (and other
similary trivial and often called functions) would save a lot of time
too. Any reason such frequent one-liners aren't declared static inline
in the header file?

MfG
Goswin

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev