AI behaves abnormally when lumberjack´s house disabled

Bug #1794962 reported by Benedikt Straub
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Undecided
Unassigned

Bug Description

Stumbled over this while scripting the 3rd frisian scenario.
In this scenario, all players cannot build lumberjacks and foresters (instead receiving supplies of logs directly into their warehouses), no quarries, hunters and no mines.
The AI behaves very irrational, most importantly it refuses ever to build a militarysite.

Tags: ai scenario

Related branches

Revision history for this message
TiborB (tiborb95) wrote :

Obviously this is hardcoded into AI logic - do not go on until construction of a lumberjack an/or a forester starts...
By my opinion this is very corner case.... it would need specific workaround for the case the buildings are prohibited...

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

I guess that might have to do with basic-economy achieved but this could be workarounded in a scripting scenario. I can have a look into this after we have build 20 out.

Revision history for this message
TiborB (tiborb95) wrote :

Might be

Revision history for this message
Benedikt Straub (nordfriese) wrote :

Perhaps this is not related to the basic economy after all… I now allowed the AI all buildings for testing, and it still refuses to expand, although there´s no apparent reason for it…

Revision history for this message
TiborB (tiborb95) wrote :

What map is it? If it has 4 similar positions, I can include it into pool of testing maps

Revision history for this message
Benedikt Straub (nordfriese) wrote :

It´s in my branch:
lp:~widelands-dev/widelands/fri03
data/campaigns/fri03.wmf
The AI takes players 2 (emp) and 4 (bar), player 1 is human player, slot 3 is empty.

Revision history for this message
Benedikt Straub (nordfriese) wrote :

And could you have a look fri04 (same branch) please? Red player (atl) is performing very poorly there.

Revision history for this message
TiborB (tiborb95) wrote :

I looked at fri03 map, I have some issues due to some strange LUA errors and loadgame crashes. What should I strip to get "pure" map?

Revision history for this message
Benedikt Straub (nordfriese) wrote :

What lua errors are you getting? The loadgame crashes are probably bug 1795871 I guess.
To play without scripting, just rename the fri03.wmf/scripting/init.lua to any other name

Revision history for this message
TiborB (tiborb95) wrote :

I renamed init.lua but I still get:

Fatal exception: [/var/widelands2/BZR/ai_training/src/scripting/lua_errors.cc:22] [/var/widelands2/BZR/ai_training/src/scripting/lua_errors.cc:22] [/var/widelands2/BZR/ai_training/src/logic/description_maintainer.h:77] Tried to add frisians_farm_new twice.
stack traceback:
        [string "scripting/tribes/farm_new.lua"]:3: in main chunk
        [C]: in global 'include'
        [string "scripting/tribes/init.lua"]:5: in local 'func'
        [string "scripting/mapobjects.lua"]:18: in global 'print_loading_message'
        [string "scripting/tribes/init.lua"]:4: in main chunk
stack traceback:
        [string "scripting/tribes/ini

Revision history for this message
Benedikt Straub (nordfriese) wrote :

Um okay… well in that case you can just delete everything inside the scripting folder, then it´ll certainly work, though you´ll have to restore it later if you want to check how the AI behaves under scenario conditions…

Revision history for this message
TiborB (tiborb95) wrote :

Why, is there a reason for AI to behave differently if in scenario?

I just want to verify how the AI cope with this type of map and/or use it for training if suitable.

Revision history for this message
Benedikt Straub (nordfriese) wrote :

I don´t see a reason why it should behave much different, except that it gets different starting wares and workers, and most importantly: no lumberjacks, foresters, mines, quarries, hunters can be built. That might cause conflicts with basic economy, so it could have some impact.

For normal training, it´ll be very difficult, as the AI can´t get ores or granite/marble on this map without the help of scripting…

Revision history for this message
TiborB (tiborb95) wrote :

Well, at least size of territory and territorial growth will be reflected to the training score....

necessity of mines and basic economy is indeed so deeply hardcoded that AI is not able to teach himself to workaround it...

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

For the expansion part I have opened a separate bug. There is already a fix described in.

The forbidden lumberjacks do cause some problems in the AI but this can be circumvented by adding an output section to the HQ buildings in the scenario which contains the wares supplied by script. With this the AI can deal with it. Reason for this is the AI checks whether it is supplied with some wares and the output lines do the trick to convince it it is.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

I think this bug is fixed with the Ai-fixes branch. You just need to take care that if you make a second suplly chain (e.g. for logs) you need to tell the Ai about (adding an output line to a tribe specific building)

Changed in widelands:
status: New → In Progress
assignee: nobody → hessenfarmer (stephan-lutz)
Changed in widelands:
status: In Progress → Fix Committed
Changed in widelands:
assignee: hessenfarmer (stephan-lutz) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Fix Committed → Won't Fix
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.