Topic: AI hints cause the game to crash. -> fixing code
MarkMcWire Topic Opener |
Posted at: 2020-12-02, 10:34
If several buildings have the hint "supports_production_of = {" log "}," or "collects_ware_from_map =" log "," the game crashes. I noticed that because I built two extensions for all building types, including for the foresters and lumberjacks. If I also give this AI Hint to the expanded buildings, I can no longer start the game.
I suggest not checking for exactly 1 here but specifying a range. For example 1 to 3 buildings, if there are extensions. Edited: 2020-12-02, 10:41
My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing Top Quote |
hessenfarmer |
Posted at: 2020-12-02, 12:14
Hi, this will be fixed / gone with the following PR merged. https://github.com/widelands/widelands/pull/4465 Top Quote |
Tibor |
Posted at: 2020-12-02, 14:04
The historical reason for this was that AI decides to have (for example) 5 wood cutters, 2 hunters, 4 wells - and it is simpler if there is only one type of cutter, one type of well and so on. If we allow multiple buildings of the same type - I dont know how ready AI is for it. Top Quote |
MarkMcWire Topic Opener |
Posted at: 2020-12-02, 14:10
My temporary solution / workarround is, only the basic building get the AI hint, the extensions not. So there should be no problem at the moment. My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing Top Quote |
Tibor |
Posted at: 2020-12-02, 20:40
But some assertions fail.... Top Quote |
MarkMcWire Topic Opener |
Posted at: 2020-12-03, 13:25
Can you please explain BTW: I know what an assertion is. My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing Top Quote |
Tibor |
Posted at: 2020-12-04, 16:49
I mean they have some reason to be there. The fact that game does not crash after removing some of them does not mean that no harm was done. Top Quote |
hessenfarmer |
Posted at: 2020-12-04, 17:10
Well, It is extremely probable that the AI could benefit from more generalized handling of buildings which might result from this exercise. Top Quote |