[Freeciv-Dev] [bug #13557] [RT #40412] AI stops building wonders after game load
Update of bug #13557 (project freeciv): Status: In Progress = None Assigned to: pepeto = None ___ Reply to this item at: http://gna.org/bugs/?13557 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #13557] [RT #40412] AI stops building wonders after game load
Update of bug #13557 (project freeciv): Depends on: = bugs #16648 ___ Reply to this item at: http://gna.org/bugs/?13557 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #13557] [RT #40412] AI stops building wonders after game load
Update of bug #13557 (project freeciv): Status:None = In Progress Assigned to:None = pepeto ___ Reply to this item at: http://gna.org/bugs/?13557 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #13557] [RT #40412] AI stops building wonders after game load
Follow-up Comment #5, bug #13557 (project freeciv): Attaching * x-reverse-ineq-turn75.sav.bz2, a game to reproduce this bug * p22-aiwonder-v1.diff, a failed attempt to fix this bug Load this game with S2_2, take human player Philippe le Hardi, click 'Turn Done', then AIs stop building wonders. Comment #2 showed that 'AI seems to immediately abandon its wonder city' by choosing 'no city as wonder city'. Comment #3 showed that server/savegame.c game_load_internal() calls ai/aicity.c ai_manage_buildings() which 'chooses the wonder city'. I can now explain _why_ it chooses no city. game_load_internal() calls player_load_main() which calls ai_data_get() too early, before loading cities. So ai_data_get() calculates that player has _zero_ cities on each continent. Later ai_manage_buildings() requires more than _five_ cities on the continent of the wonder city. It chooses no city because (ai-stats.cities[place] 5) is false. My p22-aiwonder-v1.diff removes the early call to ai_data_get(). Now ai-stats.cities[place] has correct value and ai_manage_buildings() can choose a city. This is not a complete fix because there are two more problems. 0 AI can choose a different city. World has changed during those turns after the AI began to build a wonder, so ai_manage_buildings() can choose a different city. Then AI abandons wonder at old city and starts wonder at new city. 0 If AI chooses the same city, then this city changes to building Aqueduct for one turn, then returns to building wonder. To reproduce the second problem: 0 Apply p22-aiwonder-v1.diff to S2_2 server. 0 Load x-reverse-ineq-turn75.sav.bz2. 0 Know that AI Tancredo Neves of Brazil chooses Fortaleza as wonder city. 0 Take human player Philippe le Hardi of Burgundy. 0 '/obs Tan' to observe Brazil. 0 See that Fortaleza builds Great Library. 0 '/tak Phi' to play Burgundy. 0 Click 'Turn Done'. 0 Read 'The Brazilians have stopped building The Great Library(W) in Fortaleza.' 0 '/obs Tan' 0 See that Fortaleza builds Aqueduct. 0 '/tak Phi' 0 Click 'Turn Done'. 0 Read 'The Brazilians have started building The Great Library(W) in Fortaleza.' 0 '/obs Tan' 0 See that Fortaleza builds Great Library. I might not find the answer for the Aqueduct problem, nor for the different city problem. (file #10658, file #10659) ___ Additional Item Attachment: File name: p22-aiwonder-v1.diff Size:2 KB File name: x-reverse-ineq-turn75.sav.bz2 Size:28 KB ___ Reply to this item at: http://gna.org/bugs/?13557 ___ 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 #13557] [RT #40412] AI stops building wonders after game load
Follow-up Comment #4, bug #13557 (project freeciv): ai_manage_buildings() of ai/aicity.c is the function that chooses the wonder city. This is the server for Freeciv version 2.2.3+ You can learn a lot about Freeciv at http://www.freeciv.org/ 2: Loading rulesets Breakpoint 1, ai_manage_buildings (pplayer=0x1b06780) at ../../ai/aicity.c:1293 1293 struct ai_data *ai = ai_data_get(pplayer); (gdb) print player_name(pplayer) $1 = 0x1b06781 Philippe le Hardi (gdb) bt #0 ai_manage_buildings (pplayer=0x1b06780) at ../../ai/aicity.c:1293 #1 0x0187924c in game_load_internal (file=0xfffd8bf0) at ../../server/savegame.c:5148 #2 0x01877bfc in game_load (file=0x1b06780) at ../../server/savegame.c:4218 #3 0x01812f64 in load_command (caller=0x20, filename=0xfffd8bf0 (¬¥À, check=32) at ../../server/stdinhand.c:3355 #4 0x0180ae04 in srv_prepare () at ../../server/srv_main.c:2159 #5 0x0180b7c8 in srv_main () at ../../server/srv_main.c:2424 #6 0x01803b04 in main (argc=3, argv=0xfffdad74) at ../../server/civserver.c:359 (gdb) cont Continuing. 2: Philippe le Hardi choosing new wonder city (cause 1). 2: Philippe le Hardi chose no city as wonder city. Breakpoint 1, ai_manage_buildings (pplayer=0x1b07368) at ../../ai/aicity.c:1293 1293 struct ai_data *ai = ai_data_get(pplayer); (gdb) ___ Reply to this item at: http://gna.org/bugs/?13557 ___ 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 #13557] [RT #40412] AI stops building wonders after game load
Follow-up Comment #3, bug #13557 (project freeciv): As the server loads the saved game, the AI seems to immediately abandon its wonder city. I have a patch (file #10375 of bug #16717) that logs the choice of wonder city. When I started my server: This is the server for Freeciv version 2.2.3+ You can learn a lot about Freeciv at http://www.freeciv.org/ 2: Loading rulesets 2: Philippe le Hardi choosing new wonder city (cause 1). 2: Philippe le Hardi chose no city as wonder city. 2: Ashoka choosing new wonder city (cause 1). 2: Ashoka chose no city as wonder city. 2: Tancredo Neves choosing new wonder city (cause 1). 2: Tancredo Neves chose no city as wonder city. 2: José Antonio Páez choosing new wonder city (cause 1). 2: José Antonio Páez chose no city as wonder city. 2: Kwanggaet'o choosing new wonder city (cause 1). 2: Kwanggaet'o chose no city as wonder city. 2: Now accepting new client connections. For introductory help, type 'help'. AI would normally choose a city, but here, AI seems to be running without knowledge of its own cities. As soon as I start the game, AI chooses a wonder city for human players. 2: Connection request from kernigh from localhost 2: c1 has client version 2.2.3+ Starting game. Player 'Ashoka' now has AI skill level 'Easy'. Player 'Tancredo Neves' now has AI skill level 'Easy'. Player 'José Antonio Páez' now has AI skill level 'Easy'. Player 'Kwanggaet'o' now has AI skill level 'Easy'. 2: Philippe le Hardi choosing new wonder city (cause 1). 2: Philippe le Hardi chose Dijon as wonder city. After I click 'Turn Done', AI chooses a wonder city for AI players. (Human player Philippe le Hardi keeps Dijon, but only because I am testing a fix to bug #16717.) 2: Kwanggaet'o choosing new wonder city (cause 1). 2: Kwanggaet'o chose Ungjin as wonder city. 2: José Antonio Páez choosing new wonder city (cause 1). 2: José Antonio Páez chose Trujillo as wonder city. 2: Ashoka choosing new wonder city (cause 1). 2: Ashoka chose Madurai as wonder city. 2: Tancredo Neves choosing new wonder city (cause 1). 2: Tancredo Neves chose Fortaleza as wonder city. Game saved as /home/kernigh/.freeciv/saves/freeciv-T0076-Y-0600-auto.sav.bz2 At the same time, the game also announces that the AI players abandoned their wonders: * The Venezuelans have stopped building The Great Library(W) in Zulia. * The Indians have stopped building The Great Library(W) in Calcutta. * The Brazilians have stopped building The Great Library(W) in Fortaleza. Brazil chooses Fortaleza as wonder city, but does not continue a wonder there, perhaps because Brazil had no wonder city at the end of the previous turn. ___ Reply to this item at: http://gna.org/bugs/?13557 ___ 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 #13557] [RT #40412] AI stops building wonders after game load
Follow-up Comment #2, bug #13557 (project freeciv): Still happening in latest S2_2, for what it's worth. (If you have only a few turns in each session, this seriously weakens the AI, IMO.) ___ Reply to this item at: http://gna.org/bugs/?13557 ___ 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 #13557] [RT #40412] AI stops building wonders after game load
Follow-up Comment #1, bug #13557 (project freeciv): Bug still present in 2.1.9 GTK2 Linux ___ Reply to this item at: http://gna.org/bugs/?13557 ___ 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 #13557] [RT #40412] AI stops building wonders after game load
URL: http://gna.org/bugs/?13557 Summary: [RT #40412] AI stops building wonders after game load Project: Freeciv Submitted by: mbook Submitted on: Sunday 05/24/2009 at 03:19 Category: ai Severity: 3 - Normal Priority: 1 - Later Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Release: Operating System: None ___ Details: Subject: Bug report Date: Mon, 28 Jul 2008 11:29:11 +0300 To: rep...@rt.freeciv.org From: gintl...@gmail.com Hi, every time I load saved game all AI players stops building all wonders if any are in progress. It happens every time and is easy to reproduce. Tried it with 2.1.4 and 2.1.5 versions which I downloaded from official site (GTK + client binary distribution). I run it under Windows XP SP3. Best regards Gintas ___ Reply to this item at: http://gna.org/bugs/?13557 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev