Bug 889685

Summary: mesa update broke the megaglest package
Product: [Fedora] Fedora Reporter: Paulo Andrade <paulo.cesar.pereira.de.andrade>
Component: mesaAssignee: Adam Jackson <ajax>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ajax
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-16 21:49:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paulo Andrade 2012-12-22 15:16:40 UTC
The game is not playable because mouse events appear
became completely bogus. Mouse works correctly in
menus, but not in game when selecting units or if
having selected units, right clicking to give orders
to units.

Problem was reported upstream at
https://sourceforge.net/tracker/?func=detail&aid=3598159&group_id=300350&atid=1266776

Comment 1 Paulo Andrade 2013-01-06 17:40:47 UTC
This may not be exactly a glew problem, but I found
these after some google'ing:

This describes the exact same problem I see:
http://forums.fedoraforum.org/showthread.php?t=286192

interesting the comment that it works with proprietary
driver but not free driver. But reports the problem for
fedora 17, but I do not have this problem in my fedora
17 test computer (with intel video driver).

After some extra searching I also found this pastebin
with an interesting title "MegaGlest Unit Moving Error":
http://pastebin.com/ixLmnAGG

My current guess after a few rebuilds and reading the
code is that the fault is at:

source/glest_game/graphics/renderer.cpp:6602

...
	//get the world coordinates
	gluUnProject(
		screenX, screenY, depth,
		modelviewMatrix, projectionMatrix, viewport,
		&worldX, &worldY, &worldZ);
...


I suspect it is returning bogus "world" coordinates there.

If insisting in playing, sometimes it will work, usually when
clicking in a region just a few pixels in the "fog of war",
and always work if clicking in another unit, that is, smart
casting it to move/follow another unit. Also, telling works
to build a construction appears to always work.

Comment 2 Paulo Andrade 2013-01-11 02:08:27 UTC
I found a workaround. Add:

EnableColorPicking=true

to $HOME/.megaglest/glestuser.ini

search for EnableColorPicking in
BUILD/megaglest-3.7.1/source/glest_game/graphics/renderer.cpp
to see the alternate/default code paths.

Comment 3 Paulo Andrade 2013-01-12 16:46:38 UTC
I just updated to latest rawhide, after update to new
X Server and rebuild of all drivers, etc.
The workaround is still necessary.

One possible helpful extra bit of information is that,
if not using the workaround it is "possible" to play
if one selects the units, does maximal zoom, and them
right click for the "smart action" (attack/move/gather).
Example:
1. select worker
2. zoom to have camera looking in the ground
3. move to some resource, usually gold
4. right click on the resource
5. profit

Comment 4 Paulo Andrade 2013-01-16 21:49:43 UTC
Upstream tells that "selectbuf" is not longer supported
by OpenGL and was already known to be buggy in a few
drivers, just that now it does not work with drivers
that defer some fallbacks to mesa.
Megaglest will be updated to use the "colorpick" mode,
so, for now the only solution for drivers that do not
work is to add
EnableColorPicking=true
to $HOME/.megaglest/glestuser.ini
until the next megaglest release, that will have the
above by default.