Sun 21 Nov 2010 12:17:46 PM UTC, comment #10:
After r9979, file #21413 no longer applies to trunk. And I think it was never needed anyway. Thus closing this bug.
|
Sun 19 Sep 2010 12:23:57 PM UTC, comment #9:
I applied my patches (file #21433 and file #21494) in r9961 and r9962. Your file #21413 is not in yet.
|
Sun 19 Sep 2010 08:07:23 AM UTC, comment #8:
The attached patch should let the destroyers attack. Please apply this after file #21433. I added many assertions; I hope they won't fail in some corner case.
(file #21494)
|
Sat 18 Sep 2010 10:44:39 PM UTC, comment #7:
The destroyers do not attack because the AI does not find a path to any enemy unit. That happens because unit-destroyer is 2x2 tiles and, when the pathfinder is checking whether the unit could move one step to the north for example, it finds that two of the four tiles at that position are already reserved... by the unit itself! If you set TileSize = {1, 1} in units/destroyer/unit-destroyer.lua, then it will attack.
The other mobile units with large TileSize are unit-bomber and unit-jet. If you made a force using only those, that would hit the same bug, I think. The bug is not specific to naval units.
Some other parts of the engine use UnmarkUnitFieldFlags and MarkUnitFieldFlags to temporarily unreserve the tiles for the duration of pathfinding; the same should be done here, but I'm not sure what would be the appropriate place for that in all these layers of functions.
|
Thu 16 Sep 2010 12:52:58 PM UTC, comment #6:
Hi Kalle,
Same result with your latest patch - the shipyard is built, and destroyers constructed, but they do not attack...
Regards
|
Sat 11 Sep 2010 03:05:52 PM UTC, comment #5:
Hi Kalle,
The first version of your patch made the AI construct the shipyard. I only tested this shortly - more later hopefully.
The shipyard then constructed destroyers, but they did not attack - I will investigate this later.
I will also try your latest patch.
I attached the missing patches to patch 7263.
|
Sat 11 Sep 2010 11:47:50 AM UTC, comment #4:
File #21414 (overpopulation-B-03.map.zip) uses some of the graphics that are missing from patch #7263.
engine/stratagus/iolib.cpp:403: File `patches/goshgeom/terrain4056.png' not found
Can't open file: No such file or directory
Can't load the graphic `patches/goshgeom/terrain4056.png'
|
Sat 11 Sep 2010 08:16:04 AM UTC, comment #3:
Second version of the patch for engine/ai/ai_building.cpp.
(file #21433)
|
Fri 10 Sep 2010 11:37:43 PM UTC, comment #2:
I fixed the assertion failure of comment #1 in r9949, I think.
The attached patch should let the AI find places for shipyards; but it's well past midnight here so I won't be testing it now.
On scripts/ai.lua, I hope Feb will apply your patch.
(file #21429)
|
Wed 08 Sep 2010 06:42:47 AM UTC, comment #1:
One more comment:
When running in debug mode, boswars gives the following message:
engine/ai/ai_building.cpp:337: Want to build a unit-shipyard(Shipyard)
Assertion failed at engine/unit/build.cpp:234: xMin + type->TileWidth < Map.Info.MapWidth
Aborted
|
Wed 08 Sep 2010 06:32:09 AM UTC, original submission:
I am trying to make an AI script that is able to use naval units for attack. This does not work yet, due to different reasons. All tests done with the svn version of yesterday.
1. We need to apply the following patch to scripts/ai.lua - see attachment "NavalAI-01.patch". This patch makes it possible for an engineer to build a unit-shipyard, and for a shipyard to train both naval units, and for an engineer to repair the shipyard.
2. To test this behaviour, I am experimenting with a new map. See attachment "overpopulation-B-03.map.zip". Please do not yet commit this map to the core Boswars - it is not yet finished. This map is based on the goshgeom patchset - see another ticket of me at https://savannah.nongnu.org/patch/?7263.
Start the game, and watch what the enemy is doing: it works correctly through the AI, but when it is time to build a shipyard, the engineers just stand there. The debugging printouts on the commandline show where we are stuck (just count the functions).
3. Hence, the remaining problem I am not able to solve myself: The AI is still not able to pass the line "function() return AiWait("unit-shipyard") end," in the example map, see the "naval.lua" file in that map.
I do not know why, but my guess is that the algorithm to find an empty spot to build a building does not cope with a shipyard, which needs a combination of sea and land (or coast) tiles.
Please help!
|