improved citadel/castle village trunk production

Bug #1282530 reported by fk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Wishlist
Unassigned

Bug Description

This problem has already been broached in https://bugs.launchpad.net/widelands/+bug/1226624 but without any results.

The problem is that the AI often runs out of trunks before the first woodcutters hut has been finished and gets stuck on this. Providing the AI with more trunks initially does not solve the problem.

The attached file contains functions that divide the area around the castle in 7 regions, and tries to select the most suitable region to build both a lumberjack/woodcutters hut and a ranger/foresters hut. These functions can be called with the function calls defined below:

use("aux", "wood_village")

Atlanteans:
place_woodcutter_and_forester(plr, sf, "woodcutters_house", "foresters_house")

Barbarians:
place_woodcutter_and_forester(plr, sf, "lumberjacks_hut", "rangers_hut")

Empire:
place_woodcutter_and_forester(plr, sf, "lumberjacks_house", "foresters_house")

Tags: ai economy lua
Revision history for this message
fk (fredkuijper) wrote :
Revision history for this message
fk (fredkuijper) wrote :
Revision history for this message
fk (fredkuijper) wrote :
Revision history for this message
fk (fredkuijper) wrote :
Revision history for this message
SirVer (sirver) wrote :

A few comments - I think this method should be in infrastructure - though they are a little more general than the other methods in there. Also, passing in the names of the buildings is rather fragile - you know which tribe the player has, so you can figure out the buildings inside the method too. And lastly: a pull request is much easier to work with, for example to make those changes in there :)

Changed in widelands:
milestone: none → build19-rc1
importance: Undecided → Wishlist
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
fk (fredkuijper) wrote :

"you know which tribe the player has, so you can figure out the buildings inside the method too"

Good suggestion, I hadn't realised that.

I think that anyone can already use these modules for him/herself, it is no more than copy/paste (4x).
Time will learn if it was a good idea, or obsoleted by a stronger AI. :)

Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: In Progress → Incomplete
Revision history for this message
SirVer (sirver) wrote :

Tibor, what do you think of this?

Changed in widelands:
assignee: nobody → TiborB (tiborb95)
Revision history for this message
TiborB (tiborb95) wrote :

I think that the problem "The problem is that the AI often runs out of trunks before the first woodcutters hut has been finished and gets stuck on this." does not exist anymore, unless in very constrained areas. So I would close this as not relevant anymore

Revision history for this message
SirVer (sirver) wrote :

no, much rather you improvements made this fixcommitted.

Changed in widelands:
status: Incomplete → Fix Committed
assignee: TiborB (tiborb95) → nobody
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.