Pointer tracking
Moderator: Moderators
Pointer tracking
Stupid, trivial request, would be pretty cool though IMHO:
http://www.flickr.com/photos/anatoliy_z ... 271592658/
He provides links to his program, and might be willing to lend us the source. It can't be all that difficult to code though. Heck, it could probably even be done in lua but I don't know if all the capabilities are there so I'm putting this in feature requests.
Basically, the game would optionally output an image which represents all of your mouse movement during the game, as one solid line. Clicks appear as small dots, while periods where the cursor doesn't move at all appear as increasingly large dots (this part would probably be unnecessary).
http://www.flickr.com/photos/anatoliy_z ... 271592658/
He provides links to his program, and might be willing to lend us the source. It can't be all that difficult to code though. Heck, it could probably even be done in lua but I don't know if all the capabilities are there so I'm putting this in feature requests.
Basically, the game would optionally output an image which represents all of your mouse movement during the game, as one solid line. Clicks appear as small dots, while periods where the cursor doesn't move at all appear as increasingly large dots (this part would probably be unnecessary).
Re: Pointer tracking
Lua-ing it is possible. Go do it, Caydr! 

Re: Pointer tracking
I'm too busy making boring lua to make awesome lua, why don't you do it?
Re: Pointer tracking
why not add it to the "Ally Cursors" widget by Jk and TheFatController?
or use existing code(if permitted?)
or use existing code(if permitted?)
Re: Pointer tracking
IMHO adding mostly-unrelated features to widgets that are already working perfectly and polished isn't a good thing if it can be avoided.
But you gave me an idea though: since that data is available, what if you made another new widget which tracks cursor position for all allied players. Instead of just tracking movement within local screen space, you'd use the entire map and draw lines representing cursor movement as their player color. Maybe add a little guide in one corner that says what color is what.
Both of these ideas are basically just toys I guess but I think they'd be fun to see. And, for example, with some studying you'd probably be able to pretty much tell whether a player is high-level or not independent of what his rank is, without having to actually watch the whole replay. If possible track all players' cursor positions, not just allies... though I'm not sure if that's possible/exploitable.
But you gave me an idea though: since that data is available, what if you made another new widget which tracks cursor position for all allied players. Instead of just tracking movement within local screen space, you'd use the entire map and draw lines representing cursor movement as their player color. Maybe add a little guide in one corner that says what color is what.
Both of these ideas are basically just toys I guess but I think they'd be fun to see. And, for example, with some studying you'd probably be able to pretty much tell whether a player is high-level or not independent of what his rank is, without having to actually watch the whole replay. If possible track all players' cursor positions, not just allies... though I'm not sure if that's possible/exploitable.
Re: Pointer tracking
second version, draws circles where the mouse rested. no idea how terribly inefficient my opengl is.
I'm gonna play a game and upload a screenshot of my mouse movements.
edit: oops, has debug echo in it still, will remove when I upload screenshot from this game
I'm gonna play a game and upload a screenshot of my mouse movements.
edit: oops, has debug echo in it still, will remove when I upload screenshot from this game
Re: Pointer tracking
I get a decent fps hit lategame when viewing, although my computer is fast enough it's not a problem... any tips on optimizing the opengl would be nice.
edit: I might make a script to generate this given any replay played with ally cursors
edit: I might make a script to generate this given any replay played with ally cursors
Re: Pointer tracking
three issues (code-wise):
1. widgets aren't isolated objects neither is OpenGL, means reset all your changed GL states when you use non-default ones (here: glLineWidth & glColor)
2.glTranslate can't be called in a glBegin ... glEnd context. Also GL_POLYGON is the slowest of all primitives.
3. Don't use ipairs at all and pairs only when needed -> use "for i=1,#array do ... end" as often as possible.
Also don't use table.insert/remove when not needed, use "array[#array+1] = newval".
PS: I forgot the default for the DrawWorld callin, but it's possible that you should disable DepthMask and Blending.
PPS: You should use DrawScreenEffects instead of DrawWorld. ^^
1. widgets aren't isolated objects neither is OpenGL, means reset all your changed GL states when you use non-default ones (here: glLineWidth & glColor)
2.
Code: Select all
local function DrawGroundFillCircle(v)
x, y, z, r = v[1], v[2], v[3], v[4]
glTranslate(x, y, z)
for a=0, 6.2831853, 0.1 do
glVertex(x + r*math.cos(a), y, z + r*math.sin(a))
end
end
local function DrawMouseStops(nodes)
for _, v in pairs(nodes) do
glBeginEnd(GL_POLYGON, DrawGroundFillCircle, v)
end
end
3. Don't use ipairs at all and pairs only when needed -> use "for i=1,#array do ... end" as often as possible.
Also don't use table.insert/remove when not needed, use "array[#array+1] = newval".
PS: I forgot the default for the DrawWorld callin, but it's possible that you should disable DepthMask and Blending.
PPS: You should use DrawScreenEffects instead of DrawWorld. ^^
Re: Pointer tracking
how would you suggest I draw the circles? I need to draw a filled circle at (x, y, z, r), preferably inverting its color based on the circle color below it (so circles can overlap)
as for the glTranslate, it worked <_<
as for the glTranslate, it worked <_<
Re: Pointer tracking
No, it doesn't work, you just don't check the glerror stack.
The reason why the circles are still rendered is cause you do:
glVertex(x + r*math.cos(a), y, z + r*math.sin(a))
The reason why the circles are still rendered is cause you do:
glVertex(x + r*math.cos(a), y, z + r*math.sin(a))
Re: Pointer tracking
oh right, lol. coding while tired. forgot to remove the translate after I fixed the vertex
Re: Pointer tracking
DrawScreenEffects won't draw my lines and circles <_<
Re: Pointer tracking
updates:
- reset glLineWidth and glColor after DrawWorld
- removed glTranslate
- changed GL_POLYGON to GL_TRIANGLE_FAN
- using more efficient table operations
- interface and map marks are hidden while Z is pressed
Re: Pointer tracking
That doesn't really reset gl line width or colour, just sets them to something different when you're done 
Look into glPushAttrib().

Look into glPushAttrib().