bugBattle for Wesnoth - Bugs: bug #21884, Units with many [advancement] tags...

Show feedback again

bug #21884: Units with many [advancement] tags cause graphic slowdowns

Submitted by:  None
Submitted on:  Tue 01 Apr 2014 09:16:19 PM UTC  
Category: BugSeverity: 2 - Minor
Priority: 2Item Group: Graphics
Status: NonePrivacy: Public
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: OpenRelease: 1.10
Operating System: All

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri 27 Jun 2014 09:57:46 PM UTC, comment #4:

Ok i think https://github.com/wesnoth/wesnoth/pull/226 caused a lot of speedup in this case.

Also it seems like the slowdown by many advancements is O('number of [advance]' * 'number of [advancement]') or similar, since there are known workarounds against having very much [advancement]s in a unit i'm decreasing this bugs priority.

Daniel <gfgtdf>
Project Member
Thu 26 Jun 2014 08:24:53 PM UTC, comment #3:

i can reproduce this issue.

The reason is that we want to know whether a unit can advance to decide for the color of the xpbar. To do this we check for all possible advancements whther we have already [advancemnt]s with that id.

1) controller_base::play_slice(bool)
2) display::draw(bool,bool)
3) game_display::draw_invalidated(void)
4) display::draw_invalidated(void)
5) unit_drawer::redraw_unit(class unit const &)const
6) unit::can_advance(void)const
7) unit::get_modification_advances(void)const
8) unit::modification_count(class std::string const &,class std::string const &)const


6) unit::xp_color(void)const
7) unit::get_modification_advances(void)const
8) unit::modification_count(class std::string const &,class std::string const &)const

Daniel <gfgtdf>
Project Member
Tue 22 Apr 2014 10:50:57 PM UTC, comment #2:

Marking invalid at OP's request (apparently).

Chris Beck <involution>
Project Member
Thu 03 Apr 2014 11:26:53 PM UTC, comment #1:

I investigated it deeper and found out that it didn't use more CPU cycles than other units with the same number of animations. I am very sure that I have seen a single unit with a standing animations eating like 70% CPU on a 2.21 GHz processor in the past, but I believe proper experiments more than witnesses, even if I am the witness. The cause must have been elsewhere.

Please delete this.

The original poster

Tue 01 Apr 2014 09:16:19 PM UTC, original submission:

Units with too many [advancement] tags cause irrational slowdowns. In the save file I provided, they cause quite a huge CPU usage. Sometimes, it goes even to FPS drops. It seems that the [advancement]s are somehow processed every time a frame is rendered.



(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #20452:  Slowdowns.gz added by None (973kB - application/x-gzip - Use with the Legend of the Invincibles add-on)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by gfgtdf (Posted a comment)
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by involution (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 27 Jun 2014 09:57:46 PM UTCgfgtdfSeverity3 - Normal=>2 - Minor
      Priority5 - Normal=>2
    Thu 26 Jun 2014 08:24:53 PM UTCgfgtdfStatusInvalid=>None
    Wed 23 Apr 2014 01:02:21 AM UTCshadowmasterOpen/ClosedOpen=>Closed
    Tue 22 Apr 2014 10:50:57 PM UTCinvolutionStatusNone=>Invalid
    Tue 01 Apr 2014 09:16:19 PM UTCNoneAttached File-=>Added Slowdowns.gz, #20452
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup