[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-01 Thread Matthias Schoeck
URL:
  

 Summary: Extremely jerky motion when clearing fog
 Project: Battle for Wesnoth
Submitted by: mattsc
Submitted on: Tue 01 Apr 2014 05:37:29 PM UTC
Category: Bug
Severity: 4 - Important
Priority: 5 - Normal
  Item Group: Graphics
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Release: 1.11.12+dev
Operating System: OS X 10.9

___

Details:

Since on-the-fly fog clearing was introduced, unit movement animations can be
very jerky in OS X.  This does not only result in stop-and-go motion, but in
the units jumping back and forth between hexes erratically.

An extreme case is captured in this video
.  (It's 4MB
and with that too large for an attachment.)

This only happens when the map is fogged (yes, fog was on in that video, it
just doesn't show for a technical reason) and it is worse when map, idle and
standing animations are enabled in the preferences, as well as when other
processes take up CPU time.

It happens in both windowed and fullscreen mode, and in normal speed and
accelerated speed.  It also happens for both debug and release builds.

This seems to happen on OS X even on medium-fast systems because 
of the way how the framebuffer is handled on Macs (or something like that, I
don't understand those issues very well).  However, it has been reproduced on
Linux using 'cpulimit -2'.  It is therefore likely an issue at least for slow
systems with other OSs as well.

To reproduce:
- Start first scenario of Heir to the Throne
- Type :debug and :fog (to turn on fog)
- Recruit a couple fighters and end the turn
- On turn 2, move the fighters so that they clear as many fogged hexes as
possible





___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-01 Thread David Mikos
Update of bug #21883 (project wesnoth):

 Assigned to:None => coffee 

___

Follow-up Comment #1:

I believe this is related to https://gna.org/bugs/?21316, where I used a
workaround to fix for the specific case of "skip AI moves."

This bug can be easily replicated on linux by running "cpulimit -10 wesnoth"
(or lower than 10% until the issue is apparent). This does not appear to be a
disk loading issue, but an issue with the algorithm that draws the movement of
units between hexes.

I should have some time to take a look this weekend at this bug, unless jamit
wants to also have a go at it -- given this only occurs with fog/shroud on.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-01 Thread David Mikos
Follow-up Comment #2, bug #21883 (project wesnoth):

Actually with cpulimit and no fog/shroud I get the same type of problem, just
to a lesser extent.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-01 Thread David Mikos
Follow-up Comment #3, bug #21883 (project wesnoth):

Another thing from testing is that I get a similar issue with 1.10.6, just
less of it with the same cpulimit approach on Linux.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-06 Thread David Mikos
Follow-up Comment #4, bug #21883 (project wesnoth):

After a bit more investigation I don't think it is a dirty graphics buffer
issue any more.

In unit_display.ccp the funtion "move_unit_between" has a target_time with a
magic number of 200 for an increment. Increasing this number manually leads to
a cycling of the unit path between the individual hexes in a similar fashion
to the earlier attached video. Lowering it speeds up the animation too
quickly. This issue looks to require some more prodding and poking.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-16 Thread anonymous
Follow-up Comment #5, bug #21883 (project wesnoth):

A few months ago I compiled from git and had this same issue. I had hoped it
would be fixed by now. ;) The git version I used back then was
03777e745bf39a6bd6082ef7766f4326cf543d69, problem is at least this old.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-16 Thread David Mikos
Follow-up Comment #6, bug #21883 (project wesnoth):

Sigh. I had also hoped it would be fixed by now and I'm instead still working
on it.

I thought I might post a script that I've created to quickly test this bug for
reference:

#!/bin/bash
./wesnoth -m &
cpulimit -l 12 -p $! > /dev/null 2>&1

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-19 Thread Christian Bielert
Follow-up Comment #7, bug #21883 (project wesnoth):

Okay, I've created a video showcasing the problem on my system. 

/proc/cpuinfo gives me "Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz", and I'm not
using CPUlimit, nor was there any load on the core running wesnoth(the other
core was doing the recording), so this is a problem that definitely affects
reasonably modern laptops.

(file #20524)
___

Additional Item Attachment:

File name: fog.mkvSize:773 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-19 Thread Christian Bielert
Follow-up Comment #8, bug #21883 (project wesnoth):

Oops looks like my transcoding tool messed up. Let me try that again..

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-19 Thread Christian Bielert
Follow-up Comment #9, bug #21883 (project wesnoth):

Alright, this time it should work properly.

(file #20525)
___

Additional Item Attachment:

File name: fog.mp4Size:850 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-19 Thread David Mikos
Update of bug #21883 (project wesnoth):

  Status:None => Ready For Test 

___

Follow-up Comment #10:

I've pushed a change in commit f2f30b175768e7c456255a3207e6f4b3ffc57b60 for
the 1.13 branch that should fix the problem. Can someone please test that had
this problem before?

The problem looks to me like the default movement animation cycled between 0~1
offsets with increments of 200 ticks. If the tick counter was delayed the
animation between individual hexes could repeat. i.e. 0, 33, 100, 177, 233
(picks up 33 in the next cycle backwards), etc. I set it to match the 'magic
number' in the move_between function that I mentioned before and it appears
smooth here now.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-20 Thread David Mikos
Update of bug #21883 (project wesnoth):

  Status:  Ready For Test => Fixed  

___

Follow-up Comment #11:

Tested to work by mattsc (on irc). Marking as fixed and pushed to the 1.12
branch.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #21883] Extremely jerky motion when clearing fog

2014-04-22 Thread Ignacio R. Morelle
Update of bug #21883 (project wesnoth):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs