AI crashes when a producer is also supporter

Bug #1728006 reported by Benedikt Straub
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Wishlist
Unassigned

Bug Description

Playing the 1st frisian scenario, I got the following crash:

Fatal exception: [/home/benedikt/widelands-debug/frisians/src/ai/defaultai.cc:2308] AI: Max presciousness must not be <= 0 for building: frisians_farm
FATAL ERROR - game crashed. Attempting emergency save.
Game: Writing Preload Data ... Speicherzugriffsfehler (Speicherabzug geschrieben)

The crash is triggered by conquering one of the last military buildings the AI owns. The AI loses a number of buildings from that.
In the attached savegame (needs frisians datadir!), the crash will happen within a short time.
Since the code isn´t tribe-specific, this crash shouldn´t be related to the AI playing as frisians.

Related branches

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

Is frisian branch functional? (I dont want to shuffle the data dir)
Perhaps loosing player just lost last farm... I will look at it...

Revision history for this message
TiborB (tiborb95) wrote :

After some investigation I see that you are mixing two types of productionsite - supporter and producer. AI is not ready for this, both types has different code path when building. Supporting site has max_needed_preciousness=0, as it has no outputs...

I think this was discussed before....

Changed in widelands:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Benedikt Straub (nordfriese) wrote :

Removing the "supports_production_of" from the farm solves the problem.

This makes now three buildings the AI can´t cope with yet. In two cases (farm and reed farm) because it supports the bee-keeper while having outputs; in one case (reindeer farm) because it produces wares and workers. Also, I´m still not entirely sure the AI really understands the pairing of claypit and aqua farm. These issues will need fixing before frisians are ready for merge…

Revision history for this message
TiborB (tiborb95) wrote :

I dont like this change, because either I will need to create separate category of buildings of 'producers and supporters at the same time', or perhaps somehow merge producers and supporters into one category. Both options add complexity to already complex code.
Nevermind, I just have 3 branches opened, but when I get rid of them I will look at this...

TiborB (tiborb95)
summary: - AI crashes the game while being conquered
+ AI crashes when a producer is also supporter
TiborB (tiborb95)
Changed in widelands:
status: Confirmed → In Progress
GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
assignee: TiborB (tiborb95) → GunChleoc (gunchleoc)
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
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.