Latest Posts

Topic: WorkareaInfo size 4 fatal exception

Kontorotsui
Avatar
Topic Opener
Joined: 2021-05-20, 14:35
Posts: 40
Ranking
Pry about Widelands
Posted at: 2023-08-23, 17:16

Hello, I am getting this:

[00:00:11.983 real] ERROR: ##############################
[00:00:11.983 real] ERROR:   FATAL EXCEPTION: [/run/build/Widelands/src/wui/interactive_base.cc:634] Encountered unexpected WorkareaInfo size 4
[00:00:11.983 real] ERROR: ##############################
[00:00:11.983 real] ERROR:   Please report this problem to help us improve Widelands.
[00:00:11.983 real] ERROR:   You will find related messages in the standard output (stdout.txt on Windows).
[00:00:11.983 real] ERROR:   You are using version 1.2~git26360 (ddfa8b6@protected/navalwarfare) Release.
[00:00:11.983 real] ERROR:   Please add this information to your report.
[00:00:11.983 real] ERROR:   If desired, Widelands attempts to create an emergency savegame.
[00:00:11.983 real] ERROR:   It is often – though not always – possible to load it and continue playing.
[00:00:11.983 real] ERROR: ##############################

This never happened in previous builds. It seems to happen only with wells and only when I try to select it for building, as soon as the pointer touches the picture, this is triggered.

I'm using a modified "europeans" tribe, modified from the one made available as extension.

I tried to change radius but I get the same error.

The relevant program is this:

        mining_water = {
            -- TRANSLATORS: Completed/Skipped/Did not start mining water because ...
            descname = pgettext("europeans_building", "mining water"),
            actions = {
                "return=skipped unless economy needs water",
                "animate=working duration:15s",
                "mine=resource_water radius:1 yield:50% when_empty:50%",
                "produce=water"
            }
        },

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1985
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2023-08-23, 17:30

The problem is that the workarea rendering code assumes that no building will have more than 3 work area circles. If a building has lot of enhancement stages with different work area sizes as with Europeans, then this limit might be exceeded and the workarea cannot be rendered. So such buildings should currently be avoided.

Relevant code is in InteractiveBase and WorkareaProgram in case anyone wants to adapt it, but this would be pretty messy to extend…


Top Quote
Kontorotsui
Avatar
Topic Opener
Joined: 2021-05-20, 14:35
Posts: 40
Ranking
Pry about Widelands
Posted at: 2023-08-24, 09:00

Nordfriese wrote:

The problem is that the workarea rendering code assumes that no building will have more than 3 work area circles. If a building has lot of enhancement stages with different work area sizes as with Europeans, then this limit might be exceeded and the workarea cannot be rendered. So such buildings should currently be avoided.

Relevant code is in InteractiveBase and WorkareaProgram in case anyone wants to adapt it, but this would be pretty messy to extend…

Thanks, that is a pretty clear explanation. It is pretty reasonable too.

I did a test, if I do a 6 stage building, 2 with radius 1, 2 with radius 2, 2 with radius 3, it works. Provided the different radius are max 3, there can be any stage.

Edited: 2023-08-24, 09:55

Top Quote