bugBattle for Wesnoth - Bugs: bug #21257, Lagging in Unit Movement

Show feedback again

bug #21257: Lagging in Unit Movement

Submitted by:  None
Submitted on:  Tue 05 Nov 2013 07:04:14 PM UTC  
Category: BugSeverity: 4 - Important
Priority: 5 - NormalItem Group: Graphics
Status: FixedPrivacy: Public
Assigned to: J Tyne <jamit>Originator Email: -unavailable-
Open/Closed: ClosedRelease: 1.11.6
Operating System: Mac OS 10.8.5

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

Sat 10 May 2014 09:17:00 AM UTC, comment #19:

Marking as fixed as this solution skips the animation as the setting says should happen.

For information purposes, this is related to https://gna.org/bugs/index.php?21883

The original problem appears to be the fog clearing/drawing algorithm uses a lot of CPU, causing the ticks between frames to go up. The game engine then has to deal with this and at some point the fog drawing mechanism should ideally IMO be rewritten in part to make more use of GPU acceleration. Simply moving to SDL 2.0 might also help with fog clearing in general.

David Mikos <coffee>
Project Member
Thu 24 Apr 2014 12:51:32 AM UTC, comment #18:

Ok, just reporting that I can no longer reproduce as I did in the video, and I tried a few times with various settings so it looks fixed AFAICT.

Chris Beck <involution>
Project Member
Mon 24 Mar 2014 03:04:29 PM UTC, comment #17:

Perhaps the move to SDL 2.0 and the new drawing mechanism will fix the problem later properly.

David Mikos <coffee>
Project Member
Sun 23 Mar 2014 06:31:34 PM UTC, comment #16:

Looks more like a band-aid than a solution.

J Tyne <jamit>
Project MemberIn charge of this item.
Sun 23 Mar 2014 07:45:18 AM UTC, comment #15:

I've committed that bugfix in c770104621aaa2f8f278438f355eb323bd3a0705

This should solve the specific problem of lagging with fog/shroud and skip AI moves enabled.

I hope Jamit you don't mind the proposed solution.

David Mikos <coffee>
Project Member
Sun 23 Mar 2014 01:17:10 AM UTC, comment #14:

A workaround that I have tested for the specific case of lagging with shroud as observer to AI with skip_AI_moves is the following:

in src/unit_display.cpp, make the unit hidden for !animate_ in the "unit_mover::proceed_to" function and then in unit_mover::finish set u.set_hidden(was_hidden_);

This will remove all the in-between lagging frames from the unit movements.

David Mikos <coffee>
Project Member
Sat 21 Dec 2013 10:12:00 PM UTC, comment #13:

Hmm well, I switched to a branch which I had made a few weeks ago and played a game, I observed the lagging only under AI turn this time, and not on the human's turn. So I may not have remembered correctly, despite my previous post just before this one.

I'll check if I can reproduce it whenever this issue in master with clicking on units gets resolved.

Chris Beck <involution>
Project Member
Sat 21 Dec 2013 09:32:48 PM UTC, comment #12:

When I first posted, I observed the same trailing effects happening for human and AI turns. I can't reproduce that right now though, because in the current version of master its not possible to move units by clicking on them, and its been this way for some time. I could compile an older commit and make a video with that but I'm not sure how valuable that would be.

Chris Beck <involution>
Project Member
Sat 21 Dec 2013 08:32:37 PM UTC, comment #11:

The video shows animation problems during the AI's turn with the option to skip AI moves selected. With those two details, I can see similar symptoms on my machine.

However, I am uncertain if fixing what I see will fix the originally reported problem. No one had mentioned something along the lines of "only during AI turns", so I would have to assume the people reporting this issue were seeing it during anybody's turn. (In fact, comment #2 suggests that it did happen during a human player's turn.) While skipping AI moves could be considered the ultimate in accelerated speed, there are differences behind the scenes. So I'll mark this as "confirmed" for now, but there is no guarantee that a fix will fix all the problems reported.

J Tyne <jamit>
Project MemberIn charge of this item.
Sat 21 Dec 2013 08:01:35 PM UTC, comment #10:

Here's a link to a video capture showing the lagging.


Chris Beck <involution>
Project Member
Sat 30 Nov 2013 06:11:29 PM UTC, comment #9:
  • i realized I forgot to post my version. build from source, cloned from github repo wesnoth-old, 1.11.7. I think using commit dated from Nov 23 or so.
Chris Beck <involution>
Project Member
Sat 30 Nov 2013 04:50:25 AM UTC, comment #8:

I'm attaching an ai test scenario I have been using, this one configured to use default ai.

When the save game starts, grunts controlled by ai will immediately attack elves. Any time one of the ai units moves I will see copies of its base frame trailing behind in any hex it moved through. These copies will persist until the unit is done performing its attack.

(file #19398)

Chris Beck <involution>
Project Member
Sat 30 Nov 2013 04:32:14 AM UTC, comment #7:

I get the same issue on my machine, at any speed, with accelerated speed on or off. Running Linux Mint 15 Olivia.

I get it on any scenario it seems. I can paste a specific one if you want.

Chris Beck <involution>
Project Member
Thu 14 Nov 2013 01:31:21 AM UTC, comment #6:

x16, i guess the fog calculation is just slow and maybe your version is just better optimised so you don't see it.

Wed 13 Nov 2013 11:59:58 PM UTC, comment #5:

What speed? I tried 0.5, 2, and 16, and all looked fine.

J Tyne <jamit>
Project MemberIn charge of this item.
Wed 13 Nov 2013 03:55:19 PM UTC, comment #4:

i forgot to metion that you have to activate "accelerated speed" in the preferences. (because i have it enabled by nearly always)

Wed 13 Nov 2013 06:23:11 AM UTC, comment #3:

Still does not reproduce for me. (So I am still relying on clear, detailed reports of symptoms from others.)

But I guess we have ruled out an OS-specific issue, since it's now been reported with Mac and Windows.

J Tyne <jamit>
Project MemberIn charge of this item.
Tue 12 Nov 2013 11:02:21 PM UTC, comment #2:

i have the same problem on and the result is, that i nomrally turn the fog off via debug mode in scenarios. (that might result in having less fun).

win7, 4gbram, 2.6GHz, quadcore not very new but should be enough for wesnoth.
to reproduce:
play "Hammer of Thurgistan". Turn fog on via debug mode. Move the bird-rider as far as possible in right direction.

Fri 08 Nov 2013 02:07:51 AM UTC, comment #1:

System specs? Newish computer? Oldish?

How is the animation, if you ignore the extra base image?

What did you do before taking the screen shot? Who moved? From where? To where? (This type of screen shot is a lot more informative when it is accompanied by a description of what exactly you were doing. By itself, it shows nothing wrong, since it could very well be showing five archers and three scouts.)

J Tyne <jamit>
Project MemberIn charge of this item.
Tue 05 Nov 2013 07:04:14 PM UTC, original submission:

In Wesnoth 1.11.6, whenever shroud/fog is enabled, lagging in unit movement is observed. There are displays of the unit base image in every hex the unit passes to reach the 'go to' hex. A screenshot is attached to show what I mean.



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

Attach File(s):

Attached Files
file #19398:  G4.ai-1.gz added by involution (76kB - application/gzip - 1.11 replay with an Ai player, to demonstrate trailing movement.)
file #19325:  Screen Shot 2013-11-06 at 00.43.13.png added by None (765kB - image/png - A screenshot is attached which provides evidence)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by coffee (Posted a comment)
  • -unavailable- added by involution (Posted a comment)
  • -unavailable- added by jamit (Posted a comment)
  • -unavailable- added by None (Submitted the item)

    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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 May 2014 10:41:10 PM UTCshadowmasterOpen/ClosedOpen=>Closed
    Sat 10 May 2014 09:17:00 AM UTCcoffeeStatusReady For Test=>Fixed
    Sun 23 Mar 2014 07:45:18 AM UTCcoffeeStatusConfirmed=>Ready For Test
    Sat 21 Dec 2013 08:32:37 PM UTCjamitStatusNeed Info=>Confirmed
    Sat 30 Nov 2013 04:50:25 AM UTCinvolutionAttached File-=>Added G4.ai-1.gz, #19398
    Fri 08 Nov 2013 02:07:51 AM UTCjamitStatusNone=>Need Info
      Assigned toNone=>jamit
    Tue 05 Nov 2013 07:04:14 PM UTCNoneAttached File-=>Added Screen Shot 2013-11-06 at 00.43.13.png, #19325
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup