Re: [Freeciv-Dev] (PR#33445) win32 client build broken (patch attached)

2007-01-18 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=33445 

 From: Jonathan Landis [EMAIL PROTECTED]

   I wrote a patch for the Win32 client a couple of weeks ago.

 Thanks for the patch, Jonathan.

 I cannot compile and I have not even seen win32 client, but I looked
some of the most obviously correct things from your patch. Attached is
two patches which I split from your patch and reworked a bit.
 I decided that since worklist_report had player pointer only for
accessing worklists and worklists no longer are part of player
structure, whole player pointer should go.
 Could you check that I have not made any mistakes (that it compiles
for example)? I plan to commit these two soon.
 I'll send another patch containing parts of the original patch that
were left out from these. They probably should go in later.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2006-10-31 18:28:41.0 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2007-01-19 00:41:57.0 +0200
@@ -655,7 +655,7 @@
   
   /* Give tile a background color, based on the type of unit
* FIXME: make a new set of colors for this.   */
-  switch (utype-move_type) {
+  switch (get_unit_move_type(utype)) {
   case LAND_MOVING: bg_color = COLOR_OVERVIEW_LAND;   break;
   case SEA_MOVING:  bg_color = COLOR_OVERVIEW_OCEAN;  break;
   case HELI_MOVING: bg_color = COLOR_OVERVIEW_MY_UNIT;break;
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/menu.c freeciv/client/gui-win32/menu.c
--- freeciv/client/gui-win32/menu.c	2006-10-31 18:28:41.0 +0200
+++ freeciv/client/gui-win32/menu.c	2007-01-19 00:34:58.0 +0200
@@ -602,7 +602,7 @@
   popup_find_dialog();
   break;
 case IDM_GOVERNMENT_WORKLISTS:
-  popup_worklists_report(game.player_ptr);
+  popup_worklists_report();
   break;
 case IDM_GOVERNMENT_REVOLUTION:
   popup_revolution_dialog(NULL);
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/wldlg.c freeciv/client/gui-win32/wldlg.c
--- freeciv/client/gui-win32/wldlg.c	2006-07-17 23:56:51.0 +0300
+++ freeciv/client/gui-win32/wldlg.c	2007-01-19 00:39:09.0 +0200
@@ -37,7 +37,9 @@
 #include log.h
 #include climisc.h
 #include clinet.h
-
+
+#include civclient.h
+
 #include wldlg.h
 #include citydlg.h
 
@@ -124,11 +126,11 @@
 
   /* Fill in the global worklists now?  */
   /* perhaps judicious use of goto would be good here? -mck */
-  if (wl_first  game.player_ptr-worklists[0].is_valid  pcity) {
+  if (wl_first  client.worklists[0].is_valid  pcity) {
 int i;
 
 for (i = 0; i  MAX_NUM_WORKLISTS; i++) {
-  if (game.player_ptr-worklists[i].is_valid) {
+  if (client.worklists[i].is_valid) {
 	dest_wids[wids_used] = wid_encode(FALSE, TRUE, i);
 	wids_used++;
   }
@@ -147,11 +149,11 @@
   }
 
   /* we didn't fill in the global worklists above */
-  if (!wl_first  game.player_ptr-worklists[0].is_valid  pcity) {
+  if (!wl_first  client.worklists[0].is_valid  pcity) {
 int i;
 
 for (i = 0; i  MAX_NUM_WORKLISTS; i++) {
-  if (game.player_ptr-worklists[i].is_valid) {
+  if (client.worklists[i].is_valid) {
 dest_wids[wids_used] = wid_encode(FALSE, TRUE, i);
 wids_used++;
   }
@@ -169,7 +171,6 @@
 struct worklist_report {
   HWND win;
   HWND list;
-  struct player *pplr;
   char worklist_names[MAX_NUM_WORKLISTS][MAX_LEN_NAME];
   char *worklist_names_ptrs[MAX_NUM_WORKLISTS + 1];
   struct worklist *worklist_ptr[MAX_NUM_WORKLISTS];
@@ -235,10 +236,10 @@
   int i, n;
 
   for (i = 0, n = 0; i  MAX_NUM_WORKLISTS; i++) {
-if (preport-pplr-worklists[i].is_valid) {
-  strcpy(preport-worklist_names[n], preport-pplr-worklists[i].name);
+if (client.worklists[i].is_valid) {
+  strcpy(preport-worklist_names[n], client.worklists[i].name);
   preport-worklist_names_ptrs[n] = preport-worklist_names[n];
-  preport-worklist_ptr[n] = preport-pplr-worklists[i];
+  preport-worklist_ptr[n] = client.worklists[i];
 
   n++;
 }
@@ -268,18 +269,18 @@
 
   /* Look for the last free worklist */
   for (i = 0; i  MAX_NUM_WORKLISTS; i++)
-if (!preport-pplr-worklists[i].is_valid)
+if (!client.worklists[i].is_valid)
   break;
 
   for (j = sel; j  i - 1; j++) {
-copy_worklist(preport-pplr-worklists[j],
-  preport-pplr-worklists[j + 1]);
+copy_worklist(client.worklists[j],
+  client.worklists[j + 1]);
   }
 
   /* The last worklist in the set is no longer valid -- it's been slid up
* one slot. */
-  preport-pplr-worklists[i-1].is_valid = FALSE;
-  strcpy(preport-pplr-worklists[i-1].name, \0);
+  client.worklists[i-1].is_valid = FALSE;
+  strcpy(client.worklists[i-1].name, \0);
 
   global_list_update(preport);
 }
@@ -292,9 +293,9 @@
   struct worklist_report *preport = (struct worklist_report *) data;
 
   if (preport) {

[Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34032 

Many players are still struggling to get the upper hand over even the
easiest AI, as evident in for example a very active forum thread
called: Novice AI can still kick my ass. To make a long story short,
players are getting slaughtered by novice AIs because it still has a
very effective playing style and most importantly, because it is
exceedingly aggressive.

I suggest we cripple novice further so that it becomes what players
expect it to be: something that even a novice can stand a chance
against. It should build sparser empires, expand less overseas and be
less militarily aggressive.

This is IMHO a serious problem for single player Freeciv, since
players are exceedingly frustrated because of its steep learning
curve. With online Freeciv on the decline (not least due to the
extended downtime of Pubserver) it is of outmost importance that
single player gaming is promoted.

 ~Daniel



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


[Freeciv-Dev] (PR#34034) wishlist: contol AI aggressiveness

2007-01-18 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34034 

This is related to my ticket about AI difficulty but could be
implemented separately.

This idea would give AIs a new aggressiveness variable besides the
difficulty level. In forum user Sol's words, it could for example be
...a 1-5 value box that would set how agressive the enemy AI is, with
1 being tree-hugger and 5 being Ghengis Khan...

 ~Daniel



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


[Freeciv-Dev] (PR#34035) [Patch] Fix memory leak in terrain.ruleset loading

2007-01-18 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34035 

 $subject


 - ML

diff -Nurd -X.diff_ignore freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c	2006-08-18 10:51:27.0 +0300
+++ freeciv/server/ruleset.c	2007-01-19 04:23:36.0 +0200
@@ -1734,6 +1734,8 @@
 BV_SET(pterrain-native_to, class-id);
   }
 }
+free(slist);
+
 pterrain-helptext = lookup_helptext(file, tsec[i]);
   } terrain_type_iterate_end;
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#33445) win32 client build broken (patch attached)

2007-01-18 Thread [EMAIL PROTECTED]

URL: http://bugs.freeciv.org/Ticket/Display.html?id=33445 

I will test the win32 client build this weekend.

JKL

On 1/18/07, Marko Lindqvist [EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=33445 

 On 1/19/07, Marko Lindqvist [EMAIL PROTECTED] wrote:
   I'll send another patch containing parts of the original patch that
  were left out from these. They probably should go in later.

  Here


  - ML







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


Re: [Freeciv-Dev] (PR#18232) UN nation

2007-01-18 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=18232 

On 1/19/07, Christian Knoke [EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=18232 

 Daniel Markstedt wrote on Jan 14, 19:06 (-0800):
 
  URL: http://bugs.freeciv.org/Ticket/Display.html?id=18232 
 
  A fictional UN nation!
 
  Leaders are its Secretary-Generals and cities are its various agencies.

 ; Dag Hammarskjöld,   in Swedish nation

 I think when this is applied, Dag Hammarskjöld can be moved to the UN
 nation.


Already done!

 AFAICS the WWF is not an UN organisation.


You're correct.

 Christian



 ~Daniel



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


Re: [Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34032 

On 1/19/07, Daniel Markstedt [EMAIL PROTECTED] wrote:
 I suggest we cripple novice further so that it becomes what players
 expect it to be: something that even a novice can stand a chance
 against. It should build sparser empires, expand less overseas and be
 less militarily aggressive.

 We want it to perform badly, not to have rules changed against it. Or?

 About changing rules, attached is untested patch that halves
firepower for novice AI.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/combat.c freeciv/common/combat.c
--- freeciv/common/combat.c	2007-01-19 03:51:15.0 +0200
+++ freeciv/common/combat.c	2007-01-19 04:49:38.0 +0200
@@ -245,6 +245,8 @@
 			int *att_fp, int *def_fp)
 {
   struct city *pcity = tile_get_city(defender-tile);
+  struct player *att_owner;
+  struct player *def_owner;
 
   *att_fp = unit_type(attacker)-firepower;
   *def_fp = unit_type(defender)-firepower;
@@ -283,6 +285,20 @@
 *att_fp = 1;
 *def_fp = 1;
   }
+
+  att_owner = unit_owner(attacker);
+  def_owner = unit_owner(defender);
+
+  if (*att_fp  1
+   att_owner-ai.control
+   ai_handicap(att_owner, H_FIREPOWER)) {
+*att_fp /= 2;
+  }
+  if (*def_fp  1
+   def_owner-ai.control
+   ai_handicap(def_owner, H_FIREPOWER)) {
+*def_fp /= 2;
+  }
 }
 
 /**
diff -Nurd -X.diff_ignore freeciv/common/player.h freeciv/common/player.h
--- freeciv/common/player.h	2006-07-17 23:56:46.0 +0300
+++ freeciv/common/player.h	2007-01-19 04:48:16.0 +0200
@@ -55,7 +55,8 @@
   H_MAP = 1024,   /* Only knows map_is_known tiles */
   H_DIPLOMACY = 2048, /* Not very good at diplomacy */
   H_REVOLUTION = 4096, /* Cannot skip anarchy */
-  H_EXPANSION = 8192 /* Don't like being much larger than human */
+  H_EXPANSION = 8192, /* Don't like being much larger than human */
+  H_FIREPOWER = 16384 /* Reduced firepower */
 };
 
 BV_DEFINE(bv_player, MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS);
diff -Nurd -X.diff_ignore freeciv/server/stdinhand.c freeciv/server/stdinhand.c
--- freeciv/server/stdinhand.c	2007-01-17 13:38:21.0 +0200
+++ freeciv/server/stdinhand.c	2007-01-19 04:46:51.0 +0200
@@ -682,7 +682,8 @@
 | H_REVOLUTION,
  /* novice */   H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
 | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE
-			| H_DIPLOMACY | H_REVOLUTION | H_EXPANSION,
+			| H_DIPLOMACY | H_REVOLUTION | H_EXPANSION
+| H_FIREPOWER,
  /* easy */	H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
 | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE
 | H_REVOLUTION | H_EXPANSION,
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34032 

On 1/19/07, Marko Lindqvist [EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=34032 

 On 1/19/07, Daniel Markstedt [EMAIL PROTECTED] wrote:
  I suggest we cripple novice further so that it becomes what players
  expect it to be: something that even a novice can stand a chance
  against. It should build sparser empires, expand less overseas and be
  less militarily aggressive.

  We want it to perform badly, not to have rules changed against it. Or?

  About changing rules, attached is untested patch that halves
 firepower for novice AI.


  - ML


For the best effect, there should IMO be a combination of the two!

This patch is a good start; what about a similar effect on research?

 ~Daniel



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


[Freeciv-Dev] (PR#34047) glitch in aneglus' GTK theme

2007-01-18 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34047 

Aneglus' custom GTK theme for Freeciv is looking great, but it has a
serious glitch as seen in attached screenshot.

I have been in contact with the author, but he has yet to come up with
a solution. The big question is, is this a bug in the theme, in
Freeciv, or in GTK?

http://forum.freeciv.org/viewtopic.php?t=1636


 ~Daniel

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